Error after cmake --build while installing ROOT


_ROOT Version: root_v624
_Platform: Ubuntu 20.04.3 LTS
Compiler: Not Provided


I need to install ROOT to use it in a programing class. I don’t understand how the installation process works but I followed the instruction my teacher provided:
1- I install all the required dependencies for Ubuntu
2- I run the code lines my teacher provided (I tried to write the code lines but the forum don’t let me write links)

After running cmake --build . – install -j4 the process can’t be completed. The terminal gives a error message:
[ 57%] Built target Unix
make: *** [Makefile:152: all] Erro 2
I don’t know if it helps but I leave a text document with the entire output. (I tried to write the entire output but the forum don’t let me write links)

Can anyone help me?

Hey,

Assuming your teacher doesn’t have special requirements for ROOT, the usual advice would be to not bother compiling your own version and to resort to the precompiled binaries provided by ROOT & the community.

Officially, ROOT provides precompiled versions for Ubuntu 20.04. You can take a look at the recent releases here and download a copy for Ubuntu 20.04. Once downloaded, you’d need to extract the archive (Which should be doable either graphically or with tar xf archive_name.tar.gz in the terminal), and each time you need to use root, you’d need to source the thisroot.sh file in the terminal which would make root and its other commands available to use.

Alternatively, I’d recommend trying the Snap package which is provided by myself, and is focused more on use cases like yourself where you just want a usable version of ROOT with minimum configuration and don’t need to consider integrating it with other projects in complex ways. For that, you can just run sudo snap install root-framework in the terminal, root will then by instantly available to you without requiring you run the source command, and it’ll also be added to your start menu. If you wish to use pyroot with the ROOT snap however, you need to run pyroot in the terminal rather than python.

With the Snap, it might also be easier for yourself with getting started by trying to run root --notebook, which would open a browser environment with Jupyter Notebooks for running ROOT interactively and might be easier to get accustomed to. This is also available in the other builds but might require additional setup.

There’s also a Conda package available that would likely be preferable to compiling your own versions too, which doesn’t have the same integration issues as the snap has but has a slightly harder setup, if you end up using ROOT in more complex ways in the future (e.g, maybe by linking ROOT and Geant4 together at a binary level), this is a very good option too.

Hey, thank you for answering!
I’m trying to follow your first suggestion. So, I downloaded the source distribution and the binary distribution for Ubuntu 20 and I extracted the archives to my home page. Now, what should I exactly type on the terminal to use root?

You don’t need the source distribution with the precompiled download, you need to extract the contents of the binary archives, and then run the command source bin/thisroot.sh, you may need to change the exact path to thisroot.sh depending on where you’ve actually placed the extracted ROOT folder and your current working directory, but I presume you’ll be ok with working out the exact paths if needs be.

This sets up the root environment, after you’ve run source bin/thisroot.sh, you can run root in the terminal and it’ll work, you can also run python where import ROOT would then work.

You’d need to run the source command every time you open a new terminal unless you were to use an approach such as adding it to the .bashrc file, so that it’s run on every terminal invocation automatically.

Please be aware this assumes that you’ve already installed the required packages listed here under the Ubuntu section, I’ve neglected to mention this so far because I’m assuming you have these packages already from attempting to compile ROOT yourself, but it could be worth running the provided apt install commands just to make sure.

Ok, I found the path and run the command… and it worked! I’m not entirely sure if I this will work for what my teacher want me to do, but so far it looks good.
Thank you very much!