Installing CERN's ROOT framework - lmmx/devnotes GitHub Wiki

Prerequisites

(Via Elena Graverini's blog)

Prerequisites:

sudo apt-get install build-essential git subversion dpkg-dev make g++ gcc binutils libx11-dev libxpm-dev libxft-dev libxext-dev

Optional (recommended) prerequisites:

sudo apt-get install gfortran libssl-dev libpcre3-dev libglu1-mesa-dev libglew-dev libftgl-dev libmysqlclient-dev libfftw3-dev libcfitsio3-dev graphviz-dev libavahi-compat-libdnssd-dev libldap2-dev python-dev libxml2-dev libkrb5-dev libgsl0-dev libqt4-dev

Install font server and fonts for ROOT:

sudo apt-get install xfs xfstt
sudo apt-get install t1-xfree86-nonfree ttf-xfree86-nonfree ttf-xfree86-nonfree-syriac xfonts-75dpi xfonts-100dpi

Installation

gzip -dc root_v5.34.24.source.tar.gz | tar -xf -
mv root ~
cd ~/root
./configure --all
make -j N

where N is the number of CPU cores on your machine (cat /proc/cpuinfo | grep 'cpu cores')

  • For Ubuntu 14.04 run: sudo mkdir /usr/include/freetype && sudo cp /usr/include/freetype2/freetype.h /usr/include/freetype/freetype.h
    • If you're uninstalling don't forget to take this out too

Compile failure debug - manual provision of 'missing' files
(don't try this!)

The compilation of xps module from Bioconductor continued to fail for me, unable to find certain components of ROOT, so I manually added them. Check the relevant folders to your installation with whereis root after installing, or whereis root | ls to list the folder contents of the directory this command provides too, /usr/include/root.



For me, the remaining files to download were TMath.h, TRandom.h, TBranch.h, TLeaf.h, TFriendElement.h, ...



sudo -i
cd /usr/include/root
wget https://root.cern.ch/root/html/TMath.h
wget https://root.cern.ch/root/html/TRandom.h
wget https://root.cern.ch/root/html/TBranch.h
wget https://root.cern.ch/root/html/TLeaf.h
wget https://root.cern.ch/root/html/TFriendElement.h

... and at that point it wasn't a missing file that stopped the compile anymore, rather warnings appeared that variables were redefined and then the TMath.h threw errors about "*** does not name a type".



I assume this meant the version I got (the most recent) was stable, but incomplete or changed (as in, it now omits these 5 files in favour of doing things differently, and that's why adding them back in manually trips the compile process up). Possibly why 5.34.24 is recommended despite v6 being labelled Pro(duction)

Edit: the xps README explains the binary was compiled with 5.34.x so that's why v6 doesn't work

Removing Ubuntu's version of ROOT resolves ld errors in make

sudo apt-get purge root-system root-system-bin root-system-common export ROOTSYS=/home/louis/root

Rerunning make with config as ./configure --prefix=/home/louis/ works

  • I think the prefix flag is equivalent to setting the ROOTSYS variable before make (I was using multiple guides and forgot to set it, but it worked regardless)
  • The CERN ROOT installation from source page notes that make install is a "NOOP"... but it isn't installed unless you run this after make, so do it anyway

Last step is to add $ROOTSYS/bin to PATH - add source ~/bin/thisroot.sh to your ~/.bashrc (assuming your .bashrc is already sourced in new terminals)

  • For me, ROOTSYS is now set in shells. The xps README suggests you set it, but PATH isn't, so I proceeded to add the following to my .bashrc:
export PATH=$ROOTSYS/bin:$PATH
export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH

ROOT should now be operational, and able to compile xps...

  • For some reason LD_LIBRARY_PATH doesn't get set but PATH does...? .bashrc is otherwise all working as expected
cd $ROOTSYS/tutorials`
root
root [0] .x demos.C

If no errors appear, ROOT is working.

Installing xps

I'd expect biocLite('xps') to fail as the binary was created with ROOT v.5.34.05... but the v5.34.24 was recommended by the maintainer so attempt it anyway:

source("http://bioconductor.org/biocLite.R")
biocLite("xps")

and it works :-)

  • It's also possible to download from source and bypass Bioconductor by running R CMD INSTALL xps_1.26.0.tar.gz
  • RootTalk Discussion Forums (including a ROOT Support forum): https://root.cern.ch/phpBB3/
⚠️ **GitHub.com Fallback** ⚠️