GLIBCXX_3.4.26 not found in RCall

(Also posted on slack#statistics)

If anyone has time to look at what must be a basic issue on my side, I’ve posted an issue on RCall.jl that is a show stopper for me:
https://github.com/JuliaInterop/RCall.jl/issues/339

Much :heart: if you can help out!

1 Like

I just had the same problem when trying to import matplotlib with PyCall this morning. It worked fine in python, so I was a bit confused, but I came to the conclusion that the libstdc++ that ships with Julia is too old, while the one I have installed on my system is up to date. Compiling Julia from source fixed the problem.

1 Like

oooo, I’ll give it a shot!

Check that

$ strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX

(or equivalent) returns GLIBCXX_3.4.26 before compiling, if not you need a newer version.

Found it! Here:

$ /sbin/ldconfig -p | grep stdc++
        libstdc++.so.6 (libc6,x86-64) => /lib/x86_64-linux-gnu/libstdc++.so.6
$ strings /lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
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
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26 # <--- HERE IT IS!!!
GLIBCXX_3.4.27
GLIBCXX_3.4.28
GLIBCXX_DEBUG_MESSAGE_LENGTH

So what does that mean…?

I’ll just add that this is still aproblem in the 1.3 rc2, incase that got updated between the two rcs…

Just to sum it up, not sure what is going on, but I compiled Julia from source (v1.2.0) and it all works now.

:man_shrugging:

Thanks for all the help!!!

:heart::heart::heart:

1 Like

Tapped into this one today, but using a Julia source build isn’t a viable workaround. Setting LD_LIBRARY_PATH or R_LD_LIBRARY_PATH, as suggested in http://juliainterop.github.io/RCall.jl/stable/installation.html and some bug reports didn’t help either.

Has anyone gotten rid of this without compiling Julia?

R> library(devtools)
Loading required package: usethis
Error: package or namespace load failed for ‘usethis’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/gerhard/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/libs/Rcpp.so':
  /home/gerhard/julia-1.3.1/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /home/gerhard/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/libs/Rcpp.so)
Error: package ‘usethis’ could not be loaded
1 Like

I’ve seen your bug report:

Could you please reopen the issue?

Through help on Slack by @staticfloat it became clear that the underlying problem is, that the Julia provided libstdc++.so.6 is older than the one provided by the operating system, in my case Ubuntu 19.10, which in turn is used by R.

An intermediate solution is to replace Julias libstdc++.so.6 with the one from the OS:

# works for Ubuntu 19.10 64bit - match your locations accordingly!
 cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 $JULIA_HOME/lib/julia/

For completeness a list of references of this issue:

5 Likes

Not sure where to discuss so doing so here. It seems like you, @laborg, have a good grasp on the issues here. Could you please add a note of sorts to both these repos, JuliaCall and RCall, informing users that run into the same problem on how to resolve these…? That would be a great first step until this gets permanently resolved (by having Julia use the system’s libstdc or updating Julia’s own libstdc in case the system’s version is higher or something).

Yes, good idea:

1 Like

Backlink to the corresponding issue: https://github.com/JuliaLang/julia/issues/34276

1 Like

This issue is not confined to RCall. PyCall also reports the same error. So, the problem is with the Julia distribution and the developers need to be alerted to this problem so that they have the most recent version of libstdc++.so.6 in the compiled version of Julia.

The Julia developers are aware of the bug, see

I think its best is to attach your problem report there and hope that the proposed solution will soon come to fruition.

This is a stupid question.
If I build Julia from scratch on (say) a Fedora system or the latest Ubuntu where does the libstdc++ originate from?
IE. Does building from source build an up to date libstdc++ for that system.

Note to self - why dont you take the time to test that hypothesis…

If you build from scratch, I think the system libstdc++ is used and so it should work. The issues comes only from using the pre-built binary