Using ENV to update LD_LIBRARY_PATH has no effect

I’m trying to use ENV to update LD_LIBRARY_PATH so I can call code in a shared library, but the shared library can’t be found. If I update LD_LIBRARY_PATH before launching Julia it works correctly. Has anyone encountered this before?

I did look at using DL_LOAD_PATH, but I need to make shared libraries discoverable by other shared libraries, not just by Julia itself.

I made a minimal example here. Run make.sh and then julia ./test.jl.

The env can be/is cached by libc at init time so changing it will have no effect for the current process.

This is not the correct way to help libraries finding their dependencies, they should have their rpath set instead. Or if they can’t be fixed, you can manually dlopen their dependencies.

Interesting, thanks