cdeterman / gpuR

R interface to use GPU's
241 stars 26 forks source link

Compilation fails for glibc=2.25, gcc=7.3.0 #121

Open mschubert opened 6 years ago

mschubert commented 6 years ago

I'm getting the following error compiling gpuR on Gentoo Prefix using up-to-date gcc (7.3.0), glibc (2.25), and R (3.4.4) with Rcpp (0.12.16) package:

In file included from prefix/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/g++-v7/cstdlib:75:0,
# ...
from prefix/usr/lib64/R/library/RcppEigen/include/RcppEigen.h:25
from RcppExports.cpp:4:

prefix/usr/include/stdlib.h:183:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_BFP_EXT)

There was a similar error in Vivado, which was linked to conflicting macros between glibc and their application.

Maybe something similar is happening here?

cdeterman commented 6 years ago

Thanks for the report. I will see if I can spin up a docker image to reproduce the error.

cdeterman commented 6 years ago

@mschubert if I may ask, how did you get the R-3.4.4 version installed? I am not particularly familiar with Gentoo and after I run emerge dev-lang/R I only get the R-3.2.2 version.

mschubert commented 6 years ago

For R I added my own ebuild, available here: https://github.com/mschubert/overlay

anadon commented 6 years ago

Oh hey, mschu! If it is something related to conflicting macros, the RcppEigen to system stack works, and the cuda to system stack works, so I'm betting it is a conflict between RcppEigen and cuda headers. Would you be able to extract the macro names, and check if there are any in common between the RcppEigen and cuda headers? Else it could be a malformed macro, so a more complex script tracking down nested macros may be in order.

acolinisi commented 4 years ago

FWIW: I've got this error on a different unrelated ebuild inside Gentoo Prefix. The reason turned out to be a -I/usr/include on the compile line. The /usr/include is a path on the host, outside the prefix. So, the error happened as a result of mixing system headers from different libc(/gcc toolchain) versions: headers on the host with headers in the prefix. The fix was to patch the packages build system to get rid of all -I arguments that pointed outside the prefix (which shouldn't be there in the first place, since /usr/include is implied).