Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install on Windows; passes c++0x instead of c++11 #58

Closed
aadler opened this issue Mar 30, 2016 · 13 comments
Closed

Unable to install on Windows; passes c++0x instead of c++11 #58

aadler opened this issue Mar 30, 2016 · 13 comments

Comments

@aadler
Copy link
Contributor

aadler commented Mar 30, 2016

I am on Windows 7 64bit using Rtools 3.3.0 v1959, and can build R (building R-patched_2016-03-28) and pretty much every package from source successfully. However, when trying to install feather via devtools, I get the following. Please note that somehow, c++0x is being passed even though my .R/Makevars has CXXFLAGS = -std=c++11 (which manifests properly in every other package, such as Rcpp). Would that have anything to do with the issue?

Also, as it seems to have an issue with api.h, does it matter that the file is actually at "feather/cpp/src/feather/api.h" and not in the feather/R subdirectory?

Thank you.

> devtools::install_github("wesm/feather/R")
Downloading GitHub repo wesm/feather@master
from URL https://api.github.com/repos/wesm/feather/zipball/master
Installing feather
"F:/R/RCurrent/R-32~1.4PA/bin/x64/R" --no-site-file --no-environ --no-save --no-restore CMD INSTALL  \
  "F:/R/tmp/Rtmp8WR3lV/devtools52e047974bda/wesm-feather-a58e3be/R" --library="F:/R/RCurrent/R-3.2.4patched/library" --install-tests 

* installing *source* package 'feather' ...

   **********************************************
   WARNING: this package has a configure script
         It probably needs manual configuration
   **********************************************


** libs
F:/R/Rtools/mingw_64/bin/g++  -std=c++0x -I"F:/R/RCurrent/R-32~1.4PA/include" -DNDEBUG -I. -march=native -pipe  -I"F:/R/RCurrent/R-3.2.4patched/library/Rcpp/include" -I"F:/R/RLocalSoft/include"     -O2 -Wall  -march=native -pipe -c RcppExports.cpp -o RcppExports.o
F:/R/Rtools/mingw_64/bin/g++  -std=c++0x -I"F:/R/RCurrent/R-32~1.4PA/include" -DNDEBUG -I. -march=native -pipe  -I"F:/R/RCurrent/R-3.2.4patched/library/Rcpp/include" -I"F:/R/RLocalSoft/include"     -O2 -Wall  -march=native -pipe -c feather-read.cpp -o feather-read.o
feather-read.cpp:4:25: fatal error: feather/api.h: No such file or directory
 #include "feather/api.h"
                         ^
compilation terminated.
make: *** [feather-read.o] Error 1
Warning: running command 'make -f "Makevars" -f "F:/R/RCurrent/R-32~1.4PA/etc/x64/Makeconf" -f "F:/R/RCurrent/R-32~1.4PA/share/make/winshlib.mk" -f "E:/Users/Parents/Documents/.R/Makevars" CXX='$(CXX1X) $(CXX1XSTD)' CXXFLAGS='$(CXX1XFLAGS)' CXXPICFLAGS='$(CXX1XPICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX1XLDFLAGS)' SHLIB_LD='$(SHLIB_CXX1XLD)' SHLIB="feather.dll" WIN=64 TCLBIN=64 ' had status 2
ERROR: compilation failed for package 'feather'
* removing 'F:/R/RCurrent/R-3.2.4patched/library/feather'
Error: Command failed (1)
@eddelbuettel
Copy link

Please note that somehow, c++0x is being passed

You need to rebuild R itself with gcc 4.9.3-based toolchain so that R writes down its compile-time configuration in $RHOME/etc/Makeconf to be used for packages.

What you have in ~/.R/Makevars is always in addition to and does not overwrite these settings.

So in short, until R 3.3.0 is out and everybody gets a rebuilt R, you have to do it by hand.

@aadler
Copy link
Contributor Author

aadler commented Mar 30, 2016

