I am (cross-) compiling ROOT for an ARMv7 system. Everything works fine, except
for the target “Generating tutorials/hsimple.root”. When running root.exe it does not
find the shared libraries required and has several unresolved references.
LD_LIBRARY_PATH is set correctly to where the libraries and rootmap files are.
Running interactively it works when I do gSystem->Load(“libHist”) etc.
So, what is missing to make the auto-loading work? Another variable to be set? A
rootrc file or similar?
the autoloading is based on the mapping encoded in the rootmap files, which sit in the LD_LIBRARY_PATH, typically next to the shared libraries and the root pcms. Do you have rootmap files in the $ROOTSYS/lib directory? Is the pch file generated correctly when hsimple is generated?
Thanks for your prompt reply. Unfortunately, I am not a ROOT expert enough to answer
your questions easily. Here is the command which fails and the printout:
[ 94%] Generating tutorials/hsimple.root
cd /home/spiwoks/yocto/thud/root-build/tutorials && LD_LIBRARY_PATH=/home/spiwoks/yocto/thud/root-build/lib:/home/spiwoks/yocto/thud/sdk/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi/lib:/home/spiwoks/yocto/thud/sdk/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi/usr/lib: ROOTIGNOREPREFIX=1 /home/spiwoks/yocto/thud/root-build/bin/root.exe -l -q -b -n -x hsimple.C -e return
<built-in>:5:9: warning: '__STDC_LIMIT_MACROS' macro redefined [-Wmacro-redefined]
#define __STDC_LIMIT_MACROS 1
^
/home/spiwoks/yocto/thud/sdk/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/include/stdint.h:5:11: note: previous definition is here
# define __STDC_LIMIT_MACROS
^
<built-in>:6:9: warning: '__STDC_CONSTANT_MACROS' macro redefined [-Wmacro-redefined]
#define __STDC_CONSTANT_MACROS 1
^
/home/spiwoks/yocto/thud/sdk/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.2.0/include/stdint.h:7:11: note: previous definition is here
# define __STDC_CONSTANT_MACROS
^
Processing hsimple.C...
IncrementalExecutor::executeFunction: symbol '_ZN4TH1FC1EPKcS1_idd' unresolved while linking [cling interface function]!
You are probably missing the definition of TH1F::TH1F(char const*, char const*, int, double, double)
Maybe you need to load the corresponding shared library?
...
The path to the library, rootmap and pcm files if in the LD_LIBRARY_PATH, i.e./home/spiwoks/yocto/thud/root-build/lib. ROOTSYS is not explicitly set, but would point to the same path I guess.
I do not know what a pch file is. If that is somehting that should be generated from executing hsimple.C, then I never get that far.
Thank you very much for your help,
Ralf.
but would be pointing to the same path I guess.
are the rootmap files next to the libraries? Is the libHist.rootmap file available?
We’ll need to fix the warning too because it does not look too good…
Yes, rootmap files are there, in $ROOTSYS/lib, in particular, the one for libHist:
-rw-r–r-- 1 spiwoks zp 632 May 21 09:38 libHist_rdict.pcm
-rw-r–r-- 1 spiwoks zp 5620 May 21 09:38 libHist.rootmap
-rwxr-xr-x 1 spiwoks zp 24676808 May 21 09:38 libHist.so
No idea about the warning. As I wrote earlier when running manually
and loading the libraries manually, it works fine.
It has to be said that this is cross-compilation and root.exe is called
using the binfmt_misc facility and qemu. But the environment is passed.
Could it be that anything else than LD_LIBRARY_PATH and ROOTSYS
is needed?
Hi Ralf,
I am not sure. Native compilation on ARM works out of the box so perhaps the qemu layer could be part of the issue. Are you sure that the $ROOTSYS and LD_LIBRARY_PATH variables are passed properly?
You might be right. Is there a way to see what the value of ROOTSYS in root.exe is?
Is there a way to start root.exe in debugging or tracing mode to see what it actually
loads, because it turns out some ROOT libraries are loaded …
sure some libraries are, for example Core, Thread and RIO (and Cling, in a sophisticated way as well as MathCore in a less sophisticated way).
About what ROOTSYS is “used/seen” by root.exe, it depends. If you mean at runtime, you can use
I found out that copying a file containing the following line
include /home/spiwoks/yocto/thud/root-build/lib
to /etc/ld.so.conf.d, solves my problem.
Could it be that the ld configuration does not get updated because
I am cross-compiling? Then qemu and the ld-linux-armhf.so cannot
find the libraries despite the ROOTSYS and LD_LIBRARY_PATH
variables?
Hi, Sorry, That was a false alert!
It is not the solution, yet. I was playing with the rootlogon script
which loaded the libraries, and not the loader.