4 # A script to build ROOT (adapted from R.Hatcher's build_pythia6.sh)
6 # Usage: ./build_root.sh [version]
7 # [--arch=linux|linuxx8664gcc|macosx|...]
9 # [--with-pythia6-version=...]
10 # [--with-gsl-version=...]
12 # Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
19 while [ $# -gt 0 ] ; do
37 major=`awk -v str=$version 'BEGIN {split(str, tk, "."); print tk[1]}'`
38 minor=`awk -v str=$version 'BEGIN {split(str, tk, "."); print tk[2]}'`
39 revis=`awk -v str=$version 'BEGIN {split(str, tk, "."); print tk[3]}'`
41 topdir=`pwd`/v${major}_${minor}_${revis}
43 echo version $version major $major minor $minor revision $revis
46 if [ ! -d ${topdir} ] ; then
50 for subdir in include lib download ; do
51 if [ ! -d ${subdir} ] ; then
59 # wget or curl for retreiving remote files?
60 # (OS X doesn't generally have wget on it, so fall back on curl in that case)
62 whichfetchit=`which wget | grep -v "no wget in"`
63 if [ ! -z "${whichfetchit}" ] ; then
64 echo use \"wget\" for fetching files
67 whichfetchit=`which curl | grep -v "no curl in"`
68 if [ ! -z "${whichfetchit}" ] ; then
69 # -f = fail without creating dummy, -O output local named like remoteza
70 echo use \"curl -f -O\" for fetching files
73 echo "Neither wget nor curl available -- can't download files"
78 echo "$fetchit http://root.cern.ch/root/root_v${major}.${minor}.${revis}.source.tar.gz"
79 $fetchit http://root.cern.ch/root/root_v${major}.${minor}.${revis}.source.tar.gz
81 tar xzvf http://root.cern.ch/root/root_v${major}.${minor}.${revis}.source.tar.gz
87 export PATH=$ROOTSYS/bin:$PATH
88 export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH
90 ./configure $arch --enable-pythia6 --enable-mathmore --with-gsl-incdir= --with-gsl-libdir= --with-pythia6-libdir=