I’m having trouble in some environments when I compile a macro using pyROOT. It works fine when I use C++ root.
The error message I get is
/usr/bin/ld: cannot find -lRint -lCore -L/home/ubuntu/root/lib
It appears that pyroot is, for some reason, passing "-lRint -lCore -L/home/ubuntu/root/lib"
to ld
as a single argument. Since there’s no such thing as 'libRint -lCore -L/home/ubuntu/root/lib.so'
, it fails.
I tested this explicitly by hacking ld to do for a; do echo $a; done
before compiling, and my suspicion was correct, -lRint -lCore -L/home/ubuntu/root/lib
is printed on one line.
As a minimal test, I use test.C
:
#include <iostream>
void test() {
std::cout << "hi" << std::endl;
}
and test.py
:
import ROOT
ROOT.gROOT.LoadMacro("test.C+")
ROOT.test()
If I run python test.py
, it fails. If I first run root -l -b -q test.C+
, that works fine, and I can then successfully run python test.py
, since test.C
is already compiled.
I’m running root 6.06.08 on the ubuntu virtual machines from CircleCI. You can see the output here:
https://circleci.com/gh/hroskes/test-ld-pyroot/6
On any other machine I can run root on, I don’t get this error.
Any suggestions would be greatly appreciated! I’m very confused.