Installation Guide for ROOT

Binary Distribution (the simplest approach)

  1. download the compressed file from ROOT's official site (choose the one for your OS, e.g ubuntu16)
  2. extract the file to some path, e.g. /home/tom/softwares/root-6-10
  3. add the following line to your start-up script (~/.bashrc)
source <path-to-where-you-extract-the-files>/bin/thisroot.sh  

Open a new terminal/console, enter root and enjoy the advanced calculator ROOT software.

Build ROOT from source code

it is not recommended to build and install ROOT from source code unless: + your OS is not listed in pre-compiled binary distributions + you want to tweak the build options for some reason.

  1. Install required libraries for ROOT. Check out this root build guide.

NOTE: if you've already installed GEANT4 following the previous guide, you can skip this step.

  1. Use the following commands to build and install ROOT. The instructions use /softwares/root for both source files and binary files. You should change these paths to fit your directory management.
# go to target path and make a new directory for ROOT
cd /softwares  
mkdir root  
cd root

# download the newest ROOT source code from cern (6.10/08)
# you can also download via Web Browser
wget https://root.cern.ch/download/root_v6.10.08.source.tar.gz  
tar zxvf root_v6.10.08.source.tar.gz

# move the compressed source code to /tmp (will be deleted next reboot)
# mv root_v6.10.08.source.tar.gz /tmp

# prepare directory for built binary files
mkdir root-6-install  
mkdir root-6-build  
cd root-6-build

# configure the package and build
# -Dgdml=ON -Dminuit2=ON -Droofit=ON are some frequently used build options
cmake -DCMAKE_INSTALL_PREFIX=../root-6-install -Dgdml=ON -Dminuit2=ON -Droofit=ON ../root-6.10.08  
[check everything looks okay]
make -j2 # speed up compilation with -jN  
make install # will install the binary files to your `CMAKE_INSTALL_PREFIX`  
  1. add to environment (edit ~/.bashrc)
source /softwares/root/root-6-install/bin/thisroot.sh