Home | News | Documentation | Download

Runpath for ROOT shared libraries

Hey, I’m building something against ROOT (and DD4hep).

I want to avoid having to set LD_LIBRARY_PATH, so I’m setting RPATH/RUNPATH on my executables/shared libraries. This works fine if my library directly links against a ROOT lib, as that is found through RUNPATH. However, libraries that the directly linked ROOT libs link against are not found, because none of the ROOT shared libraries have their RUNPATHs set.

As an example: I link against libGeom.so, that is found in /opt/root/6.24.00/lib/libGeom.so. However libGeom.so depends on libRIO.so and libCore.so, which are not found, because the linker wants to use libGeom.so's RUNPATH, which is unset.

Is this something that can be circumvented/improved?


ROOT Version: 6.24.00
Platform: Ubuntu 20.04
Compiler: GCC 9.3


Hi,
I am not sure one can build the ROOT libraries with that option. However, you just need to run the script $ROOTSYS/bin/thisroot.sh and it will set automatically the LD_LIBRRY_PATH for you.

Lorenzo

Yeah of course. I was just wondering if there’s a way without having to mess with LD_LIBRARY_PATH.

cmake -Drpath=ON ...

Hadn’t seen that, thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.