I use Ubuntu 15.10 with gcc 5.2.1. I built ROOT from the sources.
I create a small tree for testing purposes using the following code …
void createtree(){
//create a tree file tree1.root - create the file, the Tree and a few branches
TFile f("testtree.root","recreate");
TTree t1("t1","a simple Tree with simple variables");
Float_t px, py, pz;
Double_t random;
Int_t ev;
t1.Branch("px",&px,"px/F");
t1.Branch("py",&py,"py/F");
t1.Branch("pz",&pz,"pz/F"); t1.Branch("ev",&ev,"ev/I");
//fill the tree
for (Int_t i=0; i<10000; i++) {
gRandom->Rannor(px,py);
pz = px*px + py*py;
random = gRandom->Rndm();
ev = i;
t1.Fill();
}
//save the Tree heade; the file will be automatically closed
//when going out of the function scope
t1.Write();
}
when loading the created tree I get the following error message:
/home/peters/test/tmva/deep/higgs> root -l testtree.root
root [0]
Attaching file testtree.root as _file0...
IncrementalExecutor::executeFunction: symbol '_ZN5cling10printValueEPPKv' unresolved while linking [cling interface function]!
You are probably missing the definition of cling::printValue(void const**)
Maybe you need to load the corresponding shared library?
(TFile *) Error in ValuePrinter: missing output string.
root [1]
Unfortunately we do not support yet GCC version >= 5.1. The reason is that the LLVM/clang we use for the interpreter does not supper the new GCC ABI. Thus the missing symbol you encountered. We will integrate a new version of LLVM/clang as soon as possible.
A Dual ABI is provided by the library. A new ABI is enabled by default. The old ABI is still supported and can be used by defining the macro _GLIBCXX_USE_CXX11_ABI to 0 before including any C++ standard library headers.
Hi Axel,
what do you mean exactly that cling now supports gcc just fine? I tried to compile root 6.06.08 on ubuntu 16.04 (gcc version 5.4.0 20160609) by ignoring the ABI check in cmake CheckCompiler.cmake.
The compilation ran just fine and I can run root, but I’ve got the usual issue when using the interpreter:
root [0] int x
IncrementalExecutor::executeFunction: symbol '_ZN5cling10printValueEPKi' unresolved while linking [cling interface function]!
You are probably missing the definition of cling::printValue(int const*)
Maybe you need to load the corresponding shared library?
(int) Error in ValuePrinter: missing output string.
Hi all.
I found a solution to this: I had to install clang-3.9 on my system before compiling.
Luckily LLVM maintains many versions for many systems, so it was quite straightforward.
Here is the exact complete sequence:
This is not a real solution; your ROOT build will still cause issues with distro C++ libraries, because those are still using the new ABI. I’d also argue that using ROOT 6.08 might be simpler than building llvm…