Building ROOT 5.34 SLC5 gcc43 for DPM rfio

Hi,

While we have been using the AFS build of ROOT 5.30 successfully with the DPM rfio library, this is not possible with ROOT 5.32 or following due to the CASTOR library dependency. Therefore, re-building ROOT without CASTOR and with DPM rfio seems like a hopeful way forward.

Working on a

Linux atlas073 2.6.18-308.8.2.el5 #1 SMP Wed Jun 13 11:07:54 CEST 2012 x86_64 x86_64 x86_64 GNU/Linux
Scientific Linux CERN SLC release 5.8 (Boron)

The setup used for the AFS build of 5.34

/afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.00/x86_64-slc5-gcc43-opt/root

was used as a starting point,

]$ root-config --config | tr ' ' '\n'
--fail-on-missing
--enable-builtin-pcre
--enable-cintex
--enable-explicitlink
--enable-gdml
--enable-genvector
--enable-krb5
--enable-mathmore
--enable-minuit2
--enable-mysql
--enable-oracle
--enable-python
--enable-qt
--enable-qtgsi
--enable-reflex
--enable-roofit
--enable-table
--enable-unuran
--with-cint-maxstruct=36000
--with-cint-maxtypedef=36000
--with-cint-longline=4096
--with-castor-incdir=/afs/cern.ch/sw/lcg/external/castor/2.1.9-9/x86_64-slc5-gcc43-opt/usr/include/shift
--with-castor-libdir=/afs/cern.ch/sw/lcg/external/castor/2.1.9-9/x86_64-slc5-gcc43-opt/usr/lib64
--with-cern-libdir=/afs/cern.ch/sw/lcg/external/cernlib/2006a/x86_64-slc5-gcc43-opt/lib
--with-dcap-libdir=/afs/cern.ch/sw/lcg/external/dcache_client/2.47.5-0/x86_64-slc5-gcc43-opt/dcap/lib
--with-dcap-incdir=/afs/cern.ch/sw/lcg/external/dcache_client/2.47.5-0/x86_64-slc5-gcc43-opt/dcap/include
--with-fftw3-incdir=/afs/cern.ch/sw/lcg/external/fftw3/3.1.2/x86_64-slc5-gcc43-opt/include
--with-fftw3-libdir=/afs/cern.ch/sw/lcg/external/fftw3/3.1.2/x86_64-slc5-gcc43-opt/lib
--with-gccxml=/afs/cern.ch/sw/lcg/external/gccxml/0.9.0_20110825/x86_64-slc5-gcc43-opt/bin
--with-gfal-libdir=/afs/cern.ch/sw/lcg/external/Grid/gfal/1.11.8-2/x86_64-slc5-gcc43-opt/lib
--with-gfal-incdir=/afs/cern.ch/sw/lcg/external/Grid/gfal/1.11.8-2/x86_64-slc5-gcc43-opt/include
--with-gsl-incdir=/afs/cern.ch/sw/lcg/external/GSL/1.10/x86_64-slc5-gcc43-opt/include
--with-gsl-libdir=/afs/cern.ch/sw/lcg/external/GSL/1.10/x86_64-slc5-gcc43-opt/lib
--with-mysql-incdir=/afs/cern.ch/sw/lcg/external/mysql/5.5.14/x86_64-slc5-gcc43-opt/include
--with-mysql-libdir=/afs/cern.ch/sw/lcg/external/mysql/5.5.14/x86_64-slc5-gcc43-opt/lib
--with-oracle-incdir=/afs/cern.ch/sw/lcg/external/oracle/11.2.0.1.0p3/x86_64-slc5-gcc43-opt/include
--with-oracle-libdir=/afs/cern.ch/sw/lcg/external/oracle/11.2.0.1.0p3/x86_64-slc5-gcc43-opt/lib
--with-rfio-incdir=/afs/cern.ch/sw/lcg/external/castor/2.1.9-9/x86_64-slc5-gcc43-opt/usr/include/shift
--with-rfio-libdir=/afs/cern.ch/sw/lcg/external/castor/2.1.9-9/x86_64-slc5-gcc43-opt/usr/lib64
--with-pythia6-libdir=/afs/cern.ch/sw/lcg/external/MCGenerators/pythia6/426.2/x86_64-slc5-gcc43-opt/lib
--with-pythia8-incdir=/afs/cern.ch/sw/lcg/external/MCGenerators/pythia8/160/x86_64-slc5-gcc43-opt/include
--with-pythia8-libdir=/afs/cern.ch/sw/lcg/external/MCGenerators/pythia8/160/x86_64-slc5-gcc43-opt/lib
--with-gviz-incdir=/build/bellenot/libraries/x86_64-slc5-gcc43-opt/graphviz-2.24.0/include/graphviz
--with-gviz-libdir=/build/bellenot/libraries/x86_64-slc5-gcc43-opt/graphviz-2.24.0/lib
--with-xrootd=/afs/cern.ch/sw/lcg/external/xrootd/3.1.0p2/x86_64-slc5-gcc43-opt

