Use ROOT without CLing

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:

libGui.so
libCore.so
libImt.so
libRIO.so
libNet.so
libHist.so
libGraf.so
libGraf3d.so
libGpad.so
libROOTDataFrame.so
libROOTVecOps.so
libTree.so
libTreePlayer.so
libRint.so
libPostscript.so
libMatrix.so
libPhysics.so
libMathCore.so
libThread.so
libMultiProc.so
lilbtbb.so.2
libvdt.so

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):

-Dcling=OFF

Do you have any idea to use ROOT whithout CLing?

Thank you very much for your help.


ROOT Version: master (>6.14.00)
Platform: CentOS 7
Compiler: gcc v4.8.5


Hi,

You need to copy libCling (it’s dlopened), and ROOT needs a compiler installed - g++ in your case.

Cheers, Axel.

1 Like

Hi Axel and all,

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?

Thank you for your help
Thomas

Hi Thomas,

There are two issues.

  1. What happens when you run
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)\+\+"
  1. you need to distribute the content of etc/. Why do you find it strange to transfer it?

Cheers, Axel.

Hi Axel,

For the first issue, the output was:

>> 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)\+\+"
 /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5
 /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/x86_64-redhat-linux
 /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/backward

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.

Thank you for your help
Thomas

Hi Thomas,

For the first issue, the output was:

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/.

Cheers, Axel.

Hi Axel,

The first issue is my fault, sorry. I found the solution (I installed gcc after :/).

For the second point, I forgot to set ROOTSYS on the target machine, but it still not work. On the target machine, I have the following tree:

~/soft
   - myBinary
   - all .so libraries
   - libCling.so
   - etc/
   - lib/
   - include/
   - bin/

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).

Thank you for your help
Thomas

Hi,

libCling.so and all other ROOT shared libraries need to go under lib/.

Then, export ROOTSYS=$HOME/soft should do - but you might not even need it if libCore.so gets found and loaded (e.g. because you linked it).

You will need some include/ files; you’ll see :slight_smile:

Cheers, Axel.

Hi Axel,

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.

Thank you very much
Thomas

You should be able to

  • remove most libs from lib/ - but libCling and the others you need;
  • remove most headers from include/
  • remove +/- all binaries from bin/ or you don’t need them.

You’re welcome to post the minimal list here; maybe others are interested, too.

We are still planning on removing the dependency from libCore (libRIO, actually) to libCling. But that’s not for this year…

Cheers, Axel.

This is what I wanted to do, but ROOT6 is also used by another soft so maybe I will share the ROOT6 libraries.
I note your project, thank you.

Regards
Thomas

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