Make GaudiPluginService use RPATH to locate factories
By default CMake compiles libraries, modules and executables with RPATH pointing to all linked libraries, with the main advantage that you can run binaries in the build tree without having to tweak the environment.
Unfortunately that doesn't work for plugins, where we rely so much on LD_LIBRARY_PATH
that we never noticed the bug fixed by !1316 (merged).
In principle it is possible to use RPATH instead of LD_LIBRARY_PATH
for plugins, because dlopen
already takes it into account, but the problem is the discovering of factories, where we rely on LD_LIBRARY_PATH
to find files called *.components
.
It would be useful both in the context of unit tests and of deployments based on tools like Spack to have a discovery algorithm that can work without LD_LIBRARY_PATH
, being it RPATH or another mechanism (another environment variable? a configuration file? command line argument?... ).