forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pythia.sh
57 lines (53 loc) · 1.91 KB
/
pythia.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
package: pythia
version: "%(tag_basename)s"
source: https://github.com/alisw/pythia8
requires:
- lhapdf
- HepMC
- boost
tag: alice/v8211pre
env:
PYTHIA8DATA: "$PYTHIA_ROOT/share/Pythia8/xmldoc"
---
#!/bin/bash -e
rsync -a $SOURCEDIR/ ./
case $ARCHITECTURE in
osx*)
# If we preferred system tools, we need to make sure we can pick them up.
[[ ! $BOOST_ROOT ]] && BOOST_ROOT=`brew --prefix boost`
;;
esac
./configure --prefix=$INSTALLROOT \
--enable-shared \
--with-hepmc2=${HEPMC_ROOT} \
--with-lhapdf6=${LHAPDF_ROOT} \
${BOOST_ROOT:+--with-boost="$BOOST_ROOT"}
if [[ $ARCHITECTURE =~ "slc5.*" ]]; then
ln -s LHAPDF5.h include/Pythia8Plugins/LHAPDF5.cc
ln -s LHAPDF6.h include/Pythia8Plugins/LHAPDF6.cc
sed -i -e 's#\$(CXX) -x c++ \$< -o \$@ -c -MD -w -I\$(LHAPDF\$\*_INCLUDE) \$(CXX_COMMON)#\$(CXX) -x c++ \$(<:.h=.cc) -o \$@ -c -MD -w -I\$(LHAPDF\$\*_INCLUDE) \$(CXX_COMMON)#' Makefile
fi
make ${JOBS+-j $JOBS}
make install
chmod a+x $INSTALLROOT/bin/pythia8-config
# 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 lhapdf/$LHAPDF_VERSION-$LHAPDF_REVISION ${BOOST_ROOT:+boost/$BOOST_VERSION-$BOOST_REVISION} HepMC/$HEPMC_VERSION-$HEPMC_REVISION
# Our environment
setenv PYTHIA_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
setenv PYTHIA8DATA \$::env(PYTHIA_ROOT)/share/Pythia8/xmldoc
prepend-path PATH \$::env(PYTHIA_ROOT)/bin
prepend-path LD_LIBRARY_PATH \$::env(PYTHIA_ROOT)/lib
$([[ ${ARCHITECTURE:0:3} == osx ]] && echo "prepend-path DYLD_LIBRARY_PATH \$::env(PYTHIA_ROOT)/lib")
EoF