4

So I've been trying to install an R package called igraph. At the end when it tries to load the package, I get the following error:

/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /tools/R/2.15.2/lib64/R/library/igraph/libs/igraph.so)

To me this error means that there's the wrong version of libstdc++.so.6. I, however am not using that file. A quick look to my LD_LIBRARY_PATH:

 echo $LD_LIBRARY_PATH 
/tools/gcc/4.7.0/lib64

In that directory there is a file named libstdc++.so.6 and the following shows that GLIBCXX_3.4.15 is actually there:

strings /tools/gcc/4.7.0/lib64/libstdc++.so.6 | grep GLIB
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBC_2.2.5
GLIBC_2.3
GLIBC_2.3.2
GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH

I don't understand why R is being stubborn and not using the file under the gcc directory and keeps trying to reference the /user/lib64 directory. Does anyone any have ideas?

Florin Stingaciu
  • 8,085
  • 2
  • 24
  • 45

1 Answers1

5

Turns out there's a file under: $RHOME/etc/ called ldpaths that clears the LD_LIBRARY_PATH environment variable for some reason. I reset the LD_LIBRARY_PATH to my preferred paths in that file, relaunched R, and the package installed quite smoothly.

On a side-node: I think this is ridiculous behaviour for such a mature piece of software.

Florin Stingaciu
  • 8,085
  • 2
  • 24
  • 45
  • 1
    This sounds like it's specific to your environment. – Joel E Salas Jun 07 '13 at 22:14
  • 2
    It does not clear it: it prepends to it the directories that were used when you compiled R. You apparently changed something on your system between the moment you installed R and the moment you installed igraph. Expect other things to break... – Vincent Zoonekynd Jun 07 '13 at 22:52
  • maybe a duplicate of http://stackoverflow.com/questions/11658687/ld-library-path-precendence-and-trouble-with-compiling – cs_alumnus Jun 29 '16 at 05:09