Locked History Actions

InstallRoot

ROOT Installation

Ubuntu Server 12.04

Identical to Ubuntu Server 10.04 install below except using newer version of root.

wget -nd -nH ftp://root.cern.ch/root/root_v5.34.03.source.tar.gz

Recompile with PyROOT

./configure --prefix=/usr/local --enable-soversion --enable-roofit --enable-minuit2 --enable-fftw3 --enable-fitsio --enable-gsl-shared --enable-xrootd --enable-python --with-python-incdir=/usr/local/share/anaconda/include/python2.7 --with-python-libdir=/usr/local/share/anaconda/lib

Ubuntu Server 10.04

Install X11 build pre-requisites:

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

Grab binary:

wget -nd -nH ftp://root.cern.ch/root/root_v5.28.00c.source.tar.gz
tar -zxf root_v5.28.00c.source.tar.gz
rm root_v5.28.00c.source.tar.gz
cd root

Configure:

./configure --prefix=/usr/local --enable-soversion --enable-roofit --enable-minuit2 --enable-fftw3 --enable-fitsio --enable-gsl-shared --enable-xrootd

Build and install:

make
sudo make install

Update system shared library info by first creating root.conf containing /usr/local/lib/root and then re-building the shlib cache (details here):

sudo nano /etc/ld.so.conf.d/root.conf
sudo /sbin/ldconfig

OS 10.6

./configure macosx64 --enable-roofit --enable-minuit2 --enable-fftw3 --enable-fitsio --enable-gsl-shared --enable-ruby --enable-python --disable-rpath --disable-xrootd --prefix=/usr/local

I needed to configure and build libAfterImage by hand:

cd graf2d/asimage/src/libAfterImage
./configure --with-builtin-png
make -j4
cd ../../../..

Finally...

make
sudo make install

which should end with:

Installing binaries in /usr/local/bin
Installing libraries in /usr/local/lib/root
Installing headers in /usr/local/include/root
Installing /Users/david/BaBar/root/5-28-00/root/main/src/rmain.cxx in /usr/local/include/root
Installing cint/cint/include cint/cint/lib and cint/cint/stl in /usr/local/lib/root/cint
Installing icons in /usr/local/share/root/icons
Installing fonts in /usr/local/share/root/fonts
Installing misc docs in /usr/local/share/doc/root
Installing tutorials in /usr/local/share/doc/root/tutorials
Installing tests in /usr/local/share/doc/root/test
Installing macros in /usr/local/share/root/macros
Installing man(1) pages in /usr/local/share/man/man1
Installing config files in /etc/root
Installing Autoconf macro in /usr/local/share/aclocal
Installing Emacs Lisp library in /usr/local/share/emacs/site-lisp
Installing GDML conversion scripts in /usr/local/lib/root

OS 10.9

Download latest version root (v5.34.19). After updating to Mavericks, make sure you update XCode and run

xcode-select --install

I also had to update my gfortran compiler. Remember to rebuild the prereq packages fftw3, gsl, etc..

Notet that I am using anaconda python distribution.

Configure:

./configure macosx64 --enable-cxx11 --enable-libcxx --enable-roofit --enable-minuit2 --enable-fftw3 --enable-fitsio --enable-gsl-shared --enable-ruby --enable-python --disable-rpath --disable-xrootd --enable-python --prefix=/usr/local --with-python-incdir=/Users/daniel/anaconda/include/python2.7/ --with-python-libdir=/Users/daniel/anaconda/lib

Build and install:

make
sudo make install

For some reason, my anaconda python isn't being linked properly even after specifying the paths in the configure step above. To manually fix:

$ otool -L lib/libPyROOT.so
lib/libPyROOT.so:
        /usr/local/lib/root/libPyROOT.so (compatibility version 0.0.0, current version 0.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
        /usr/local/lib/root/libRIO.so (compatibility version 0.0.0, current version 0.0.0)
        /usr/local/lib/root/libTree.so (compatibility version 0.0.0, current version 0.0.0)
        /usr/local/lib/root/libCore.so (compatibility version 0.0.0, current version 0.0.0)
        /usr/local/lib/root/libCint.so (compatibility version 0.0.0, current version 0.0.0)
        libpython2.7.dylib (compatibility version 2.7.0, current version 2.7.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)

Note the second to last line. Change this to point to the anaconda libpython:

install_name_tool -change libpython2.7.dylib /Users/daniel/anaconda/lib/libpython2.7.dylib lib/libPyROOT.so 

l$ otool -L lib/libPyROOT.so
lib/libPyROOT.so:
        /usr/local/lib/root/libPyROOT.so (compatibility version 0.0.0, current version 0.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
        /usr/local/lib/root/libRIO.so (compatibility version 0.0.0, current version 0.0.0)
        /usr/local/lib/root/libTree.so (compatibility version 0.0.0, current version 0.0.0)
        /usr/local/lib/root/libCore.so (compatibility version 0.0.0, current version 0.0.0)
        /usr/local/lib/root/libCint.so (compatibility version 0.0.0, current version 0.0.0)
        /Users/daniel/anaconda/lib/libpython2.7.dylib (compatibility version 2.7.0, current version 2.7.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)

Now I can import ROOT in python.