Ticket #15: build.sh
File build.sh, 2.2 KB (added by , 16 years ago) |
---|
Line | |
---|---|
1 | #!/bin/bash |
2 | |
3 | SHERPA_VERSION=1.1.2 |
4 | |
5 | LHAPDF_VERSION=5.4.0 |
6 | |
7 | curdir=`pwd` |
8 | |
9 | wget --no-check-certificate https://www.hepforge.org/archive/sherpa/Sherpa-beta.1.1.2.tar.gz |
10 | |
11 | SRC_TGZ=$curdir/Sherpa-beta.1.1.2.tar.gz |
12 | |
13 | # |
14 | if test "x$FC" = "x" ; then export FC=`which g77` ; fi |
15 | if test "x$CFLAGS" = "x" ; then export CFLAGS="-g -O0 -fPIC " ; fi |
16 | if test "x$CXXFLAGS" = "x" ; then export CXXFLAGS="-g -O0 -fPIC " ; fi |
17 | if test "x$FFLAGS" = "x" ; then export FFLAGS="-g -O0 -fPIC " ; fi |
18 | |
19 | if test "x$LCG_PLATFORM" = "x" ; then |
20 | LCG_PLATFORM=slc4_ia32_gcc34 |
21 | fi |
22 | # |
23 | INSTALL_DIR=$curdir/${SHERPA_VERSION}-lhapdf-${LHAPDF_VERSION}/$LCG_PLATFORM |
24 | |
25 | BUILD_DIR=$curdir/build-${SHERPA_VERSION}-lhapdf-${LHAPDF_VERSION} |
26 | |
27 | # |
28 | CERN_EXTERNAL=/afs/cern.ch/sw/lcg/external |
29 | |
30 | CLHEP_VERSION=2.0.3.3 |
31 | HEPMC_VERSION=2.04.00 |
32 | ROOT_VERSION=5.19.04 |
33 | |
34 | CLHEP_INSTALL_DIR=${CERN_EXTERNAL}/clhep/${CLHEP_VERSION}/${LCG_PLATFORM} |
35 | HEPMC_INSTALL_DIR=${CERN_EXTERNAL}/HepMC/${HEPMC_VERSION}/${LCG_PLATFORM} |
36 | |
37 | if 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 |
47 | fi |
48 | |
49 | ROOTSYS=${CERN_EXTERNAL}/root/${ROOT_VERSION}/${LCG_PLATFORM}/root |
50 | |
51 | export LD_LIBRARY_PATH=${ROOTSYS}/lib |
52 | # |
53 | |
54 | mkdir -p $BUILD_DIR ; rm -fr $BUILD_DIR/* |
55 | |
56 | cd $BUILD_DIR && \ |
57 | tar zxf $SRC_TGZ && \ |
58 | cd SHERPA-MC-${SHERPA_VERSION} || exit |
59 | # |
60 | |
61 | CONFIGURE_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}" |
62 | if test "x$LHAPDF_VERSION" != "xnull" ; then |
63 | CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-lhapdf=${LHAPDF_INSTALL_DIR} " |
64 | fi |
65 | |
66 | rm -f ./configure libtool |
67 | |
68 | autoreconf --install --force && \ |
69 | ./configure ${CONFIGURE_ARGS} && \ |
70 | make && \ |
71 | make install |
72 | |
73 | exit |