-
Notifications
You must be signed in to change notification settings - Fork 161
/
epos.sh
74 lines (68 loc) · 2.01 KB
/
epos.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
73
74
package: EPOS
version: "%(tag_basename)s"
tag: "v3.111-alice5"
source: https://gitlab.cern.ch/ALICEPrivateExternals/epos.git
requires:
- ROOT
- fastjet
env:
EPOVSN: "${EPOS_VERSION/./}"
EPO: "${EPOS_ROOT}/epos/"
---
#!/bin/bash -ex
export EPOVSN=${PKGVERSION/./}
# The following two variables *must* have a trailing slash! EPOS installation
# will make a mess otherwise.
export EPO=$PWD/
export OBJ=$EPO/Unu/Lib/
rsync -a --exclude='**/.git' --delete ${SOURCEDIR}/ .
mkdir $OBJ
case $ARCHITECTURE in
osx*)
export LDFLAGS="-Wl,-undefined dynamic_lookup -L${MPFR_ROOT}/lib -L${GMP_ROOT}/lib -L${CGAL_ROOT}/lib"
;;
*)
export LDFLAGS="-Wl,--no-as-needed -L${MPFR_ROOT}/lib -L${GMP_ROOT}/lib -L${CGAL_ROOT}/lib"
;;
esac
export LIBRARY_PATH="$LD_LIBRARY_PATH"
make LFLAGS="$LDFLAGS"
# "Install"
INST_SUBROOT=$INSTALLROOT/epos
mkdir -p $INST_SUBROOT \
$INSTALLROOT/bin
rsync -a \
--exclude='**/bin' \
--exclude='**/.git' \
--exclude=*.f \
--exclude=*.o \
--exclude=*.h \
--exclude=*.c \
--exclude=*.cpp \
--exclude=Makefile \
./ $INST_SUBROOT/
rsync -a bin/ $INSTALLROOT/bin/
find $INSTALLROOT -type d -empty -exec rmdir '{}' \; > /dev/null 2>&1 || true
[ -d "$INST_SUBROOT/Unu/Lib/epos$EPOVSN" ]
# 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 ROOT/$ROOT_VERSION-$ROOT_REVISION fastjet/$FASTJET_VERSION-$FASTJET_REVISION
# Our environment
set EPOS_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
setenv EPOS_ROOT \$EPOS_ROOT
prepend-path PATH \$EPOS_ROOT/bin
setenv EPOVSN ${EPOVSN}
# Final slash is required by EPOS, please leave it be
setenv EPO $::env(EPOS_ROOT)/epos/
EoF