Install CERN ROOT 6 in Ubuntu 18.04 (LTS) and enable all libraries
Steps:
1. Download the source file from the link https://root.cern.ch/download/root_v6.10.04.source.tar.gz.
2. Place it in a proper place, for example, create a folder Root in Home of your system and extract using the following command:
tar -xvzf root_v6.10.04.source.tar.gz root-6.10.04/
3. Now install the prerequisites (see https://root.cern.ch/build-prerequisites) using the command:
sudo apt-get install git dpkg-dev cmake g++ gcc binutils libx11-dev libxpm-dev libxft-dev libxext-dev
4. You may install some optional libraries using command:
sudo apt-get install gfortran libssl-dev libpcre3-dev \
xlibmesa-glu-dev libglew1.5-dev libftgl-dev \
libmysqlclient-dev libfftw3-dev libcfitsio-dev \
graphviz-dev libavahi-compat-libdnssd-dev \
libldap2-dev python-dev libxml2-dev libkrb5-dev \
libgsl0-dev libqt4-dev
5. It is recommended to build the ROOT in a separate folder other than the source folder. Hence, create a directory called “root” in the directory where root-6.10.04 is already present.
mkdir root
cd root
6. Run the command:
cmake ../root-6.10.04/ -Dall=ON
7. After that run:
cmake --build . -- -j3
8. It will take some 2 to 3 hours to complete. If somehow it shows some error, un the command again. After that run the following command:
. bin/thisroot.sh
(Note the full-stop/dot in front of the line)
9. Now root has been installed and can be called using the command:
root
10. To call root from other directories you need to modify the “.bashrc” file. At first note the current location using the command:
pwd
(It will be something like this: /home/username/Root/root)
11. Now open a terminal using ctrl+alt+t and run the command:
gedit ~/.bashrc
12. Paste the following lines at the last of the file:
# For ROOT
export ROOTSYS=/home/(your username)/Root/root
export PATH=$ROOTSYS/bin:$PATH
export LD_LIBRARY_PATH=$ROOTSYS/lib/:$LD_LIBRARY_PATH
13. Now you can run root from any folder or location using the command:
root
Note: Root 5 and root 6 versions have some differences and hence sometimes scripts of root 5 do not work properly in root 6. Therefore scripts written for root 5 must be modified accordingly to run in root 6 versions.
No comments:
Post a Comment