In a new shell, attempts to compile with these options failed with

Configuring for linux
INFO: --enable-cintex: already enabled by default.
INFO: --enable-genvector: already enabled by default.
INFO: --enable-krb5: already enabled by default.
INFO: --enable-mathmore: already enabled by default.
INFO: --enable-mysql: already enabled by default.
INFO: --enable-oracle: already enabled by default.
INFO: --enable-python: already enabled by default.
INFO: --enable-reflex: already enabled by default.
WARNING: option --with-cern-libdir=/afs/cern.ch/sw/lcg/external/cernlib/2006a/x86_64-slc5-gcc43-opt/lib is deprecated and ignored!
Checking for GNU Make version >= 3.80 ... ok
Checking for C compiler ... gcc
Checking for C++ compiler ... g++
Checking for linker (LD) ... g++
Checking for F77 compiler ... gfortran
Checking for libX11 ... /usr/lib
Checking for X11/Xlib.h ... /usr/include
Checking for X11/xpm.h ... /usr/include
Checking for X11/Xft/Xft.h ... /usr/include
Checking for X11/extensions/shape.h ... /usr/include
Checking for libXpm ... /usr/lib
Checking for libXft ... /usr/lib
Checking for libXext ... /usr/lib
Checking for freetype-config ... /usr/bin/freetype-config
Checking for libfreetype version >= 9.3.0 ... ok
Checking whether to build included libfreetype6 ... no
Checking whether to build included libpcre ... yes
Checking for zlib.h ... /usr/include
Checking for libz ... /usr/lib
Checking whether to build included zlib ... no
Checking for lzma.h ... no
Checking for liblzma ... no
Checking whether to build included lzma ... yes
Checking for GL/gl.h ... /usr/include
Checking for libGL, or libMesaGL ... /usr/lib
Checking for libGLU, or libMesaGLU ... no
Checking for mysql_config ... not found
Checking for mysql.h ... /afs/cern.ch/sw/lcg/external/mysql/5.5.14/x86_64-slc5-gcc43-opt/include
Checking for libmysqlclient_r, libmysqlclient, or mysqlclient ... no
Explicitly required MySQL dependencies not fulfilled

even though the mysql library directory is specified, which contains the libraries the configuration script is complaining about. Is there a fix for this problem?

Removing mysql directories and disabling the mysql options, causes the build script to fail with

Checking for occi.h ... /afs/cern.ch/sw/lcg/external/oracle/11.2.0.1.0p3/x86_64-slc5-gcc43-opt/include
Checking for libclntsh, or oci ... no
Checking for libocci, or oraocci10 ... no
Explicitly required Oracle dependencies not fulfilled

Having removed all of the database and qt references the build script fails with

Checking for Python.h ... /afs/cern.ch/sw/lcg/external/Python/2.6.5/x86_64-slc5-gcc43-opt/include/python2.6
Checking for python2.6, libpython2.6, libpython, python, or Python ... no
Explicitly required Python dependencies not fulfilled

This is even more odd, since

]$ which python
/afs/cern.ch/sw/lcg/external/Python/2.6.5/x86_64-slc5-gcc43-opt/bin/python

The build script exits in the same way. (Even though the script does not have an extension “.sh”, the forum reports an error “The extension is not allowed.” when I try to upload it.) The script can therefore be found below.

Thanks and best regards,

Will

#!/bin/bash
root_version="5.34.00"
root_file="root_v"$root_version".source.tar.gz"
working_dir=$(mktemp -d)
prefix="/atlas/data1/userdata/wbell/software/root/$root_version/x86_64-slc5-gcc43-opt/root"
build_dir=$working_dir"/root/build"

cd $working_dir

if [ ! -f $root_file ]; then
  echo "$root_file not present.  Attempting a download using wget"
  wget "ftp://root.cern.ch/root/"$root_file
  if [[ $? != 0 ]]; then 
    echo "ERROR: download failed."
    exit 1
  fi
fi

if [ -d $prefix ]; then 
  echo "WARNING: $prefix already exists.  Build command ignored."
  exit 0
fi
  
echo "Unpacking $root_file"
mkdir -p $build_dir
cd $build_dir
tar xfz $working_dir/$root_file

echo "Building root version $root_version"

# Add the compiler version
source /afs/cern.ch/sw/lcg/external/gcc/4.3.2/x86_64-slc5/setup.sh

# 64 bit python for 64 bit ROOT
python_dir="/afs/cern.ch/sw/lcg/external/Python/2.6.5/x86_64-slc5-gcc43-opt"
if [[ $PATH != *"$python_dir"* ]]; then
  export PATH="$python_dir/bin:$PATH"
fi
if [[ $LD_LIBRARY_PATH != *"$python_dir"* ]]; then
  export LD_LIBRARY_PATH="$python_dir/lib:$LD_LIBRARY_PATH"
fi

