[Rcpp-devel] version GLIBCXX not found

Dirk Eddelbuettel edd at debian.org
Tue Mar 15 01:38:24 CET 2016

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++.


|  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
| Thanks for any pointers,
| Peter
| --
| Peter Carr <pcarr at broadinstitute.org>
| Sr. Software Engineer
| Broad Institute - GenePattern Team (http://genepattern.org/)
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org

More information about the Rcpp-devel mailing list