Page MenuHomeHEPForge

rivet-bootstrap
No OneTemporary

rivet-bootstrap

#! /usr/bin/env bash
## Build and install to the PREFIX location
PREFIX=$PWD/local
test $# -eq 1 && PREFIX=$1
if test -z "$(echo $PREFIX | egrep '^/')"; then
PREFIX=$PWD/$PREFIX
fi
mkdir -p $PREFIX
if ! test -w "$PREFIX"; then
echo "Can't write to installation directory, $PREFIX" 1>&2
echo "Exiting..." 1>&2
exit 1
fi
## Function to unpack and delete a tarball
wget-untargz() {
## Try first using wget, and falling back to trying curl (for Mac)
WGETTER="wget --quiet -O-"
if test ! -x "`which wget 2> /dev/null`"; then
WGETTER="curl --silent"
if test ! -x "`which curl 2> /dev/null`"; then
echo "You need curl or wget to download the $tarname tarball" 1>&2
exit 1
fi
fi
## Use whichever was present
$WGETTER $1 | tar xzv
}
## Function to enter an expanded tarball and run the usual
## autotools ./configure, make, make install mantra
conf-mk-mkinst() {
if test -d $1; then
(cd $1 && echo "./configure --prefix=$PREFIX" && \
./configure --prefix=$PREFIX --enable-shared && \
make && make install)
else
echo "Couldn't find $1... exiting"
exit 1
fi
}
##############################
## If we've got SVN and there are no already-checked out versions
## of AGILe and Rivet in this directory, then check out/update
## the SVN head versions using the HTTP access method
if test -x "`which svn 2> /dev/null`"; then
if test -d agile; then (cd agile; svn up); else svn co http://svn.hepforge.org/agile/trunk agile; fi
if test -d rivet; then (cd rivet; svn up); else svn co http://svn.hepforge.org/rivet/trunk rivet; fi
else
echo "Couldn't get AGILe and rivet via svn" 1>&2
exit 1
fi
LHAPDF_VERSION=5.3.0
FASTJET_VERSION=2.3.0
HEPMC_VERSION=2.03.04
## AFS directory where LCG external packages are installed
LCGDIR=/afs/cern.ch/sw/lcg/external
## Are we able to use pre-built packages from CERN AFS?
if test -d "$LCGDIR"; then
echo "LCG AFS area available: using LCG packages"
## TODO: calculate platform tag
LCGPLATFORM=slc4_amd64_gcc34
echo "Using LCG platform tag = $LCGPLATFORM"
## First AGILe
echo "Building AGILe"
cd agile
echo "In $PWD"
autoreconf -i
./configure --prefix=$PREFIX --with-hepmc=$LCGDIR/HepMC/$HEPMC_VERSION/$LCGPLATFORM
make && make install
cd ..
## Then Rivet + rivetgun
echo "In $PWD"
echo "Building Rivet"
cd rivet
echo "In $PWD"
./configure --prefix=$PREFIX \
--with-hepmc=$LCGDIR/HepMC/$HEPMC_VERSION/$LCGPLATFORM \
--with-fastjet=$LCGDIR/fastjet/$FASTJET_VERSION/$LCGPLATFORM \
--with-agile=$PREFIX
make && make install
cd ..
echo "In $PWD"
echo
echo "All done. Now set some variables:"
echo "export PATH=$PREFIX/bin:\$PATH"
echo "export LD_LIBRARY_PATH=$PREFIX/lib:\$LD_LIBRARY_PATH"
echo "export AGILE_GEN_PATH=$LCGDIR/MCGenerators/.liblinks/$LCGPLATFORM"
else
## We don't have access to LCG AFS, so download the packages...
## Get LHAPDF
LHAPDFNAME=lhapdf-$LHAPDF_VERSION
test -d $LHAPDFNAME || wget-untargz http://www.hepforge.org/archive/lhapdf/$LHAPDFNAME.tar.gz
conf-mk-mkinst $LHAPDFNAME
## Get HepMC
HEPMCNAME=HepMC-$HEPMC_VERSION
test -d $HEPMCNAME || wget-untargz http://lcgapp.cern.ch/project/simu/HepMC/download/$HEPMCNAME.tar.gz
conf-mk-mkinst $HEPMCNAME
## Get FastJet
FASTJETNAME=fastjet-$FASTJET_VERSION
test -d $FASTJETNAME || wget-untargz http://www.lpthe.jussieu.fr/~salam/repository/software/fastjet/$FASTJETNAME.tar.gz
conf-mk-mkinst $FASTJETNAME
## Build and install AGILe
if test -d agile; then
(cd agile && autoreconf -i)
conf-mk-mkinst agile
else
echo "AGILe build directory is not available"
fi
## Build and install Rivet
if test -d rivet; then
(cd rivet && autoreconf -i)
conf-mk-mkinst rivet
else
echo "Rivet build directory is not available"
fi
fi

File Metadata

Mime Type
text/plain
Expires
Wed, May 14, 11:18 AM (14 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5099003
Default Alt Text
rivet-bootstrap (3 KB)

Event Timeline