cd root
./configure linux \
--fail-on-missing \
--enable-builtin-pcre \
--enable-cintex \
--enable-explicitlink \
--enable-gdml \
--enable-genvector \
--enable-krb5 \
--enable-mathmore \
--enable-minuit2 \
--disable-mysql \
--disable-oracle \
--enable-python \
--disable-qt \
--disable-qtgsi \
--enable-reflex \
--enable-roofit \
--enable-table \
--enable-unuran \
--with-cint-maxstruct=36000 \
--with-cint-maxtypedef=36000 \
--with-cint-longline=4096 \
--with-castor-incdir=/afs/cern.ch/sw/lcg/external/castor/2.1.9-9/x86_64-slc5-gcc43-opt/usr/include/shift \
--with-castor-libdir=/afs/cern.ch/sw/lcg/external/castor/2.1.9-9/x86_64-slc5-gcc43-opt/usr/lib64 \
--with-cern-libdir=/afs/cern.ch/sw/lcg/external/cernlib/2006a/x86_64-slc5-gcc43-opt/lib \
--with-dcap-libdir=/afs/cern.ch/sw/lcg/external/dcache_client/2.47.5-0/x86_64-slc5-gcc43-opt/dcap/lib \
--with-dcap-incdir=/afs/cern.ch/sw/lcg/external/dcache_client/2.47.5-0/x86_64-slc5-gcc43-opt/dcap/include \
--with-fftw3-incdir=/afs/cern.ch/sw/lcg/external/fftw3/3.1.2/x86_64-slc5-gcc43-opt/include \
--with-fftw3-libdir=/afs/cern.ch/sw/lcg/external/fftw3/3.1.2/x86_64-slc5-gcc43-opt/lib \
--with-gccxml=/afs/cern.ch/sw/lcg/external/gccxml/0.9.0_20110825/x86_64-slc5-gcc43-opt/bin \
--with-gfal-libdir=/afs/cern.ch/sw/lcg/external/Grid/gfal/1.11.8-2/x86_64-slc5-gcc43-opt/lib \
--with-gfal-incdir=/afs/cern.ch/sw/lcg/external/Grid/gfal/1.11.8-2/x86_64-slc5-gcc43-opt/include \
--with-gsl-incdir=/afs/cern.ch/sw/lcg/external/GSL/1.10/x86_64-slc5-gcc43-opt/include \
--with-gsl-libdir=/afs/cern.ch/sw/lcg/external/GSL/1.10/x86_64-slc5-gcc43-opt/lib \
--with-rfio-incdir=/afs/cern.ch/sw/lcg/external/castor/2.1.9-9/x86_64-slc5-gcc43-opt/usr/include/shift \
--with-rfio-libdir=/afs/cern.ch/sw/lcg/external/castor/2.1.9-9/x86_64-slc5-gcc43-opt/usr/lib64 \
--with-pythia6-libdir=/afs/cern.ch/sw/lcg/external/MCGenerators/pythia6/426.2/x86_64-slc5-gcc43-opt/lib \
--with-pythia8-incdir=/afs/cern.ch/sw/lcg/external/MCGenerators/pythia8/160/x86_64-slc5-gcc43-opt/include \
--with-pythia8-libdir=/afs/cern.ch/sw/lcg/external/MCGenerators/pythia8/160/x86_64-slc5-gcc43-opt/lib \
--with-gviz-incdir=/build/bellenot/libraries/x86_64-slc5-gcc43-opt/graphviz-2.24.0/include/graphviz \
--with-gviz-libdir=/build/bellenot/libraries/x86_64-slc5-gcc43-opt/graphviz-2.24.0/lib \
--with-xrootd=/afs/cern.ch/sw/lcg/external/xrootd/3.1.0p2/x86_64-slc5-gcc43-opt

Concerning the previous post, the castor library dependency manifests itself as,

source root-with-dpm.sh
root -l
root [0] TFile *f = TFile::Open("rfio:/dpm/unige.ch/home/atlas/atlaslocalgroupdisk/user/wbell/mc11_7TeV/user.wbell.mc11_7TeV.105894.AlpgenJimmyttbarlnqqNp0_baseline.merge.NTUP_TOP.e891_s1372_s1370_r3043_r2993_whb004_0001.120315171047/user.wbell.006472.EXT0._00001.NTUP_TOP.root");
dlopen error: libcastorrfio.so.2.1: cannot open shared object file: No such file or directory
Load Error: Failed to load Dynamic link library /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.00/x86_64-slc5-gcc43-opt/root/lib/libRFIO.so
Error in <TCint::AutoLoad>: failure loading library libRFIO.so for class TRFIOFile
Error in <TPluginHandler::SetupCallEnv>: class TRFIOFile not found in plugin RFIO

where root-with-dpm.sh is

# Setup the gcc version. 
source /afs/cern.ch/sw/lcg/external/gcc/4.3.2/x86_64-slc5/setup.sh

# Setup ROOT
rootdir="/afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.00/x86_64-slc5-gcc43-opt/root/"
if [[ $SHELL == *"bash"* ]]; then
  source $rootdir"bin/thisroot.sh"
else # zsh hack
  d=$PWD 
  cd $rootdir
  source bin/thisroot.sh
  cd $d
  unset d
fi
unset rootdir

# 64 bit python for 64 bit ROOT
python_dir="/afs/cern.ch/sw/lcg/external/Python/2.6.5/x86_64-slc5-gcc43-opt"
if [[ $PATH != *"$python_dir"* ]]; then
  export PATH="$python_dir/bin:$PATH"
fi
if [[ $LD_LIBRARY_PATH != *"$python_dir"* ]]; then
  export LD_LIBRARY_PATH="$python_dir/lib:$LD_LIBRARY_PATH"
