Articles

PyROOT installation on Ubuntu 10.04

In howto on Jul 13, 2012 by theoryl Tagged: , , , , , , , ,

Last time I installed ROOT, I did not have PyROOT enabled. So I have to recompile. The following assumes Python 2.6 has been installed.

Install ROOT v5.27/06b on Ubuntu 10.04:

# Download ROOT via svn checkout. For simplicity, download to the home area
svn co http://root.cern.ch/svn/root/tags/v5-27-06d ~/root
cd ~/root
svn switch http://root.cern.ch/svn/root/branches/v5-27-06-patches

# Get all the dependencies for Ubuntu
sudo apt-get install build-essential libx11-dev libxpm-dev libxft-dev libxext-dev

# Configure. Enable PyROOT along with many useful features
# (to change the installation directory, add `--prefix=/path/to/installation/directory/`)
./configure linux --enable-python --with-python-incdir=/usr/include/python2.6/ --with-python-libdir=/usr/lib/ --enable-mathcore --enable-mathmore --enable-roofit --enable-minuit2 --enable-gdml --enable-table

# Make
# (to use n number of cores, do `make -j n`)
make

# Install
# (to gain superuser privilege, do `sudo make install`)
make install

To run ROOT, the environment variables need to be set. For bash shell:

export ROOTSYS=$HOME/root
export PATH=$ROOTSYS/bin:$PATH
export LD_LIBRARY_PATH=$ROOTSYS/lib:$PYTHONDIR/lib:$LD_LIBRARY_PATH
export PYTHONPATH=$ROOTSYS/lib:$PYTHONPATH

For c-shell:

setenv ROOTSYS $HOME/root
setenv PATH $ROOTSYS/bin:$PATH
setenv LD_LIBRARY_PATH $ROOTSYS/lib:$PYTHONDIR/lib:$LD_LIBRARY_PATH
setenv PYTHONPATH $ROOTSYS/lib:$PYTHONPATH

Equivalently, they can be set by doing

source $HOME/root/bin/thisroot.sh
#< for c-shell, do `source $HOME/root/bin/thisroot.csh`

To avoid setting the above variables every time, you can put the commands into ~/.bashrc (or ~/.cshrc).

Now try running ROOT:

root

If the ROOT splash screen shows up, quit and try running PyROOT:

python ~/root/tutorials/pyroot/demo.py

Please report any inaccuracy.

Advertisements

2 Responses to “PyROOT installation on Ubuntu 10.04”

  1. Tried all this on a recent Ubuntu release following http://yannisflou.wordpress.com/2012/06/05/root-data-analysis-framework-on-ubuntu-12-04/ modifying the ./configure step however it does not work.

    python ~/ROOT/root/tutorials/pyroot/demo.py
    Traceback (most recent call last):
    File “/home/sdt/ROOT/root/tutorials/pyroot/demo.py”, line 2, in
    import ROOT
    ImportError: No module named ROOT

  2. Hi, it is also not working for me.

    $ svn co http://root.cern.ch/svn/root/tags/v5-27-06d ~/root
    Redirecting to URL ‘https://root.cern.ch/svn/root/tags/v5-27-06d’:
    svn: E160013: Unable to connect to a repository at URL ‘https://root.cern.ch/svn/root/tags/v5-27-06d’
    svn: E160013: ‘/svn/root/tags/v5-27-06d’ path not found

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: