Glibc runtime linking errors during install

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…

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…

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

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?

If not couldn’t you just run as:

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