forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
epos.sh
66 lines (60 loc) · 1.82 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
package: EPOS
version: "%(tag_basename)s"
tag: "v3.111-alice1"
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
export LDFLAGS="-Wl,--no-as-needed -L${MPFR_ROOT}/lib -L${GMP_ROOT}/lib -L${CGAL_ROOT}/lib"
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
setenv EPOS_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
prepend-path PATH $::env(EPOS_ROOT)/bin
setenv EPOVSN ${EPOVSN}
# Final slash is required by EPOS, please leave it be
setenv EPO $::env(EPOS_ROOT)/epos/
EoF