forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
alo-o2.sh
62 lines (56 loc) · 2.18 KB
/
alo-o2.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
package: alo-o2
version: "%(commit_hash)s"
tag: master
requires:
- googlebenchmark
- O2
- RapidJSON
build_requires:
- CMake
- ms_gsl
source: https://github.com/mrrtf/alo
incremental_recipe: |
cmake --build . -- ${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
cmake $SOURCEDIR \
${CMAKE_GENERATOR:+-G "$CMAKE_GENERATOR"} \
-DCMAKE_INSTALL_PREFIX="$INSTALLROOT" \
-DO2="$O2_ROOT" \
-DROOTSYS="$ROOT_ROOT" \
-DRAPIDJSON_INCLUDEDIR="$RAPIDJSON_ROOT/include" \
-DMS_GSL_INCLUDE_DIR=$MS_GSL_ROOT/include \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
${CMAKE_BUILD_TYPE:+-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE}
cmake --build . -- ${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 O2/$O2_VERSION-$O2_REVISION
# Our environment
setenv ALO_O2_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
prepend-path PATH \$::env(ALO_O2_ROOT)/bin
prepend-path LD_LIBRARY_PATH \$::env(ALO_O2_ROOT)/lib
EoF
mkdir -p $INSTALLROOT/etc/modulefiles && rsync -a --delete etc/modulefiles/ $INSTALLROOT/etc/modulefiles