fi

# setup dq2
echo "source /atlas/software/dpm-test/env-setup.sh"
source /atlas/software/dpm-test/env-setup.sh
export LD_LIBRARY_PATH=/atlas/users/wbell/dpm/3.2.11-1/lib64:$LD_LIBRARY_PATH # for libdpm.so

# check for a valid proxy
echo "voms-proxy-info"
voms-proxy-info

# create a proxy if one does not exist
if [[ $? != 0 ]]; then
  good_proxy=0

  while [[ $good_proxy == 0 ]]; do
    echo "voms-proxy-init -voms atlas -valid 90:00"
    voms-proxy-init -voms atlas -valid 90:00
    if [[ $? == 0 ]]; then
      good_proxy=1
    fi
  done
fi

Best regards,

Will

Hi Will,

On lxplus, I do no see the problem with mysql nor oracle:Checking for mysql_config ... not found Checking for mysql.h ... /afs/cern.ch/sw/lcg/external/mysql/5.5.14/x86_64-slc5-gcc43-opt/include Checking for libmysqlclient_r, libmysqlclient, or mysqlclient ... /afs/cern.ch/sw/lcg/external/mysql/5.5.14/x86_64-slc5-gcc43-opt/lib Checking for occi.h ... /afs/cern.ch/sw/lcg/external/oracle/11.2.0.1.0p3/x86_64-slc5-gcc43-opt/include Checking for libclntsh, or oci ... /afs/cern.ch/sw/lcg/external/oracle/11.2.0.1.0p3/x86_64-slc5-gcc43-opt/lib Checking for libocci, or oraocci10 ... /afs/cern.ch/sw/lcg/external/oracle/11.2.0.1.0p3/x86_64-slc5-gcc43-opt/lib (but I indeed see the issue with QT which is probably not installed at the default location).

Cheers,
Philippe.

Hi,

He’s building linux but providing x86064 libs. That won’t work. Simply don’t specify an arch, or specify the correct one (likely linuxx8664gcc).

Cheers, Axel.

Hi,

Since more of our students are complaining that we’re still stuck with ROOT 5.30 due to the dependency on CASTOR clashing with DPM, I have had another quick look at rebuilding ROOT.

Starting from the latest recommended version, I tried to follow the configuration options used for the AFS build but quickly ran into trouble again. The idea is to: (1) rebuild ROOT using the options root-config --config reports, then (2) switch the CASTOR library for the DPM library.

(1) Rebuilding root:

On a SLC5 machine with all the latest updates

. /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.09/x86_64-slc5-gcc47-opt/root/bin/thisroot.sh
root-config --config

provides the configuration options that should have been used. The only problem is that they do not work, due to a failure concerning Qt.

