forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
alo.sh
65 lines (60 loc) · 2.52 KB
/
alo.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
package: alo
version: "%(commit_hash)s"
tag: master
requires:
- googlebenchmark
- AliRoot
- O2
- RapidJSON
build_requires:
- CMake
- ms_gsl
source: https://github.com/mrrtf/alo
incremental_recipe: |
make ${JOBS:+-j$JOBS} install
mkdir -p $INSTALLROOT/etc/modulefiles && rsync -a --delete etc/modulefiles/ $INSTALLROOT/etc/modulefiles
# install the compilation database so that we can post-check the code
cp ${BUILDDIR}/compile_commands.json ${INSTALLROOT}
DEVEL_SOURCES="$(readlink $SOURCEDIR || echo $SOURCEDIR)"
# This really means we are in development mode. We need to make sure we
# use the real path for sources in this case. We also copy the
# compile_commands.json file so that IDEs can make use of it directly, this
# is a departure from our "no changes in sourcecode" policy, but for a good reason
# and in any case the file is in gitignore.
if [[ "$DEVEL_SOURCES" != "$SOURCEDIR" ]]; then
perl -p -i -e "s|$SOURCEDIR|$DEVEL_SOURCES|" compile_commands.json
ln -sf $BUILDDIR/compile_commands.json $DEVEL_SOURCES/compile_commands.json
fi
---
#!/bin/bash
echo "Build MRRTF alo"
cmake $SOURCEDIR \
-DCMAKE_INSTALL_PREFIX="$INSTALLROOT" \
-DALIROOT="$ALIROOT_ROOT" \
-DO2="$O2_ROOT" \
-DROOTSYS="$ROOT_ROOT" \
-DRAPIDJSON_INCLUDEDIR="$RAPIDJSON_ROOT/include" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
-DMS_GSL_INCLUDE_DIR=$MS_GSL_ROOT/include \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
${CMAKE_BUILD_TYPE:+-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE}
make ${JOBS+-j $JOBS} install
# Modulefile
mkdir -p etc/modulefiles
cat > etc/modulefiles/$PKGNAME <<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 FairRoot/$FAIRROOT_VERSION-$FAIRROOT_REVISION ${DDS_ROOT:+DDS/$DDS_VERSION-$DDS_REVISION} ${GCC_TOOLCHAIN_ROOT:+GCC-Toolchain/$GCC_TOOLCHAIN_VERSION-$GCC_TOOLCHAIN_REVISION} ${VC_VERSION:+Vc/$VC_VERSION-$VC_REVISION} ${ALIROOT_VERSION:+AliRoot/$ALIROOT_VERSION-$ALIROOT_REVISION}
# Our environment
setenv ALO_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
prepend-path PATH \$::env(ALO_ROOT)/bin
prepend-path LD_LIBRARY_PATH \$::env(ALO_ROOT)/lib
$([[ ${ARCHITECTURE:0:3} == osx ]] && echo "prepend-path DYLD_LIBRARY_PATH \$::env(ALO_ROOT)/lib")
EoF
mkdir -p $INSTALLROOT/etc/modulefiles && rsync -a --delete etc/modulefiles/ $INSTALLROOT/etc/modulefiles