Hi, I have the exact same problem as described in this post, except I use Scientific Linux 7 and I compiled ROOT 6.28.6 from source for our computer with G++ (GCC) 11.2.0 and
I have no system-wide installations, but I have older versions on the computer, yes. We change the versions by sourcing the appropriate thisroot.sh
According to the error python picks up the proper version in the notebook too
I checked in the notebook with:
%%bash
echo $PATH
and the correct one appears to be the only root directory in the $PATH.
Calling the test above in a simple python terminal also works:
$ python3
Python 3.6.8 (default, Nov 9 2023, 05:22:21)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
>>> ROOT.Experimental.RCanvas.GetCanvases()
vector<shared_ptr<ROOT::Experimental::RCanvas> >{}
>>>
Currently we support all versions of Python 3, so that should not be the direct cause for the problem seen by the user. The next thing I would try is to make sure that the Python executable used in the ROOT installation is the same Python executable that launches the jupyter notebook.
3.6.8 (default, Nov 9 2023, 05:22:21)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
/usr/bin/python3
importing ROOT still meets the same show-stopper error.
In my terminal calling this python:
$ /usr/bin/python3
Python 3.6.8 (default, Nov 9 2023, 05:22:21)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
>>> lOfC = ROOT.Experimental.RCanvas.GetCanvases()
>>> print(lOfC)
{}
>>>
The module now imports and I can read root files and operate on histograms, which was the most important part of the whole thing for me.
However, when I try to do a plot with ROOT the script that works in the interactive python shell gives an error. Maybe this hints at something? The simple script:
h = ROOT.TH1F("gauss","Example histogram",100,-4,4)
h.FillRandom("gaus")
c = ROOT.TCanvas("myCanvasName","The Canvas Title",800,600)
h.Draw()
c.Draw()
The error I am getting in the notebook is:
IncrementalExecutor::executeFunction: symbol '_ZN5cling7runtime6gClingE' unresolved while linking [cling interface function]!
You are probably missing the definition of cling::runtime::gCling
Maybe you need to load the corresponding shared library?
Error in <TH1F::FillRandom>: Unknown function: gaus
IncrementalExecutor::executeFunction: symbol '_ZN5cling7runtime6gClingE' unresolved while linking [cling interface function]!
You are probably missing the definition of cling::runtime::gCling
Maybe you need to load the corresponding shared library?
I dont think anything goes into the system directories. I have -DCMAKE_INSTALL_PREFIX="/cern_root_6.28.6_cpp17" so install should just copy the build results here, right?