forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rivet.sh
72 lines (67 loc) · 2.51 KB
/
rivet.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package: Rivet
version: "2.2.1"
requires:
- GSL
- YODA
- fastjet
- HepMC
- boost
prepend_path:
PYTHONPATH: $RIVET_ROOT/lib/python2.7/site-packages
---
#!/bin/bash -e
case $ARCHITECTURE in
osx*)
# If we preferred system tools, we need to make sure we can pick them up.
[[ ! $GSL_ROOT ]] && GSL_ROOT=`brew --prefix gsl`
;;
*)
ARCH_LDFLAGS="-Wl,--no-as-needed"
;;
esac
Url="http://www.hepforge.org/archive/rivet/Rivet-${PKGVERSION}.tar.bz2"
curl -Lo rivet.tar.bz2 "$Url"
tar xjf rivet.tar.bz2
cd Rivet-$PKGVERSION
# MPFR and GMP are compiled statically, however in some cases there might be
# some "-lgmp" left somewhere and we have to deal with it with the correct path.
# Boost flags are also necessary
export LDFLAGS="$ARCH_LDFLAGS -L${MPFR_ROOT}/lib -L${GMP_ROOT}/lib -L${CGAL_ROOT}/lib -lCGAL"
export LIBRARY_PATH="$LD_LIBRARY_PATH"
export CXXFLAGS="-I${MPFR_ROOT}/include -I${GMP_ROOT}/include -I${CGAL_ROOT}/include -DCGAL_DO_NOT_USE_MPZF -O2 -g"
if [[ "$BOOST_ROOT" != '' ]]; then
export LDFLAGS="$LDFLAGS -L$BOOST_ROOT/lib"
export CXXFLAGS="-I$BOOST_ROOT/include"
fi
export LDFLAGS="$LDFLAGS -lboost_thread -lboost_system"
./configure \
--prefix="$INSTALLROOT" \
--disable-doxygen \
--with-yoda="$YODA_ROOT" \
${GSL_ROOT:+--with-gsl="$GSL_ROOT"} \
--with-hepmc="$HEPMC_ROOT" \
--with-fastjet="$FASTJET_ROOT" \
${BOOST_ROOT:+--with-boost="$BOOST_ROOT"}
make -j$JOBS
make install -j$JOBS
# Modulefile
MODULEDIR="$INSTALLROOT/etc/modulefiles"
MODULEFILE="$MODULEDIR/$PKGNAME"
mkdir -p "$MODULEDIR"
cat > "$MODULEFILE" <<EoF
#%Module1.0
proc ModulesHelp { } {
global version
puts stderr "ALICE Modulefile for $PKGNAME $PKGVERSION-@@PKGREVISION@$PKGHASH@@"
}
set version $PKGVERSION-@@PKGREVISION@$PKGHASH@@
module-whatis "ALICE Modulefile for $PKGNAME $PKGVERSION-@@PKGREVISION@$PKGHASH@@"
# Dependencies
module load BASE/1.0 ${GSL_VERSION:+GSL/$GSL_VERSION-$GSL_REVISION} YODA/$YODA_VERSION-$YODA_REVISION fastjet/$FASTJET_VERSION-$FASTJET_REVISION HepMC/$HEPMC_VERSION-$HEPMC_REVISION ${BOOST_ROOT:+boost/$BOOST_VERSION-$BOOST_REVISION}
# Our environment
setenv RIVET_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
prepend-path PYTHONPATH \$::env(RIVET_ROOT)/lib/python2.7/site-packages
prepend-path PATH \$::env(RIVET_ROOT)/bin
prepend-path LD_LIBRARY_PATH \$::env(RIVET_ROOT)/lib
$([[ ${ARCHITECTURE:0:3} == osx ]] && echo "prepend-path DYLD_LIBRARY_PATH \$::env(RIVET_ROOT)/lib")
EoF