-
Notifications
You must be signed in to change notification settings - Fork 161
/
epos4.sh
70 lines (64 loc) · 1.8 KB
/
epos4.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
package: EPOS4
version: "%(tag_basename)s"
tag: "v4.0.0-alice3"
source: https://github.com/alisw/EPOS4.git
requires:
- ROOT
- fastjet
---
#!/bin/bash -ex
export EPO4VSN=${PKGVERSION}
# The following two variables *must* have a trailing slash! EPOS installation
# will make a mess otherwise.
export EPO4=$PWD/
export LIBDIR=${EPO4}bin
export CC=gcc
export CXX=g++
export FC=gfortran
export FASTSYS=${FASTJET}
export COP=BASIC
rsync -a --exclude='**/.git' --delete ${SOURCEDIR}/ .
export LIBRARY_PATH="$LD_LIBRARY_PATH"
cmake -B$LIBDIR
make -C$LIBDIR -j8
# "Install"
INST_SUBROOT=$INSTALLROOT/epos4
mkdir -p $INST_SUBROOT
rsync -a \
--exclude='**/CMakeModules' \
--exclude=CMakeLists.txt \
--exclude='**/.git' \
--exclude=*.h \
--exclude=*.c \
--exclude=*.cpp \
--exclude=*.f \
./ $INST_SUBROOT/
chmod u+x $INST_SUBROOT/scripts/epos
find $INSTALLROOT -type d -empty -exec rmdir '{}' \; > /dev/null 2>&1 || true
[ -d "$INST_SUBROOT" ]
# 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 EPOS4_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
setenv EPOS4_ROOT \$EPOS4_ROOT
setenv EPO4VSN 4.0.0
# Final slash is required by EPOS, please leave it be
setenv EPO4 \$::env(EPOS4_ROOT)/epos4/
prepend-path PATH \$::env(EPO4)bin
setenv LIBDIR \$::env(EPO4)bin
setenv OPT ./
setenv HTO ./
setenv CHK ./
EoF