# Error after cmake --build while installing ROOT

**URL:** <https://root-forum.cern.ch/t/error-after-cmake-build-while-installing-root/47747>\
**Category:** Newbie\
**Created:** [November 21, 2021, 1:51pm UTC](https://root-forum.cern.ch/t/error-after-cmake-build-while-installing-root/47747 "2021-11-21T13:51:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vasco](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/ba8739/32.png) [@vasco](https://root-forum.cern.ch/u/vasco)\
**Post date:** [November 21, 2021, 1:51pm UTC](https://root-forum.cern.ch/t/error-after-cmake-build-while-installing-root/47747/1 "2021-11-21T13:51:58Z")

</div>

* * *

\_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?

---

<div class="post-metadata">

**Author:** ![James-Carroll](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/james-carroll/32/27108_2.png) [@James-Carroll](https://root-forum.cern.ch/u/James-Carroll)\
**Post date:** [November 21, 2021, 2:29pm UTC](https://root-forum.cern.ch/t/error-after-cmake-build-while-installing-root/47747/2 "2021-11-21T14:29:33Z")

</div>

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](https://root.cern/install/all_releases/) 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.

---

<div class="post-metadata">

**Author:** ![vasco](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/ba8739/32.png) [@vasco](https://root-forum.cern.ch/u/vasco)\
**Post date:** [November 21, 2021, 4:14pm UTC](https://root-forum.cern.ch/t/error-after-cmake-build-while-installing-root/47747/3 "2021-11-21T16:14:57Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![James-Carroll](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/james-carroll/32/27108_2.png) [@James-Carroll](https://root-forum.cern.ch/u/James-Carroll)\
**Post date:** [November 21, 2021, 4:49pm UTC](https://root-forum.cern.ch/t/error-after-cmake-build-while-installing-root/47747/4 "2021-11-21T16:49:22Z")

</div>

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](https://root.cern/install/dependencies/#ubuntu-and-other-debian-based-distributions) 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.

---

<div class="post-metadata">

**Author:** ![vasco](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/ba8739/32.png) [@vasco](https://root-forum.cern.ch/u/vasco)\
**Post date:** [November 21, 2021, 5:44pm UTC](https://root-forum.cern.ch/t/error-after-cmake-build-while-installing-root/47747/5 "2021-11-21T17:44:08Z")

</div>

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!
