You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rcpp compiles using -std=gnu++11 but not -std=c++11. Is this a toolchain issue or an Rcpp issue? #360
Whilst trying to test the new Windows toolchains based on GCC 4.9.x, I have come across an interesting issue. When I compile Rcpp with either nothing or std=gnu++11, Rcpp compiles without any issues. However, when I pass std=c++11 I get:
* installing *source* package 'Rcpp' ...
** package 'Rcpp' successfully unpacked and MD5 sums checked
** libs
g++ -m64 -I"C:/R/R-PATC~2/include" -DNDEBUG -I../inst/include/ -I"C:/R/RLocalSoft/extsoft/include" -std=c++11 -O2 -mtune=ivybridge -pipe -c Date.cpp -o Date.o
g++ -m64 -I"C:/R/R-PATC~2/include" -DNDEBUG -I../inst/include/ -I"C:/R/RLocalSoft/extsoft/include" -std=c++11 -O2 -mtune=ivybridge -pipe -c Module.cpp -o Module.o
g++ -m64 -I"C:/R/R-PATC~2/include" -DNDEBUG -I../inst/include/ -I"C:/R/RLocalSoft/extsoft/include" -std=c++11 -O2 -mtune=ivybridge -pipe -c Rcpp_init.cpp -o Rcpp_init.o
g++ -m64 -I"C:/R/R-PATC~2/include" -DNDEBUG -I../inst/include/ -I"C:/R/RLocalSoft/extsoft/include" -std=c++11 -O2 -mtune=ivybridge -pipe -c api.cpp -o api.o
api.cpp:40:30: fatal error: execinfo.h: No such file or directory
#include <execinfo.h>
^
compilation terminated.
make: *** [api.o] Error 1
Warning: running command 'make -f "Makevars.win" -f "C:/R/R-PATC~2/etc/x64/Makeconf" -f "C:/R/R-PATC~2/share/make/winshlib.mk" -f "\\[REDACTED]/.R/Makevars" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="Rcpp.dll" WIN=64 TCLBIN=64 OBJECTS="Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o"' had status 2
ERROR: compilation failed for package 'Rcpp'
* removing 'C:/R/R-patched/library/Rcpp'
The downloaded source packages are in
‘C:\R\temp\Rtmp4mtdWr\downloaded_packages’
Warning messages:
1: running command '"C:/R/R-patched/bin/x64/R" CMD INSTALL --byte-compile -l "C:\R\R-patched\library" C:\R\temp\Rtmp4mtdWr/downloaded_packages/Rcpp_0.12.0.tar.gz' had status 1
2: In install.packages("Rcpp", type = "source", INSTALL_opts = "--byte-compile") :
installation of package ‘Rcpp’ had non-zero exit status
Is this a toolchain issue, or an issue with Rcpp being built under Windows?
Given that is an issue which arises only with the new toolchain, I think you know the answer to this. That said, several #ifdef assumptions may need to be validated. PRs welcome to make Rcpp build on the new and untested toolchain...
Normally, _WIN32 implies both Windows 32bit and Windows 64bit. I have no idea what the toolchain is doing here. It seems like a bug in the toolchain to me that suddenly _WIN32 would not be defined if -std=c++11 were selected.
This issue is already fixed on master. The switch from WIN32 to _WIN32 fixes this. I assume @aadler was building an older version of Rcpp that did not have that fix.
I was building from CRAN (Per r-lib/devtools#908) so that makes sense. Looking forward to the next release (or seeing if @kevinushey 's suggestion there is correct). Thank you.
Activity
thirdwing commentedon Sep 1, 2015
This is really weired,
execinfo.hshouldn't be included, see https://github.com/RcppCore/Rcpp/blob/master/src/api.cpp#L37-L40eddelbuettel commentedon Sep 1, 2015
Given that is an issue which arises only with the new toolchain, I think you know the answer to this. That said, several
#ifdefassumptions may need to be validated. PRs welcome to make Rcpp build on the new and untested toolchain...eddelbuettel commentedon Sep 1, 2015
Looking at
the recent commit by @kevinushey comes to mind.
Maybe we need
_WIN32andWIN32? Oh the joy of 'doze...aadler commentedon Sep 1, 2015
@thirdwing I'm on Win64, but if Win32 is the threading, then yes, it's using Win32 and not posix.
@eddelbuettel Thank you; I was afraid of that :)
@jeroenooms, you may be interested in this.
kevinushey commentedon Sep 1, 2015
Normally,
_WIN32implies both Windows 32bit and Windows 64bit. I have no idea what the toolchain is doing here. It seems like a bug in the toolchain to me that suddenly_WIN32would not be defined if-std=c++11were selected.We should put something in
platform.hlike:and then protect
<execinfo.h>with that as well.Of course, if this is the case we can probably create a reproducible example and forward it to MinGW...
kevinushey commentedon Sep 2, 2015
This issue is already fixed on master. The switch from
WIN32to_WIN32fixes this. I assume @aadler was building an older version of Rcpp that did not have that fix.eddelbuettel commentedon Sep 2, 2015
Cool. I still like the idea about
platform.hthough.aadler commentedon Sep 2, 2015
I was building from CRAN (Per r-lib/devtools#908) so that makes sense. Looking forward to the next release (or seeing if @kevinushey 's suggestion there is correct). Thank you.