wget ftp://root.cern.ch/root/root_v5.34.09.source.tar.gz
tar xfz root_v5.34.09.source.tar.gz
cd root
./configure \
--fail-on-missing \
--enable-builtin-pcre \
--enable-cintex \
--enable-explicitlink \
--enable-gdml \
--enable-genvector \
--enable-krb5 \
--enable-mathmore \
--enable-minuit2 \
--enable-mysql \
--enable-oracle \
--enable-python \
--enable-qt \
--enable-qtgsi \
--enable-reflex \
--enable-roofit \
--enable-table \
--enable-unuran \
--with-cint-maxstruct=36000 \
--with-cint-maxtypedef=36000 \
--with-cint-longline=4096 \
--with-castor-incdir=/afs/cern.ch/sw/lcg/external/castor/2.1.13-6/x86_64-slc5-gcc47-opt/usr/include/shift \
--with-castor-libdir=/afs/cern.ch/sw/lcg/external/castor/2.1.13-6/x86_64-slc5-gcc47-opt/usr/lib64 \
--with-cern-libdir=/afs/cern.ch/sw/lcg/external/cernlib/2006a/x86_64-slc5-gcc47-opt/lib \
--with-dcap-libdir=/afs/cern.ch/sw/lcg/external/dcache_client/2.47.5-0/x86_64-slc5-gcc47-opt/dcap/lib \
--with-dcap-incdir=/afs/cern.ch/sw/lcg/external/dcache_client/2.47.5-0/x86_64-slc5-gcc47-opt/dcap/include \
--with-fftw3-incdir=/afs/cern.ch/sw/lcg/external/fftw3/3.1.2/x86_64-slc5-gcc47-opt/include \
--with-fftw3-libdir=/afs/cern.ch/sw/lcg/external/fftw3/3.1.2/x86_64-slc5-gcc47-opt/lib \
--with-gccxml=/afs/cern.ch/sw/lcg/external/gccxml/0.9.0_20120309p2/x86_64-slc5-gcc47-opt/bin \
--with-gfal-libdir=/afs/cern.ch/sw/lcg/external/Grid/gfal/1.13.0-0/x86_64-slc5-gcc47-opt/lib \
--with-gfal-incdir=/afs/cern.ch/sw/lcg/external/Grid/gfal/1.13.0-0/x86_64-slc5-gcc47-opt/include \
--with-gsl-incdir=/afs/cern.ch/sw/lcg/external/GSL/1.10/x86_64-slc5-gcc47-opt/include \
--with-gsl-libdir=/afs/cern.ch/sw/lcg/external/GSL/1.10/x86_64-slc5-gcc47-opt/lib \
--with-mysql-incdir=/afs/cern.ch/sw/lcg/external/mysql/5.5.14/x86_64-slc5-gcc47-opt/include \
--with-mysql-libdir=/afs/cern.ch/sw/lcg/external/mysql/5.5.14/x86_64-slc5-gcc47-opt/lib \
--with-oracle-incdir=/afs/cern.ch/sw/lcg/external/oracle/11.2.0.3.0/x86_64-slc5-gcc47-opt/include \
--with-oracle-libdir=/afs/cern.ch/sw/lcg/external/oracle/11.2.0.3.0/x86_64-slc5-gcc47-opt/lib \
--with-rfio-incdir=/afs/cern.ch/sw/lcg/external/castor/2.1.13-6/x86_64-slc5-gcc47-opt/usr/include/shift \
--with-rfio-libdir=/afs/cern.ch/sw/lcg/external/castor/2.1.13-6/x86_64-slc5-gcc47-opt/usr/lib64 \
--with-pythia6-libdir=/afs/cern.ch/sw/lcg/external/MCGenerators/pythia6/426.2/x86_64-slc5-gcc47-opt/lib \
--with-pythia8-incdir=/afs/cern.ch/sw/lcg/external/MCGenerators/pythia8/160/x86_64-slc5-gcc47-opt/include \
--with-pythia8-libdir=/afs/cern.ch/sw/lcg/external/MCGenerators/pythia8/160/x86_64-slc5-gcc47-opt/lib \
--with-gviz-incdir=/build/bellenot/libraries/x86_64-slc5-gcc47-opt/graphviz-2.24.0/include/graphviz \
--with-gviz-libdir=/build/bellenot/libraries/x86_64-slc5-gcc47-opt/graphviz-2.24.0/lib \
--with-xrootd=/afs/cern.ch/sw/lcg/external/xrootd/3.2.7/x86_64-slc5-gcc47-opt \
--with-srm-ifce-incdir=/afs/cern.ch/sw/lcg/external/Grid/srm-ifce/1.13.0-0/x86_64-slc5-gcc47-opt/include

returns

Checking for Qt/qglobal.h ... no
Checking for moc or moc.exe ... no
Explicitly required Qt dependencies not fulfilled

Explicitly adding the path to the Qt include directory

--with-qt-incdir=/usr/lib64/qt-3.3/include \
--with-qt-libdir=/usr/lib64

