# Glibc runtime linking errors during install

**URL:** https://discourse.julialang.org/t/glibc-runtime-linking-errors-during-install/92586
**Category:** New to Julia
**Tags:** question
**Created:** [January 6, 2023, 2:50am UTC](https://discourse.julialang.org/t/glibc-runtime-linking-errors-during-install/92586 "2023-01-06T02:50:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![smartalecH](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/smartalech/32/32379_2.png) [@smartalecH](https://discourse.julialang.org/u/smartalecH)
#### Post date: [January 6, 2023, 2:50am UTC](https://discourse.julialang.org/t/glibc-runtime-linking-errors-during-install/92586/1 "2023-01-06T02:50:22Z")

</div>

I’m trying to build Julia (and dependencies) from source on a complicated system that has _two_ `glibc` versions, a really old system version and a newer version I have to load.

As I build Julia, I can get all of it’s dependencies to compile and run just fine by passing in the proper `glibc` runtime flag to the linker. Something like…

```julia
LDFLAGS="-Wl,-rpath,path/to/my/glibc/lib/libc.so"

```

and that seems to work for everything _except_ for the actual Julia binary and the Julia library (`libjulia.so.1`).

Now some of the dependencies, e.g. Patchelf and GMP, require you use _different_ flags than the standard GNU flags… so I tried setting _several_ different flags with the above linker command, including…

```julia
LDFLAGS=...
CFLAGS=...
CPPFLAGS=...
CXXFLAGS=...
CXXLDFLAGS=...

```

but still no luck.

I tried pouring over the `src/Makefile` to see if I was missing any other flags… but I couldn’t find anything obvious.

Is anyone else aware of a flag I can set that will tell Julia to look at a particular glibc location at runtime? Thanks!

(Of course, I can’t set my `LD_LIBRARY_PATH` with the new glibc, as that will clobber the rest of my system built with the older `glibc`…)

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [January 22, 2023, 3:40pm UTC](https://discourse.julialang.org/t/glibc-runtime-linking-errors-during-install/92586/2 "2023-01-22T15:40:42Z")

</div>

This problem doesn’t seem specific to Julia. I’m no expert on it, but generally speaking you don’t need to build Julia, you just download (glibc) Julia version and it should work…

That might assume only one glibc…, but still I would think the one (newer) that works should be in the right default place and the other in some non-default place?

> <https://stackoverflow.com/questions/847179/multiple-glibc-libraries-on-a-single-host>

If not couldn’t you just run as:

```julia
LD_LIBRARY_PATH=/path_to_correct_glib julia

```

There’s also a musl julia version. You could consider downloading it… Now you have three libc, but at least only one musl libc. That might be bad advice since it’s only tier 2, and I guess mean for systems with (only) musl.

I tried it some time back on Ubuntu, and if I recall it worked (for just a simple test), but I had to install musl if I recall.

[Julia also needs C++ standard library, and there was some issue in the past about recent versions needed, and Julia in latest (may be beta?) version should just work.]
