# GLIBCXX\_3.4.26 not found in RCall

**URL:** <https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113>\
**Category:** General Usage\
**Tags:** question\
**Created:** [September 24, 2019, 2:11pm UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113 "2019-09-24T14:11:10Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [September 24, 2019, 2:11pm UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/1 "2019-09-24T14:11:10Z")

</div>

(Also posted on [slack#statistics](https://julialang.slack.com/archives/C6821M4KE/p1569327529061300))

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](https://github.com/JuliaInterop/RCall.jl/issues/339)

Much ❤ if you can help out!

---

<div class="post-metadata">

**Author:** ![kdyrhage](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kdyrhage/32/2326_2.png) [@kdyrhage](https://discourse.julialang.org/u/kdyrhage)\
**Post date:** [September 24, 2019, 2:25pm UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/2 "2019-09-24T14:25:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [September 24, 2019, 2:27pm UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/3 "2019-09-24T14:27:28Z")

</div>

oooo, I’ll give it a shot!

---

<div class="post-metadata">

**Author:** ![kdyrhage](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kdyrhage/32/2326_2.png) [@kdyrhage](https://discourse.julialang.org/u/kdyrhage)\
**Post date:** [September 24, 2019, 2:32pm UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/4 "2019-09-24T14:32:10Z")

</div>

Check that

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

```

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

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [September 24, 2019, 2:54pm UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/6 "2019-09-24T14:54:09Z")

</div>

Found it! Here:

```julia
$ /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…?

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [September 24, 2019, 3:02pm UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/7 "2019-09-24T15:02:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [September 24, 2019, 3:33pm UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/8 "2019-09-24T15:33:11Z")

</div>

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.

🤷‍♂️

Thanks for all the help!!!

❤❤❤

---

<div class="post-metadata">

**Author:** ![laborg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laborg/32/5474_2.png) [@laborg](https://discourse.julialang.org/u/laborg)\
**Post date:** [January 3, 2020, 1:33pm UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/9 "2020-01-03T13:33:25Z")

</div>

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](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?

```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

```

---

<div class="post-metadata">

**Author:** ![laborg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laborg/32/5474_2.png) [@laborg](https://discourse.julialang.org/u/laborg)\
**Post date:** [January 3, 2020, 2:35pm UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/10 "2020-01-03T14:35:31Z")

</div>

I’ve seen your bug report:

[https://github.com/JuliaInterop/RCall.jl/issues/339](https://github.com/JuliaInterop/RCall.jl/issues/339)

Could you please reopen the issue?

---

<div class="post-metadata">

**Author:** ![laborg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laborg/32/5474_2.png) [@laborg](https://discourse.julialang.org/u/laborg)\
**Post date:** [January 4, 2020, 7:11am UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/11 "2020-01-04T07:11:02Z")

</div>

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:

```julia
# 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:

- [GLIBCXX\_3.4.26 not found · Issue #339 · JuliaInterop/RCall.jl · GitHub](https://github.com/JuliaInterop/RCall.jl/issues/339) (initial issue)
- [julia\_setup (still) failing on Ubuntu 16.04 (Julia 1.1.1) · Issue #110 · Non-Contradiction/JuliaCall · GitHub](https://github.com/Non-Contradiction/JuliaCall/issues/110) (I think wrongly interpreted as just not finding the right `so` ) (I think wrongly interpreted as just not finding the right `so` )
- [Unable to load libjulia.so because `GLIBCXX\_3.4.20' not found · Issue #1 · Non-Contradiction/JuliaCall · GitHub](https://github.com/Non-Contradiction/JuliaCall/issues/1)

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [January 7, 2020, 8:31am UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/12 "2020-01-07T08:31:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![laborg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laborg/32/5474_2.png) [@laborg](https://discourse.julialang.org/u/laborg)\
**Post date:** [January 7, 2020, 8:46am UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/13 "2020-01-07T08:46:49Z")

</div>

Yes, good idea:  
[https://github.com/JuliaInterop/RCall.jl/pull/352](https://github.com/JuliaInterop/RCall.jl/pull/352)

---

<div class="post-metadata">

**Author:** ![laborg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laborg/32/5474_2.png) [@laborg](https://discourse.julialang.org/u/laborg)\
**Post date:** [March 23, 2020, 6:02am UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/14 "2020-03-23T06:02:33Z")

</div>

Backlink to the corresponding issue: [libstdc++.so.6 is outdated and breaks RCall and others on recent Linux distros · Issue #34276 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/34276)

---

<div class="post-metadata">

**Author:** ![jfan](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@jfan](https://discourse.julialang.org/u/jfan)\
**Post date:** [May 26, 2020, 3:25pm UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/15 "2020-05-26T15:25:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![laborg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laborg/32/5474_2.png) [@laborg](https://discourse.julialang.org/u/laborg)\
**Post date:** [May 26, 2020, 6:44pm UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/16 "2020-05-26T18:44:23Z")

</div>

The Julia developers are aware of the bug, see

> <https://github.com/JuliaLang/julia/issues/34276>
>
> As discussed on slack with and discourse ( https://discourse.julialang.org/t/gli…bcxx-3-4-26-not-found-in-rcall/29113/2 ) the problem of an outdated, bundled libstdc++ (e.g. Julia 1.3.1) compared to the libstdc++ provided by the OS (e.g. Ubuntu 19.10) is that it breaks RCall.jl when \`Rcpp\` is in play due to missing GLIBCXX symbols.
> 
> I quote @staticfloat 
> 
> \> So Ubuntu 19.10 is based on GCC 9, huh. We don't have a GCC 9 shard yet; we've been using GCC 7.2 on the buildbots (which correspondes to GLIBCXX\_3.4.24), but there's no reason why we can't put our own libstdc++.so.6 into a julia binary-dist. Right now we've been bundling the libstdc++.so.6 that we get from the build environment, but it would be even better for us to just use an appropriate CompilerSupportLibraries\_jll release, and craft those releases to be as compatible as possible (e.g. use the absolute newest libstdc++.so.6, the appropriate libgfortran.so.X, etc...)
> 
> An intermediate workaround is described here: https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/11?u=laborg

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

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [June 7, 2020, 10:35am UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/17 "2020-06-07T10:35:19Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [June 7, 2020, 11:15am UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113/18 "2020-06-07T11:15:52Z")

</div>

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
