Linux Commands

How to Install and Use Root in Linux


Root is a very popular open-source software framework designed by the CERN laboratories for statistical analyses. It is highly revered in the high energy physics research community because of its ability to work with huge data sets with relative ease. The data set size is something that is of little concern to Root users since it uses a C++ interpreter at its core which is one of the most memory efficient programming languages ever built.

The Root application also comes with a unique graphical user interface that enables people with little to no programming background to interact with this tool and use it for their applications. There is also a C++ interpreter working in the backend to provide this tool with its core functionality. This interpreter can be interacted with by writing the code in C++ using the Root prompt.

Root is mainly used to study and analyze large amounts of data. The different representations that Root is able to visualize any data in are some of the most unique and information-rich visualizations produced by any data analytics tool. Not only is Root easily able to generate graphs and visual performance metrics on multiple layers of large data sets, it is also able to do all of this very quickly and preserve more memory as compared to other data mining tools. Some examples of Root’s visual performance metrics are shown in the following:


 

Installation

To install and use Root, we need to first install some prerequisites for this framework.

1. We install some essential packages for Root using the apt package manager. These include git, dpkg-dev, gcc, g++, and more.

Open the Bash terminal on your Linux machine and run the following commands:

$ sudo apt-get install git dpkg-dev make g++ gcc binutils libx11-dev

 

You should get an output which is similar to this:

$ sudo apt-get install libxpm-dev libxft-dev libxext-dev

 

You should get a similar output:

2. We now move into the directory where we want to install Root by running the following command:

$ cd /usr/local/

 

3. Download the Root files from Github.

Run the following command:

$ sudo git clone https://github.com/root-mirror/root.git

 

You should get something similar to the following image as an output:

4. Change the ownership of the “root” folder which was downloaded in the previous step.

Run the following command:

$ sudo chown -R "username" root

 
Note: If you do not know the username for your machine, run the following command and the first column in the output is your username:

$ who

 

5. Move into the “root” directory that contains all of the downloaded files and then we’ll build the code.

Run the following command:

$ cd root && ./configure --all && make -j 4

 

You should get an output similar to this:


Note: If the previous command doesn’t work for you, run the following command:

$ make clean && ./configure --minimal && make

 
Note: Step 5 might take a few minutes to finish running. You will be able to see the terminal outputs showing the percentage of completion.

6. Once the building is complete, run the following command:

$ source bin/thisroot.sh

 

7. You will now be able to run Root by running the following command:

$ root

 

Root prompt is now open in your terminal and you can use it to write the code in C++.

User Guide

To open the Root canvas, run the following command after step 7 of the installation guide:

TCanvas C

 
The terminal has the following output:


An instance of the Root canvas opens up. You will be able to make changes here according to your requirements.


To open the canvas in the web browser, simply click on the Tools option in the Toolbar at the top and select the Start Browser option. This should open an instance of Root in your default browser application.

Conclusion

Root is a free-to-use data analytics and statistical analysis software developed by CERN. As explained earlier, it is primarily used to run the data analytics on large data sets. What helps Root stand out from the competition is the fact that it uses a C++ backend that is extremely memory efficient, which enables it to run most analytical models on data sets of varying sizes very quickly.

It requires prior programming experience since the Root prompt requires you to write a code in C++. This does not however mean that people with no programming knowledge cannot use this tool. The canvas and the graphical user interface provided with the tool help you build models and applications using an intuitive drag and drop approach.

Root also provides support for Python since it is a popular language and contains some of the best software libraries for data mining. The Root prompt that you get with this installation can be configured to run with Python commands, too. This opens up new ways in which you can interact with this tool.

The multiple methods you can use to interact with this software framework are only a secondary benefit of using this tool. The primary benefit is its ability to complete the data analytics tasks more quickly than most of the other frameworks available on the market today.

About the author

Zeeman Memon

Hi there! I'm a Software Engineer who loves to write about tech. You can reach out to me on LinkedIn.