-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
223 lines (213 loc) · 6.87 KB
/
.gitlab-ci.yml
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
---
# Copyright (c) 2020 Jakob Meng, <jakobmeng@web.de>
# vim:set fileformat=unix tabstop=2 shiftwidth=2 expandtab:
# kate: end-of-line unix; space-indent on; indent-width 2; remove-trailing-spaces modified;
variables:
# The cache and install prefix paths must be relative to and reside inside the project directory ($CI_PROJECT_DIR),
# because cache:paths and artifacts:paths do not support absolute paths or linking outside the project directory.
# Ref.: https://docs.gitlab.com/ce/ci/yaml/README.html
BUILD_DIR: '$CI_PROJECT_DIR/build/${CC}-${CXX}-${BUILD_TYPE}'
CCACHE_DIR: '$CI_PROJECT_DIR/.cache/ccache/${CC}-${CXX}-${BUILD_TYPE}'
INSTALL_PREFIX: '$CI_PROJECT_DIR/.local/${CC}-${CXX}-${BUILD_TYPE}'
# PATH variable cannot be set here
# Ref.: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27226
default:
cache:
paths:
- .cache
.build-linux: &build-linux
artifacts:
paths:
- .local
- build
before_script:
- export PATH=/usr/lib/ccache:$PATH
- whoami
- nproc
- echo `which $CC`
- echo `which $CXX`
- cmake --version
- ctest --version
- ccache -s
# Symbol visibility is set to default because Boost.Test 1.67
# from Debian 10 (Buster) has issues with hidden symbols
# Ref.: https://github.com/boostorg/test/issues/199
- >
export BOOST_VERSION="$(grep -F '#define BOOST_VERSION ' /usr/include/boost/version.hpp | awk '{ print $3; }')";
echo "BOOST_VERSION: $BOOST_VERSION";
if [ "$BOOST_VERSION" = "106700" ]; then
CMAKE_VISIBILITY_OPTIONS=\
' -DCMAKE_CXX_VISIBILITY_PRESET=default'\
' -DCMAKE_C_VISIBILITY_PRESET=default '\
' -DCMAKE_VISIBILITY_INLINES_HIDDEN=OFF' ;
else
CMAKE_VISIBILITY_OPTIONS= ;
fi
# Build hbrs-cmake
- mkdir -p "$INSTALL_PREFIX/src" && cd "$INSTALL_PREFIX/src"
- >
if [ ! -e hbrs-cmake ]; then
git clone --depth 1 https://github.com/JM1/hbrs-cmake.git &&
cd hbrs-cmake/;
else
cd hbrs-cmake/ &&
git reset --hard origin &&
git pull;
fi
- if [ ! -e build ]; then mkdir build; fi
- cd build/
- >
cmake \
"-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" \
"-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX}" \
..
- make "-j$(nproc)"
- make install
- cd ../../
# Build hbrs-mpl
- mkdir -p "$INSTALL_PREFIX/src" && cd "$INSTALL_PREFIX/src"
- >
if [ ! -e hbrs-mpl ]; then
git clone --depth 1 https://github.com/JM1/hbrs-mpl.git &&
cd hbrs-mpl/;
else
cd hbrs-mpl/ &&
git reset --hard origin &&
git pull;
fi
- if [ ! -e build ]; then mkdir build; fi
- cd build/
- >
cmake \
"-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" \
"-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX}" \
-DHBRS_MPL_ENABLE_TESTS=OFF \
-DHBRS_MPL_ENABLE_BENCHMARKS=OFF \
-DHBRS_MPL_ENABLE_ELEMENTAL=ON \
-DHBRS_MPL_ENABLE_MATLAB=OFF \
$CMAKE_VISIBILITY_OPTIONS \
..
- make "-j$(nproc)"
- make install
- cd ../../
script:
- export PATH=/usr/lib/ccache:$PATH
- ccache -s
- cd "$CI_PROJECT_DIR"
- if [ ! -e "$BUILD_DIR" ]; then mkdir -p "$BUILD_DIR"; fi
- cd "$BUILD_DIR"
- >
cmake \
-DCMAKE_Python3_COMPILER_FORCED=ON \
"-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" \
"-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX}" \
-DEDAMER_ENABLE_SCALAR_INT=ON \
-DEDAMER_ENABLE_SCALAR_FLOAT=ON \
-DEDAMER_ENABLE_SCALAR_DOUBLE=ON \
-DEDAMER_ENABLE_SCALAR_COMPLEX_FLOAT=ON \
-DEDAMER_ENABLE_SCALAR_COMPLEX_DOUBLE=ON \
-DEDAMER_ENABLE_MATRIX_DISTRIBUTION_CIRC_CIRC=ON \
-DEDAMER_ENABLE_MATRIX_DISTRIBUTION_MC_MR=ON \
-DEDAMER_ENABLE_MATRIX_DISTRIBUTION_MC_STAR=ON \
-DEDAMER_ENABLE_MATRIX_DISTRIBUTION_MD_STAR=ON \
-DEDAMER_ENABLE_MATRIX_DISTRIBUTION_MR_MC=ON \
-DEDAMER_ENABLE_MATRIX_DISTRIBUTION_MR_STAR=ON \
-DEDAMER_ENABLE_MATRIX_DISTRIBUTION_STAR_MC=ON \
-DEDAMER_ENABLE_MATRIX_DISTRIBUTION_STAR_MD=ON \
-DEDAMER_ENABLE_MATRIX_DISTRIBUTION_STAR_MR=ON \
-DEDAMER_ENABLE_MATRIX_DISTRIBUTION_STAR_STAR=ON \
-DEDAMER_ENABLE_MATRIX_DISTRIBUTION_STAR_VC=ON \
-DEDAMER_ENABLE_MATRIX_DISTRIBUTION_STAR_VR=ON \
-DEDAMER_ENABLE_MATRIX_DISTRIBUTION_VC_STAR=ON \
-DEDAMER_ENABLE_MATRIX_DISTRIBUTION_VR_STAR=ON \
-DEDAMER_ENABLE_TESTS=ON \
$CMAKE_VISIBILITY_OPTIONS \
"$CI_PROJECT_DIR" || { cat CMakeFiles/CMakeError.log; exit 255; };
- make "-j$(nproc)"
- ccache -s
- make install
.test-linux: &test-linux
script:
- cd "$BUILD_DIR"
# Use MPI point-to-point management layer ob1 instead of ucx, else unit test dt_el_dist_matrix
# might fail or get stuck in function test_copy_redist due to zeros in the upper matrix indices.
- export OMPI_MCA_pml=ob1
- for i in $(seq 5); do ctest --output-on-failure || exit 255; done
- cd /
- export LD_LIBRARY_PATH="$INSTALL_PREFIX/lib"
- export PYTHONPATH="$INSTALL_PREFIX/lib/python3/dist-packages"
- python3 -c "from edamer import detail, dt, fn; print('All systems go')"
.matrix-gcc8-clang7: &matrix-gcc8-clang7
parallel:
matrix:
- CC: gcc-8
CXX: g++-8
BUILD_TYPE: Debug
- CC: gcc-8
CXX: g++-8
BUILD_TYPE: MinSizeRel
- CC: gcc-8
CXX: g++-8
BUILD_TYPE: RelWithDebInfo
- CC: gcc-8
CXX: g++-8
BUILD_TYPE: Release
- CC: clang-7
CXX: clang++-7
BUILD_TYPE: Debug
- CC: clang-7
CXX: clang++-7
BUILD_TYPE: Release
build-linux-debian-buster:
extends: .build-linux
stage: build
image: jm1337/debian-dev-hbrs:buster
cache:
key: "linux-debian-buster"
<<: *matrix-gcc8-clang7
test-linux-debian-buster:
extends: .test-linux
stage: test
image: jm1337/debian-dev-hbrs:buster
cache: {}
<<: *matrix-gcc8-clang7
needs:
- job: build-linux-debian-buster
artifacts: true
.matrix-gcc10-clang10: &matrix-gcc10-clang10
parallel:
matrix:
- CC: gcc-10
CXX: g++-10
BUILD_TYPE: Debug
- CC: gcc-10
CXX: g++-10
BUILD_TYPE: MinSizeRel
- CC: gcc-10
CXX: g++-10
BUILD_TYPE: RelWithDebInfo
- CC: gcc-10
CXX: g++-10
BUILD_TYPE: Release
- CC: clang-10
CXX: clang++-10
BUILD_TYPE: Debug
- CC: clang-10
CXX: clang++-10
BUILD_TYPE: Release
build-linux-debian-bullseye:
extends: .build-linux
stage: build
image: jm1337/debian-dev-hbrs:bullseye
cache:
key: "linux-debian-bullseye"
<<: *matrix-gcc10-clang10
test-linux-debian-bullseye:
extends: .test-linux
stage: test
image: jm1337/debian-dev-hbrs:bullseye
cache: {}
<<: *matrix-gcc10-clang10
needs:
- job: build-linux-debian-bullseye
artifacts: true