forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 1
/
datadistribution.sh
87 lines (78 loc) · 3.27 KB
/
datadistribution.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
75
76
77
78
79
80
81
82
83
84
85
86
87
package: DataDistribution
version: "%(tag_basename)s"
tag: v0.7.7
requires:
- boost
- FairLogger
- FairMQ
- Ppconsul
- grpc
- Monitoring
- protobuf
- O2
- fmt
build_requires:
- CMake
- "GCC-Toolchain:(?!osx)"
source: https://github.com/AliceO2Group/DataDistribution
incremental_recipe: |
# reduce number of compile slots if invoked by Jenkins
if [[ -v JENKINS_HOME ]]; then
JOBS=1
fi
make ${JOBS:+-j$JOBS} install
mkdir -p $INSTALLROOT/etc/modulefiles && rsync -a --delete etc/modulefiles/ $INSTALLROOT/etc/modulefiles
---
#!/bin/bash -ex
case $ARCHITECTURE in
osx*)
[[ ! $BOOST_ROOT ]] && BOOST_ROOT=$(brew --prefix boost)
[[ ! $FMT_ROOT ]] && FMT_ROOT=`brew --prefix fmt`
;;
esac
cmake $SOURCEDIR \
${CMAKE_GENERATOR:+-G "$CMAKE_GENERATOR"} \
-DCMAKE_INSTALL_PREFIX=$INSTALLROOT \
${BOOST_ROOT:+-DBOOST_ROOT=$BOOST_ROOT} \
${FAIRLOGGER_ROOT:+-DFairLogger_ROOT=$FAIRLOGGER_ROOT} \
${FAIRMQ_ROOT:+-DFairMQ_ROOT=$FAIRMQ_ROOT} \
${PPCONSUL_ROOT:+-Dppconsul_DIR=${PPCONSUL_ROOT}/cmake} \
${O2_ROOT:+-DO2_ROOT=$O2_ROOT} \
${MONITORING_ROOT:+-DMonitoring_ROOT=$MONITORING_ROOT} \
${PROTOBUF_ROOT:+-DProtobuf_ROOT=$PROTOBUF_ROOT} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cp ${BUILDDIR}/compile_commands.json ${INSTALLROOT}
# reduce number of compile slots if invoked by Jenkins
if [[ -v JENKINS_HOME ]]; then
JOBS=1
fi
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 \\
${BOOST_REVISION:+boost/$BOOST_VERSION-$BOOST_REVISION} \\
${GCC_TOOLCHAIN_REVISION:+GCC-Toolchain/$GCC_TOOLCHAIN_VERSION-$GCC_TOOLCHAIN_REVISION} \\
${FAIRLOGGER_REVISION:+FairLogger/$FAIRLOGGER_VERSION-$FAIRLOGGER_REVISION} \\
${FAIRMQ_REVISION:+FairMQ/$FAIRMQ_VERSION-$FAIRMQ_REVISION} \\
${PPCONSUL_REVISION:+Ppconsul/$PPCONSUL_VERSION-$PPCONSUL_REVISION} \\
${GRPC_REVISION:+grpc/$GRPC_VERSION-$GRPC_REVISION} \\
${O2_REVISION:+O2/$O2_VERSION-$O2_REVISION} \\
${MONITORING_REVISION:+Monitoring/$MONITORING_VERSION-$MONITORING_REVISION}
# DataDistribution environment:
set DATADISTRIBUTION_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
prepend-path PATH \$DATADISTRIBUTION_ROOT/bin
# Not used for now:
# prepend-path LD_LIBRARY_PATH \$DATADISTRIBUTION_ROOT/lib
# prepend-path LD_LIBRARY_PATH \$DATADISTRIBUTION_ROOT/lib64
# prepend-path ROOT_INCLUDE_PATH \$DATADISTRIBUTION_ROOT/include
EoF
mkdir -p $INSTALLROOT/etc/modulefiles && rsync -a --delete etc/modulefiles/ $INSTALLROOT/etc/modulefiles