will not work either since qglobal.h is in /usr/lib/qt-3.3/include/. This is not the same place as a Debian Wheezy installation, but is the standard place for RHEL5:

[wbell@lxplus412 ~]$ rpm -qf /usr/lib/qt-3.3/include/qglobal.h
qt-devel-3.3.6-26.el5

Please can someone involved in building /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.09/x86_64-slc5-gcc47-opt tell me the solution to this problem? Perhaps the configure script should check for qglobal.h as well as Qt/qglobal.h?

Thanks and best regards,

Will

Hi Will,

I think Qt3 is not supported anymore… Could you try with Qt4?
For example, the binaries on afs use Qt from: /afs/cern.ch/sw/lcg/external/qt/4.8.4

Cheers, Bertrand.

Hi Bertrand,

Using the AFS based Qt4 does indeed fix the configuration error. I added

--with-qt-incdir=/afs/cern.ch/sw/lcg/external/qt/4.8.4/x86_64-slc5-gcc47-opt/include \
--with-qt-libdir=/afs/cern.ch/sw/lcg/external/qt/4.8.4/x86_64-slc5-gcc47-opt/lib/

to the list of configuration options.

Why does root-config --config for the SLC5 AFS install not report these lines in the list of configuration options? Was a cross-compiling setup used with an SLC6 machine?

Thanks and best regards,

Will

Hi Will,

[quote=“wbell”]Why does
root-config --config
for the SLC5 AFS install not report these lines in the list of configuration options? Was a cross-compiling setup used with an SLC6 machine?[/quote]No, but the QTDIR environment variable was used instead (i.e. not using the --with-qt-incdir and --with-qt-libdir configuration options)

Cheers, Bertrand.

Hi,

Following the discussion on this thread, I have now managed to build ROOT 5.34 with DPM and successfully access files on the DPM. The build script was

# Setup the gcc version. 
source /afs/cern.ch/sw/lcg/external/gcc/4.7.2/x86_64-slc5-gcc47-opt/setup.sh

# 64 bit python for 64 bit ROOT
python_dir="/afs/cern.ch/sw/lcg/external/Python/2.7.3/x86_64-slc5-gcc47-opt"
if [[ $PATH != *"$python_dir"* ]]; then
  export PATH="$python_dir/bin:$PATH"
fi
if [[ *"$LD_LIBRARY_PATH"* != $python_dir ]]; then
  export LD_LIBRARY_PATH="$python_dir/lib:$LD_LIBRARY_PATH"
fi

# Build ROOT
source_file="ftp://root.cern.ch/root/root_v5.34.09.source.tar.gz"
tar_file=$(basename $source_file)

if [[ ! -f $tar_file ]]; then
  wget $source_file
fi
if [[ ! -d root ]]; then
  echo ">> Unpacking"
  tar xvfz $tar_file &> unpack.log
fi

prefix="/local-nfs-area/root/5.34.09/x86_64-slc5-gcc47-opt"

