Skip to content

Instantly share code, notes, and snippets.

@Tsangares
Last active February 1, 2019 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tsangares/6aa87a66e54e411db89ac7d09a5e899c to your computer and use it in GitHub Desktop.
Save Tsangares/6aa87a66e54e411db89ac7d09a5e899c to your computer and use it in GitHub Desktop.
Installing ROOT

Windows 10

Step 1: X-Window manager

Download and install XMing: XMing

Step 2: Enabling Ubuntu on Windows

Open powershell with admin priveldges:

  • Hit windows button and search for power shell
  • Right click icon and hit run as admin

Run the following command in powershell to enable subsystems:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Download and install Ubuntu from the microsoft store: Microsoft Stort: Ubuntu

Once installed, open up Ubuntu (should say initializiing).

Step 3: Downloading ROOT with wget

The easiest way to download ROOT is to use the following command:

wget https://root.cern/download/root_v6.16.00.Linux-ubuntu18-x86_64-gcc7.3.tar.gz

The above command uses wget, if the console prints, "command not found." You need to install it using:

sudo apt-get install wget

Note the above command gets version 6.16 of root, if you want the latest version go to: CERN ROOT: Latest

Once you have the ROOT tarball downloaded, you need to install all the dependencies for root by running the following:

sudo apt-get install git dpkg-dev cmake g++ gcc binutils libx11-dev libxpm-dev \
libxft-dev libxext-dev libtiff-dev

Warning There is a missing depencey; I don't know what it is though.

Untar the tar.gz file by using the command:

tar -xvf root_v6.16.00.Linux-ubuntu18-x86_64-gcc7.3.tar.gz

Explaination of tar: The -x stands for extract, the -v for verbose and -f stands for file. Tar is an interesting comparizon to a zip file. A tar file alone can turn 100 files into 1, but does not compress it at all. A zip file does the same thing but also compresses it. The tar's compression comes after it is contained which is the .gz extension, using DEFLATE compression which is the same compression used by zip.

Now you have your root extracted into the root/ folder of your current working directory. To link it to your terminal use the command:

echo "source $(pwd)/root/bin/thisroot.sh" >> ~/.bashrc

Step 4: Link ubuntu to xming

To link XMing to ubuntu's ROOT use the command:

echo "export DISPLAY=localhost:0.0" >> ~/.bashrc

Final Step

To actiavate your terminal with the newly installed software, use the command:

source ~/.bashrc

Then to run ROOT:

root -l 

Then run this command IN ROOT:

TCanvas c; 

Mac

Download and install XQuartz: XQuartz

(Optional) Find the latest download link for ROOT and copy the url: CERN ROOT: Latest

Download ROOT using this command:

wget https://root.cern/download/root_v6.16.00.macosx64-10.14-clang100.tar.gz

Extract the recently downloaded tarball using:

tar -xvf root_v6.16.00.macosx64-10.14-clang100.tar.gz

Then run this to link your terminal with root:

echo "source $(pwd)/root/bin/thisroot.sh" >> ~/.bashrc

Run this to activate your terminal session:

source ~/.bashrc

Then run root using:

root -l

Once in root run this command to open up a window:

TCanvas c;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment