forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
agile.sh
56 lines (52 loc) · 1.68 KB
/
agile.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
package: AGILe
version: "%(tag_basename)s%(defaults_upper)s"
tag: "v1.4.1-alice1"
source: https://github.com/alisw/AGILe.git
requires:
- "GCC-Toolchain:(?!osx)"
- boost
- lhapdf5
- HepMC
- Python
build_requires:
- autotools
---
#!/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
rsync -a --delete --exclude '**/.git' $SOURCEDIR/ ./
autoreconf -ifv
./configure \
${BOOST_ROOT:+--with-boost="$BOOST_ROOT"} \
--with-hepmc="$HEPMC_ROOT" \
--prefix="$INSTALLROOT"
make -j$JOBS
make install
# 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 HepMC/$HEPMC_VERSION-$HEPMC_REVISION lhapdf5/${LHAPDF5_VERSION}-${LHAPDF5_REVISION} ${BOOST_ROOT:+boost/$BOOST_VERSION-$BOOST_REVISION} ${PYTHON_VERSION:+Python/$PYTHON_VERSION-$PYTHON_REVISION}
# Our environment
setenv AGILE_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
prepend-path PYTHONPATH \$::env(AGILE_ROOT)/lib/python2.7/site-packages
prepend-path PATH \$::env(AGILE_ROOT)/bin
prepend-path LD_LIBRARY_PATH \$::env(AGILE_ROOT)/lib
$([[ ${ARCHITECTURE:0:3} == osx ]] && echo "prepend-path DYLD_LIBRARY_PATH \$::env(AGILE_ROOT)/lib")
EoF