<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
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.<br>
<br>
strings -a /pkgs/r_2.15.3/bin/Rscript | grep GCC<br>
GCC: (GNU) 4.4.6 20120305 (Red Hat 4.4.6-4)<br>
GCC: (GNU) 4.4.7 20120313 (Red Hat 4.4.7-3)<br>
<br>
$ gcc --version<br>
gcc (GCC) 4.9.0<br>
<br>
Furthermore, there was an additional set of paths added to the mix
with the ${R_HOME}/etc/ldpaths file.<br>
<blockquote>:
${JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.33.x86_64/jre}<br>
:
${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}<br>
if test -n ""; then<br>
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib:}<br>
else<br>
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib}<br>
fi<br>
if test -n "${R_JAVA_LD_LIBRARY_PATH}"; then<br>
R_LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${R_JAVA_LD_LIBRARY_PATH}"<br>
fi<br>
if test -z "${LD_LIBRARY_PATH}"; then<br>
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}"<br>
else<br>
LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}"<br>
fi<br>
export LD_LIBRARY_PATH<br>
</blockquote>
I got Rcpp to install with a simple workaround.<br>
module load R/2.15<br>
(This loads the GCC-4.9 dependency and sets up the path
variables)<br>
I had to explicitly set R_JAVA_LD_LIBRARY_PATH to keep ldpaths from
appending incorrect folders to my list:<br>
export R_JAVA_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}<br>
<br>
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.<br>
<br>
Thanks,<br>
Peter<br>
<br>
<br>
<div class="moz-cite-prefix">On 3/14/16 8:38 PM, Dirk Eddelbuettel
wrote:<br>
</div>
<blockquote cite="mid:22247.22912.519873.858275@max.nulle.part"
type="cite">
<pre wrap="">
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:
| <a class="moz-txt-link-freetext" href="https://github.com/molpopgen/devnotes/wiki/Rcpp-and-compiler-flags">https://github.com/molpopgen/devnotes/wiki/Rcpp-and-compiler-flags</a>
| 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 <a class="moz-txt-link-freetext" href="http://cran.rstudio.com/src/contrib/Archive/Rcpp/Rcpp_0.10.5.tar.gz">http://cran.rstudio.com/src/contrib/Archive/Rcpp/Rcpp_0.10.5.tar.gz</a>
| ---------------------
|
| 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
|
</pre>
</blockquote>
<br>
</body>
</html>