Of course I did that 8-) . I've been working with Jeroen for almost a year now. I haven't had c++0x since the last time I used 4.6.3 which was maybe August of 2015? Everything is built using Rtools 3.3.0.1959 (which you can see from the call to g++, as it isn't multilib but BINPREF64 "F:/R/Rtools/mingw_64/bin/g++")

@eddelbuettel
Copy link

I have no bone in this fight---I am just trying to give you a pointer as to where this may come from. Same part of your story here makes no sense: I your entire stack was built with 4.9.3 you wouldn't have this issue, hence my hint. So my guess is that the R you are attempting to build Feather with was not built with the new toolchain -- which is why you get c++0x which is all it can do with the ancient compiler.

@aadler
Copy link
Contributor Author

aadler commented Mar 30, 2016

Understood. What is weird is that I uninstalled both R and Rstudio, and built R from source from scratch using the current Rtools (which is the only way to get an Rpatched—build it from source). I watched the compilation and it worked fine (passed make check-all). All the C++ packages (Rcpp, RcppArmadillo, etc.) compiled with std=c++11. Dplyr of course still has to be installed w/o it (as does gmp and plyr, but that's a different issue). Every one of the 80+ packages which I know do not have issues with c++11 (including devtools) did compile with c++11. I call install_github("wesm/feather/R") and I get the c++0x. Unless there is a file from a year-old compilation somewhere that this one package out of all finds, I don't understand.

Also, the c++0x may not be fatal in and of itself, the missing api.h, which is not found in the feather/R directory but the feather/cpp/src/feather/ directory may be more of an issue.

Thank you.

@wesm
Copy link
Owner

wesm commented Mar 30, 2016

Note: https://github.com/wesm/feather/blob/master/R/configure

You will need to copy these files to the right location (which will be automagically handled in CRAN packaging) manually

@aadler
Copy link
Contributor Author

aadler commented Mar 30, 2016

Thanks. Cloning the entire repository and moving cpp/src/feather and flatbuffer to R/src got past that problem. Next problem is that feather/io-test is looking for gtest/gtest.h which I presume is google testing but is not included in any of the files. I guess I that must be locally on your machine and in your path, but not part of this package. I can hunt that down, I reckon.

Any thoughts about why this package, of the dozen or so C++ packages I install from source on a regular basis, ignores my .R/Makevars and passes -std=c++0x and not -std=c++11?

Thanks again.

@aadler
Copy link
Contributor Author

aadler commented Mar 30, 2016

Never mind, I didn't grok the rm files portion of the configuration.

Also, on Windows, what should we do about missing sys/mman.h?

Still concerned about the c++0x vs c++11 though. Thanks.

@eddelbuettel
Copy link

I still think it is you. On my (non-Windows) system:

edd@max:~$ R CMD config CXX1XSTD
-std=c++11
edd@max:~$ 

I have looked at length into how R gets these values, and invariable you get back to RHOME/etc/Makeconf. Unless you built R with g++ 4.9.3 you will have c++0x here. And even if you did maybe R still gets this wrong on Windows as 4.9.3 is no new. But I (again) suggest you check your Makeconf file. Not the local override -- the one R falls back to.

@aadler
Copy link
Contributor Author

aadler commented Mar 30, 2016

@eddelbuettel You are a genius. Yup, it is in the dreaded RHOME/src/gnuwin32/fixed/etc where many sins are hidden and monsters abound 8-) . The Makeconf file there, as opposed to the ones every else under gnuwin32, has "CXX1XSTD = -std=c++0x". I almost always get around that for packages which call Makevars and don't demand C11 by adding or removing the line from.R/Makevars. Thank you.

I'll make a note on R-sig-windows that Duncan may want to update that for the R-3.3.0 release. Thanks again!

@eddelbuettel
Copy link

No, surely not a genius, but maybe just about as stubborn as you :)

I chased these ghosts too in the past, and it is a plain that you cannot override them. CXXFLAGS != CXX1XFLAGS and all that doesn't help either ....

@eddelbuettel
Copy link

So I guess this can be closed as it was after all a local issue.

@aadler
Copy link
Contributor Author

aadler commented Mar 30, 2016

I'll just have to overwrite that file too when I build base r.

The sys/Mann.h issue is still open, unfortunately.

On Wednesday, March 30, 2016, Dirk Eddelbuettel notifications@github.com
wrote:

So I guess this can be closed as it was after all a local issue.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#58 (comment)

Sent from Gmail Mobile

@aadler
Copy link
Contributor Author

aadler commented Mar 31, 2016

@eddelbuettel I thought about on the rest of the ride home, and I think you are correct. There are too many issues going on in this one. As the two I started with are answered, I'll close this and open a new one. Thank you and @wesm again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants