I built a ROOT 6.26.10 debian package for Ubuntu 22.04. It can be downloaded from here: https://cern.ch/amadio/root/root_6.26.10_ubuntu22_amd64.deb. Please note that this is an unofficial package, but should be ok for most people to use. If you are having trouble compiling ROOT, give it a try. After you download it, you can install it with
That is the root package (ROOT 6.26.10 ) I downloaded ten days ago and installed it using cmake and make. I guess that means that I installed it from the source, and not the binaries ( I really am very new to Unix, so I am learning a lot and correct me if I am wrong).
I need root to work within my Geant4 code, which uses some root headers. Yesterday, I was able to successfully add a path to the root headers in my CMakefiles.txt, and compile my Geant4 code.
While the cmake ran successfully (or so I think, because clearly it did not do a clean job), I faced compilation issues with make.
As I emailed earlier, I am facing issues with Rtypes.h, which calls some other root headers that call some functions that are not defined in the scope:
QUOTE(name) gives me error with the first underscore, and somewhere the right bracket after name is missing, which generates a syntax error.
Also, it is giving me an error that R__likely is not declared in this scope.
These errors have occurred multiple times. Once these are resolved, I can hopefully find other errors, because the screen buffer has overflowed.
Please note: if you write a code where you need to declare Rtypes.h in this new root version, you ought to be able to see the same errors that I see. That would be the fastest way to proceed, as I do not get back to my office (where I use my UNIX) until Monday.
First of all, thanks for this package, it’s a much more convenient solution than conda or a binary installation !
I’ve just tested it on a small personal cmake project, and it seems to work fine. I’m just asking if it works with python ? I’ve tried to import ROOT as usual in script, but it failed. Is it possible to make root accessible for the python system installation of the system ?
it depends on the build flags which @amadio set in his script. I use -Dpyroot=ON in my slackbuild. Also, PYTHONPATH might be not set correctly, even if -Dpyroot is ON.
The package does install python bindings (PyROOT) for python3, make sure that you use that and you should be able to just import ROOT without any problems. Also check your setup for old source thisroot.sh from .bashrc etc, you could have another ROOT interfering with your environment. Finally, try installing python-is-python3 as well. Cheers,
Ok well … my previous root installation was under a conda env. I thought it would not interfere as long as it was disabled, but it is obviously not the case, I removed the env and reboot and pyroot works perfectly
It also works very well in notebooks. Thanks, I will provide you feedback if i had any others problem.
If for example you wanted to use SQL server(not mysql)or Other libraries that aren’t installed by default. I have done this at the company(not academic) that I work for. ROOTs root binary is such an amazing tool to visualize and fit data.
Its Monday and i ran the code again to reproduce the errors with root headers. Some of them are here:
^~~~~~~~~~~~~~~~~
/home/neera/root/include/TBranch.h:291:4: note: in expansion of macro ‘ClassDef’
ClassDef(TBranch, 13); // Branch descriptor
^~~~~~~~
/home/neera/root/include/Rtypes.h:281:67: error: expected primary-expression before ‘)’ token
::ROOT::Internal::HasConsistentHashMember(QUOTE(name)) ||
^
/home/neera/root/include/Rtypes.h:300:4: note: in expansion of macro ‘ClassDefBase’ ClassDefBase(name,id, virtual_keyword, overrd)
^~~~~~~~~~~~~~
/home/neera/root/include/Rtypes.h:330:4: note: in expansion of macro ‘ClassDefOutline’ ClassDefOutline(name,id,override)
^~~~~~~~~~~~~~~~~
/home/neera/root/include/TDirectory.h:299:4: note: in expansion of macro ‘ClassDefOverride’
ClassDefOverride(TDirectory,5) //Describe directory structure in memory
^~~~~~~~~~~~~~~~
/home/neera/root/include/Rtypes.h:281:55: error: ‘QUOTE’ was not declared in this scope
::ROOT::Internal::HasConsistentHashMember(QUOTE(name)) ||
^
/home/neera/root/include/Rtypes.h:300:4: note: in expansion of macro ‘ClassDefBase’ ClassDefBase(name,id, virtual_keyword, overrd)
^~~~~~~~~~~~~~
/home/neera/root/include/Rtypes.h:330:4: note: in expansion of macro ‘ClassDefOutline’ ClassDefOutline(name,id,override)
^~~~~~~~~~~~~~~~~
/home/neera/root/include/TDirectory.h:299:4: note: in expansion of macro ‘ClassDefOverride’
ClassDefOverride(TDirectory,5) //Describe directory structure in memory
^~~~~~~~~~~~~~~~
/home/neera/root/include/TDatime.h: In member function ‘virtual Bool_t TDatime::CheckTObjectHashConsistency() const’:
/home/neera/root/include/Rtypes.h:275:11: error: ‘R__likely’ was not declared in this scope
if (R__likely(recurseBlocker >= 2)) {
^
/home/neera/root/include/Rtypes.h:300:4: note: in expansion of macro ‘ClassDefBase’ ClassDefBase(name,id, virtual_keyword, overrd)
^~~~~~~~~~~~~~
/home/neera/root/include/Rtypes.h:326:4: note: in expansion of macro ‘ClassDefOutline’ ClassDefOutline(name,id,virtual,)
^~~~~~~~~~~~~~~~~
/home/neera/root/include/TDatime.h:95:4: note: in expansion of macro ‘ClassDef’
ClassDef(TDatime,1) //Date and time 950130 124559
^~~~~~~~
/home/neera/root/include/Rtypes.h:281:67: error: expected primary-expression before ‘)’ token
::ROOT::Internal::HasConsistentHashMember(QUOTE(name)) ||
^
^~~~~~~~
/home/neera/root/include/TDirectoryFile.h: In member function ‘virtual Bool_t TDirectoryFile::CheckTObjectHashConsistency() const’:
/home/neera/root/include/Rtypes.h:275:11: error: ‘R__likely’ was not declared in this scope
if (R__likely(recurseBlocker >= 2)) { \
/home/neera/root/include/TUrl.h:98:4: note: in expansion of macro ‘ClassDef’
ClassDef(TUrl,1) //Represents an URL
^~~~~~~~
In file included from include/RunAction.hh:42:0,
from src/RunAction.cc:40:
/home/neera/root/include/TTree.h: In destructor ‘virtual TTreeFriendLeafIter::~TTreeFriendLeafIter()’:
/home/neera/root/include/TTree.h:678:29: error: ‘SafeDelete’ was not declared in this scope
~TTreeFriendLeafIter() { SafeDelete(fLeafIter); SafeDelete(fTreeIter); }
^~~~~~~~~~
/home/neera/root/include/TTree.h:678:29: note: suggested alternative: ‘kCanDelete’
~TTreeFriendLeafIter() { SafeDelete(fLeafIter); SafeDelete(fTreeIter); }
Those errors are only seen in the case you describe. This usually indicates that there is something ‘odd/unexpected’ about the environment (quite often a much older version of ROOT is found and unintentionally used during the compilation). To get the bottom of this, we need to make a few experiment.
First we need to get (one of) the command line that fails. To do, if you use make to build, do:
make VERBOSE=true |& tee make.log.txt
The last line before the first error is the command line we are looking for.
After looking at it (please share it here) for obvious misconfiguration, we can adjust it to switch from compiling to running just the preprocessor. From the preprocessor output, we should be able to get where thing go sour.
Thanks. Will be able to check it after Christmas and provide you an update of what I see. I will copy the exact same command line and hopefully, be able to track the compilation.