A call to gSystem->Load() used to search the LD_LIBRARY_PATH to find the library. In 5.26 and before it was the case. However, since 5.27 the current directory and subdirectories are also searched if the name of the directory corresponds. I believe this is wrong. Let’s take an example, because it is difficult to explain
I attached a library to this message. It was compiled with ROOT 5.21 so we are sure to get an error when loading it and thus we will know where the library is actually taken from. The following was done on lxplus.
- Save the library on your disk, let’s say in your home, untar it.
- mkdir /tmp/lib
- cp libAmoreQAPublisher.so /tmp/lib
- export LD_LIBRARY_PATH=/tmp/lib:$LD_LIBRARY_PATH
- mkdir tmp
- mkdir tmp/lib
- cp libAmoreQAPublisher.so tmp/lib
// At this point we have the library in two places : /tmp/lib and ~/tmp/lib. However only the first one is in LD_LIBRARY_PATH and thus I expect only this one to be loaded.
root  gSystem->Load("libAmoreQAPublisher.so") dlopen error: .//tmp/lib/libAmoreQAPublisher.so: wrong ELF class: ELFCLASS32 Load Error: Failed to load Dynamic link library .//tmp/lib/libAmoreQAPublisher.so (int)(-1) *** Interpreter error recovered ***
==> We see that it is loading the library in ~/tmp/lib (.//tmp/lib/libAmoreQAPublisher.so) even though it is not in the LD_LIBRARY_PATH.
If you try to do this with root 5.26 it will load the one in /tmp/lib.
What do you think ?
libAmoreQAPublisher.so.tgz (189 Bytes)