[Rcpp-devel] version GLIBCXX not found
Peter Carr
pcarr at broadinstitute.org
Tue Mar 15 07:48:24 CET 2016
I did a little more investigating about the 'mixed g++' compilers. It appears as
if R-2.15 was built with a different version of GCC than is available on my system.
strings -a /pkgs/r_2.15.3/bin/Rscript | grep GCC
GCC: (GNU) 4.4.6 20120305 (Red Hat 4.4.6-4)
GCC: (GNU) 4.4.7 20120313 (Red Hat 4.4.7-3)
$ gcc --version
gcc (GCC) 4.9.0
Furthermore, there was an additional set of paths added to the mix with the
${R_HOME}/etc/ldpaths file.
: ${JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.33.x86_64/jre}
:
${R_JAVA_LD_LIBRARY_PATH=${JAVA_HOME}/lib/amd64/server:${JAVA_HOME}/lib/amd64:${JAVA_HOME}/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib}
if test -n ""; then
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib:}
else
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib}
fi
if test -n "${R_JAVA_LD_LIBRARY_PATH}"; then
R_LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${R_JAVA_LD_LIBRARY_PATH}"
fi
if test -z "${LD_LIBRARY_PATH}"; then
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}"
else
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH
I got Rcpp to install with a simple workaround.
module load R/2.15
(This loads the GCC-4.9 dependency and sets up the path variables)
I had to explicitly set R_JAVA_LD_LIBRARY_PATH to keep ldpaths from appending
incorrect folders to my list:
export R_JAVA_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
It would be nice to know how this all works; but I am happy to have it working.
As an occasional R user I was surprised to learn that my 'LD_LIBRARY_PATH' was
automatically being changed.
Thanks,
Peter
On 3/14/16 8:38 PM, Dirk Eddelbuettel wrote:
> On 14 March 2016 at 20:07, Peter Carr wrote:
> | I am getting an error installing Rcpp from source with R-2.15.3 and Rcpp
> | 0.10.5:
> | /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found
>
> That almost always means that you have mixed g++ compilers.
>
> C++ can be picky. In short, you need to _consistently_ use the same
> compiler. We just ran into this on machines from this decade
> as g++-5 came out and is NOT compatible to g++-4 and earlier. So at work I
> wrote some ltitle helper scripts looking at DESCRIPTION (or rather,
> installed.packages()) and everything involving C++ (Rcpp dependence is a good
> proxy) got reinstalled. Painful once, but then things work.
>
> | I am working in a non-standard environment; running R on a compute cluster,
> | similar to this thread:
> | https://github.com/molpopgen/devnotes/wiki/Rcpp-and-compiler-flags
> | Compute nodes on the cluster use 'environment modules' to load the environment
> | at runtime. E.g.
> | module load R-2.15
> | Rscript ...
> | In my particular case we are using 'dotkit' but the concept is the same. I
> | don't have permission to change the R installation; nor is it an option to
> | update the compute node VM or the version of R. I'd like to know what
> | environment variables to set to force g++ to use the correct flags.
> | # R installation dir
> | /pkgs/r_2.15.3
> |
> | # custom package location
> | ~/rhel6/Library/R/2.15
> |
> |
> | On my system, I have two different locations for the libstdc++.so.6 file.
> | /usr/lib64/libstdc++.so.6
> | /pkgs/gcc_4.9.0/lib64/libstdc++.so.6
>
> See above. I fear that two get mixed that should not get mixed.
>
> You will undoubtedly managed to make it work, but it may involve quite some
> housekeeping. C'est la vie with C++.
>
> Dirk
>
>
> | The GLIBCXX in /pkgs is the correct version (GLIBCXX_3.4.20); the one in '/usr
> | /' is missing that version.
> |
> | Here is a trace ...
> |
> | ---------------------
> | Installing from http://cran.rstudio.com/src/contrib/Archive/Rcpp/Rcpp_0.10.5.tar.gz
> | ---------------------
> |
> | Installing package(s) into ~/rhel6/Library/R/2.15
> |
> | * installing *source* package Rcpp ...
> | ** package Rcpp successfully unpacked and MD5 sums checked
> | ** libs
> | g++ -I/pkgs/r_2.15.3/lib64/R/include -DNDEBUG -I../inst/include/ -fpic -g -O2 -c Date.cpp -o Date.o
> | g++ -I/pkgs/r_2.15.3/lib64/R/include -DNDEBUG -I../inst/include/ -fpic -g -O2 -c Module.cpp -o Module.o
> | gcc -std=gnu99 -I/pkgs/r_2.15.3/lib64/R/include -DNDEBUG -I../inst/include/ -fpic -c Rcpp_init.c -o Rcpp_init.o
> | g++ -I/pkgs/r_2.15.3/lib64/R/include -DNDEBUG -I../inst/include/ -fpic -g -O2 -c Timer.cpp -o Timer.o
> | g++ -I/pkgs/r_2.15.3/lib64/R/include -DNDEBUG -I../inst/include/ -fpic -g -O2 -c api.cpp -o api.o
> | g++ -I/pkgs/r_2.15.3/lib64/R/include -DNDEBUG -I../inst/include/ -fpic -g -O2 -c attributes.cpp -o attributes.o
> | g++ -I/pkgs/r_2.15.3/lib64/R/include -DNDEBUG -I../inst/include/ -fpic -g -O2 -c barrier.cpp -o barrier.o
> | g++ -I/pkgs/r_2.15.3/lib64/R/include -DNDEBUG -I../inst/include/ -fpic -g -O2 -c exceptions.cpp -o exceptions.o
> | g++ -shared -o Rcpp.so Date.o Module.o Rcpp_init.o Timer.o api.o attributes.o barrier.o exceptions.o -L/pkgs/r_2.15.3/lib64/R/lib -lR
> | g++ -o libRcpp.so Date.o Module.o Rcpp_init.o Timer.o api.o attributes.o barrier.o exceptions.o -shared -L/pkgs/r_2.15.3/lib64/R/lib -lR
> | ar qc libRcpp.a Date.o Module.o Rcpp_init.o Timer.o api.o attributes.o barrier.o exceptions.o
> | cp libRcpp.so ../inst/lib
> | cp libRcpp.a ../inst/lib
> | rm libRcpp.so libRcpp.a
> | installing to ~/rhel6/Library/R/2.15/Rcpp/libs
> | ** R
> | ** inst
> | ** preparing package for lazy loading
> | ** help
> | *** installing help indices
> | ** building package indices
> | ** installing vignettes
> | ...
> | ** testing if installed package can be loaded
> | Error in dyn.load(file, DLLpath = DLLpath, ...) :
> | unable to load shared object '~/rhel6/Library/R/2.15/Rcpp/libs/Rcpp.so':
> | /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ~/rhel6/Library/R/2.15/Rcpp/libs/Rcpp.so)
> | Error: loading failed
> | Execution halted
> | ERROR: loading failed
> |
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20160315/9f4555d3/attachment-0001.html>
More information about the Rcpp-devel
mailing list