Hi,
I develop a soft using ROOT as a library and I need to deploy it on a CentOS platform. So I used a method that worked when I used ROOT5: I compiled ROOT and my soft correctly and copied the ROOT dependencies (with ldd) in a tar:
When I transferred the binary and these libraries on another blank platform, I had this error while executing the soft:
Error in <UnknownClass::FindDynamicLibrary>: libCling[.so | .dll | .dylib | .sl | .dl | .a] does not exist in .:/lib
Fatal in <TROOT::InitInterpreter>: cannot load symbol ./clitkMergeRootFiles: undefined symbol: CreateInterpreter
It was quite strange, because libCling was not listed with ldd but even if I transferred libCling.so I had another error:
ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
LC_ALL=C c++ -O3 -DNDEBUG -xc++ -E -v /dev/null 2>&1 >/dev/null | awk '/^#include </,/^End of search/{if (!/^#include </ && !/^End of search/){ print }}' | GREP_OPTIONS= grep -E "(c|g)\+\+"
Results was:
With exit code 256
ERROR in cling::CIFactory::createCI():
resource directory /etc/cling/lib/clang/5.0.0 not found!
error: unable to read PCH file /etc/allDict.cxx.pch: 'No such file or directory'
fatal error: PCH file '/etc/allDict.cxx.pch' not found: module file not found
*** Break *** segmentation violation
Error in < TUnixSystem::StackTrace> script /etc/gdb-backtrace.sh is missing
I tried to compile ROOT in CMake with (but it did not compile):
Thank you for your answer, unfortunately it did not work.
I started a blank CentOS7 (with Docker), I installed development tools (g++, …) and copied my binary with all dependencies listed above and libCling.so. The error was different when I started the binary:
ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
LC_ALL=C c++ -O3 -DNDEBUG -xc++ -E -v /dev/null 2>&1 >/dev/null | awk '/^#include </,/^End of search/{if (!/^#include </ && !/^End of search/){ print }}' | GREP_OPTIONS= grep -E "(c|g)\+\+"
Results was:
With exit code 256
ERROR in cling::CIFactory::createCI():
resource directory /etc/cling/lib/clang/5.0.0 not found!
error: unable to read PCH file /etc/allDict.cxx.pch: 'No such file or directory'
fatal error: PCH file '/etc/allDict.cxx.pch' not found: module file not found
*** Break *** segmentation violation
Error in < TUnixSystem::StackTrace> script /etc/gdb-backtrace.sh is missing
It seems strange to transfer all CLing resources contained in /etc/, does not it?
For the second point, I could understand to transfer the folder < pathToCompiledROOT >/etc/ but CLing seems to look in the folder /etc/ at the root and I do not have root access. I already tried to copy < pathToCompiledROOT >/etc/ in the same folder than libCLing.so but I had the same issue.
That’s on the target machine? That looks perfect! Why would that give us an exit code 256 with no output…?
seems to look in the folder /etc/
No, that’s a bug in the error message; I’ll fix it. It really wants to have $ROOTSYS/etc/cling, or wherever you configured etc to reside. I’d recommend you build without CMAKE_INSTALL_PREFIX, do not run make install, and only transfer bin/, lib/, include/ and etc/.
I did ldconfig ~/soft and export ROOTSYS=~/soft, but I still have this error when I run my binary
ERROR in cling::CIFactory::createCI():
resource directory /etc/cling/lib/clang/5.0.0 not found!
error: unable to read PCH file /etc/allDict.cxx.pch: 'No such file or directory'
fatal error: PCH file '/etc/allDict.cxx.pch' not found: module file not found
*** Break *** segmentation violation
Error in <TUnixSystem::StackTrace> script /etc/gdb-backtrace.sh is missing
Moreover, I wanted to avoid to deploy all ROOT bin/, include/, etc/, lib/, objects, I just need a little number of ROOT libraries (listed with ldd comand).
I transferred the folders etc, bin, lib and include, I set ROOTSYS and it worked.
It was not what I expected because I wanted to transfer the minimum things but it worked now.