Home | News | Documentation | Download

Load Library bug or quirk


R__LOAD_LIBRARY and gSystem-Load() both ignore LD_LIBRARY_PATH and load the libraries from the same directory as the root libraries (/usr/local/lib in this case).

This seems like a bug but I am not 100% sure.

See my post here for more details


@Axel For me, it’s a bug.

The problem is that ROOT “prepends” its own “root-config --libdir” to the list of searched directories from the “LD_LIBRARY_PATH” (and then appends the “.” directory).
You can easily see it, just try: gSystem->Load("NonExistent");

I would really prefer to have “.:${LD_LIBRARY_PATH}:/anything:/else:/useful” (where “LD_LIBRARY_PATH” is exactly what the user provided, without ANY modifications).

This is actually a bug in the “root” executable, which internally modifies its own “LD_LIBRARY_PATH” value:
std::cout << gSystem->ExpandPathName("${LD_LIBRARY_PATH}") << std::endl;

For the time being, this does NOT happen if you use the “root.exe” executable, though. So, running “root.exe” (instead of “root”) is a possible brutal fix.

You can also try to apply another brutal fix (in your “rootlogon.C” file):
gSystem->SetDynamicPath(TString::Format("/my/preferred/path:%s", gSystem->GetDynamicPath()));

BTW. You should NEVER install ROOT into “standard” system directories.

Thanks for your bug report https://sft.its.cern.ch/jira/browse/ROOT-10697 !


Thanks for the info.

In my case, the root installation is inside a container so there is only ever one version of root. Would you still recommend never installing into /usr/local?

If you are happy with separate / different “containers” for different ROOT versions then you don’t need to care where you install it.

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