cd root
echo ">> Configuring"
./configure \
--fail-on-missing \
--enable-builtin-pcre \
--enable-cintex \
--enable-explicitlink \
--enable-gdml \
--enable-genvector \
--enable-krb5 \
--enable-mathmore \
--enable-minuit2 \
--enable-mysql \
--enable-oracle \
--enable-python \
--enable-qt \
--enable-qtgsi \
--enable-reflex \
--enable-roofit \
--enable-table \
--enable-unuran \
--with-cint-maxstruct=36000 \
--with-cint-maxtypedef=36000 \
--with-cint-longline=4096 \
--with-cern-libdir=/afs/cern.ch/sw/lcg/external/cernlib/2006a/x86_64-slc5-gcc47-opt/lib \
--with-dcap-libdir=/afs/cern.ch/sw/lcg/external/dcache_client/2.47.5-0/x86_64-slc5-gcc47-opt/dcap/lib \
--with-dcap-incdir=/afs/cern.ch/sw/lcg/external/dcache_client/2.47.5-0/x86_64-slc5-gcc47-opt/dcap/include \
--with-fftw3-incdir=/afs/cern.ch/sw/lcg/external/fftw3/3.1.2/x86_64-slc5-gcc47-opt/include \
--with-fftw3-libdir=/afs/cern.ch/sw/lcg/external/fftw3/3.1.2/x86_64-slc5-gcc47-opt/lib \
--with-gccxml=/afs/cern.ch/sw/lcg/external/gccxml/0.9.0_20120309p2/x86_64-slc5-gcc47-opt/bin \
--with-gfal-libdir=/afs/cern.ch/sw/lcg/external/Grid/gfal/1.13.0-0/x86_64-slc5-gcc47-opt/lib \
--with-gfal-incdir=/afs/cern.ch/sw/lcg/external/Grid/gfal/1.13.0-0/x86_64-slc5-gcc47-opt/include \
--with-gsl-incdir=/afs/cern.ch/sw/lcg/external/GSL/1.10/x86_64-slc5-gcc47-opt/include \
--with-gsl-libdir=/afs/cern.ch/sw/lcg/external/GSL/1.10/x86_64-slc5-gcc47-opt/lib \
--with-mysql-incdir=/afs/cern.ch/sw/lcg/external/mysql/5.5.14/x86_64-slc5-gcc47-opt/include \
--with-mysql-libdir=/afs/cern.ch/sw/lcg/external/mysql/5.5.14/x86_64-slc5-gcc47-opt/lib \
--with-oracle-incdir=/afs/cern.ch/sw/lcg/external/oracle/11.2.0.3.0/x86_64-slc5-gcc47-opt/include \
--with-oracle-libdir=/afs/cern.ch/sw/lcg/external/oracle/11.2.0.3.0/x86_64-slc5-gcc47-opt/lib \
--with-rfio-incdir=/afs/cern.ch/project/gd/LCG-share/3.2.11-1/lcg/include/dpm \
--with-rfio-libdir=/afs/cern.ch/project/gd/LCG-share/3.2.11-1/lcg/lib64 \
--with-pythia6-libdir=/afs/cern.ch/sw/lcg/external/MCGenerators/pythia6/426.2/x86_64-slc5-gcc47-opt/lib \
--with-pythia8-incdir=/afs/cern.ch/sw/lcg/external/MCGenerators/pythia8/160/x86_64-slc5-gcc47-opt/include \
--with-pythia8-libdir=/afs/cern.ch/sw/lcg/external/MCGenerators/pythia8/160/x86_64-slc5-gcc47-opt/lib \
--with-gviz-incdir=/build/bellenot/libraries/x86_64-slc5-gcc47-opt/graphviz-2.24.0/include/graphviz \
--with-gviz-libdir=/build/bellenot/libraries/x86_64-slc5-gcc47-opt/graphviz-2.24.0/lib \
--with-xrootd=/afs/cern.ch/sw/lcg/external/xrootd/3.2.7/x86_64-slc5-gcc47-opt \
--with-srm-ifce-incdir=/afs/cern.ch/sw/lcg/external/Grid/srm-ifce/1.13.0-0/x86_64-slc5-gcc47-opt/include \
--with-qt-incdir=/afs/cern.ch/sw/lcg/external/qt/4.8.4/x86_64-slc5-gcc47-opt/include \
--with-qt-libdir=/afs/cern.ch/sw/lcg/external/qt/4.8.4/x86_64-slc5-gcc47-opt/lib \
--prefix="$prefix" \
--datadir="$prefix" \
--bindir="$prefix/bin" \
--libdir="$prefix/lib" \
--incdir="$prefix/include" \
--etcdir="$prefix/etc" \
--docdir="$prefix" &> configure.log
if [[ $? != 0 ]]; then
  exit 1
fi
echo ">> Building"
make -j64 &> build.log
make install &> install.log
echo ">> Finished"

Regards,

Will