forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fairmq.sh
67 lines (61 loc) · 2.08 KB
/
fairmq.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
package: FairMQ
version: "%(tag_basename)s"
tag: v1.4.56
source: https://github.com/FairRootGroup/FairMQ
requires:
- boost
- FairLogger
- ZeroMQ
build_requires:
- alibuild-recipe-tools
- CMake
- FairCMakeModules
- "GCC-Toolchain:(?!osx)"
- ninja
prepend_path:
ROOT_INCLUDE_PATH:
- "${FAIRMQ_ROOT}/include"
- "${FAIRMQ_ROOT}/include/fairmq"
incremental_recipe: |
#!/bin/bash -e
cmake --build . ${JOBS:+-j$JOBS}
cmake --install . --prefix "${INSTALLROOT}"
MODULEDIR="etc/modulefiles"
mkdir -p "${INSTALLROOT}/${MODULEDIR}"
rsync -a --delete "${MODULEDIR}/" "${INSTALLROOT}/${MODULEDIR}"
---
#!/bin/bash -e
case ${ARCHITECTURE} in
osx*)
[[ -n ${BOOST_ROOT} ]] || BOOST_ROOT=$(brew --prefix boost)
[[ -n ${ZEROMQ_ROOT} ]] || ZEROMQ_ROOT=$(brew --prefix zeromq)
;;
esac
cmake "${SOURCEDIR}" \
-GNinja \
${CXXSTD:+-DCMAKE_CXX_STANDARD=${CXXSTD}} \
${CXX_COMPILER:+-DCMAKE_CXX_COMPILER=${CXX_COMPILER}} \
${CMAKE_BUILD_TYPE:+-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}} \
-DCMAKE_INSTALL_LIBDIR=lib \
-DDISABLE_COLOR=ON \
-DBUILD_EXAMPLES=ON \
-DBUILD_TESTING=ON
# NOTE: FairMQ examples must always be built in RPMs as they are
# used for AliECS integration testing. Please do not disable
# them.
cmake --build . ${JOBS:+-j${JOBS}}
if [[ -n ${ALIBUILD_FAIRMQ_TESTS} ]]; then
ctest --output-on-failure --schedule-random ${JOBS:+-j${JOBS}}
fi
cmake --install . --prefix "${INSTALLROOT}"
# ModuleFile
MODULEDIR="etc/modulefiles"
mkdir -p "${MODULEDIR}"
MODULEFILE="${MODULEDIR}/${PKGNAME}"
alibuild-generate-module --bin --lib > "${MODULEFILE}"
cat << EOF >> "${MODULEFILE}"
prepend-path ROOT_INCLUDE_PATH \$PKG_ROOT/include
prepend-path ROOT_INCLUDE_PATH \$PKG_ROOT/include/fairmq
EOF
mkdir -p "${INSTALLROOT}/${MODULEDIR}"
rsync -a --delete "${MODULEDIR}/" "${INSTALLROOT}/${MODULEDIR}"