sherpa is hosted by Hepforge, IPPP Durham
close Warning: Can't synchronize with repository "(default)" (/hepforge/svn/sherpa does not appear to be a Subversion repository.). Look in the Trac log for more information.

Ticket #15: build.sh

File build.sh, 2.2 KB (added by Oleg.Zenin@cern.ch, 16 years ago)

Build script

Line 
1#!/bin/bash
2
3SHERPA_VERSION=1.1.2
4
5LHAPDF_VERSION=5.4.0
6
7curdir=`pwd`
8
9wget --no-check-certificate https://www.hepforge.org/archive/sherpa/Sherpa-beta.1.1.2.tar.gz
10
11SRC_TGZ=$curdir/Sherpa-beta.1.1.2.tar.gz
12
13#
14if test "x$FC" = "x"       ; then export FC=`which g77`           ; fi
15if test "x$CFLAGS" = "x"   ; then export CFLAGS="-g -O0 -fPIC "   ; fi
16if test "x$CXXFLAGS" = "x" ; then export CXXFLAGS="-g -O0 -fPIC " ; fi
17if test "x$FFLAGS" = "x"   ; then export FFLAGS="-g -O0 -fPIC "   ; fi
18
19if test "x$LCG_PLATFORM" = "x" ; then
20        LCG_PLATFORM=slc4_ia32_gcc34
21fi
22#
23INSTALL_DIR=$curdir/${SHERPA_VERSION}-lhapdf-${LHAPDF_VERSION}/$LCG_PLATFORM
24
25BUILD_DIR=$curdir/build-${SHERPA_VERSION}-lhapdf-${LHAPDF_VERSION}
26
27#
28CERN_EXTERNAL=/afs/cern.ch/sw/lcg/external
29
30CLHEP_VERSION=2.0.3.3
31HEPMC_VERSION=2.04.00
32ROOT_VERSION=5.19.04
33
34CLHEP_INSTALL_DIR=${CERN_EXTERNAL}/clhep/${CLHEP_VERSION}/${LCG_PLATFORM}
35HEPMC_INSTALL_DIR=${CERN_EXTERNAL}/HepMC/${HEPMC_VERSION}/${LCG_PLATFORM}
36
37if test "x$LHAPDF_VERSION" != "xnull" ; then
38        if test "x$LHAPDF_INSTALL_DIR" = "x" ; then
39                # Can't be compiled with gcc3 against lhapdf 5.4.0 installed on /afs/cern.ch due to
40                # #include "LHAPDF/FortranWrappers.h" directive in LHAPDFfw.h:
41                #
42                #LHAPDF_INSTALL_DIR=${CERN_EXTERNAL}/MCGenerators/lhapdf/${LHAPDF_VERSION}/${LCG_PLATFORM}
43                #
44                # I used a corrected LHAPDF 5.4.0 installation:
45                LHAPDF_INSTALL_DIR=/afs/.cern.ch/sw/lcg/external/MCGenerators/.work/external/MCGenerators/lhapdf/${LHAPDF_VERSION}/${LCG_PLATFORM}
46        fi
47fi
48
49ROOTSYS=${CERN_EXTERNAL}/root/${ROOT_VERSION}/${LCG_PLATFORM}/root
50
51export LD_LIBRARY_PATH=${ROOTSYS}/lib
52#
53
54mkdir -p $BUILD_DIR ; rm -fr $BUILD_DIR/*
55
56cd $BUILD_DIR    && \
57tar zxf $SRC_TGZ && \
58cd SHERPA-MC-${SHERPA_VERSION} || exit
59#
60
61CONFIGURE_ARGS="--prefix=${INSTALL_DIR} --datadir=${INSTALL_DIR}/../share --enable-shared --enable-static --enable-hepmc2=${HEPMC_INSTALL_DIR} --enable-clhep=${CLHEP_INSTALL_DIR} --enable-root=${ROOTSYS}"
62if test "x$LHAPDF_VERSION" != "xnull" ; then
63        CONFIGURE_ARGS="$CONFIGURE_ARGS  --enable-lhapdf=${LHAPDF_INSTALL_DIR} "
64fi
65
66rm -f ./configure libtool
67
68autoreconf --install --force  && \
69./configure ${CONFIGURE_ARGS} && \
70make                          && \
71make install
72       
73exit