-
Notifications
You must be signed in to change notification settings - Fork 10
369 lines (332 loc) · 12.4 KB
/
Copy pathbuild.yml
File metadata and controls
369 lines (332 loc) · 12.4 KB
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
name: build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_call:
workflow_dispatch:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
DEBIAN_FRONTEND: noninteractive
CACHE_VERSION: "v2"
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CCACHE_COMPILERCHECK: content
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 500M
CCACHE_SLOPPINESS: pch_defines,time_macros,include_file_mtime,include_file_ctime
CCACHE_COMPRESS: "1"
CCACHE_COMPRESSLEVEL: "1"
NRGLJUBLJANA_CTEST_TIMEOUT_SECONDS: "3600"
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-22.04, cc: gcc-12, cxx: g++-12, blas: openBLAS, cmake_flags: "-DBLA_VENDOR=OpenBLAS", openblas_threads: "1", mkl_threads: "1", omp_threads: ""}
- {os: ubuntu-22.04, cc: clang-15, cxx: clang++-15, blas: openBLAS, cmake_flags: "-DBLA_VENDOR=OpenBLAS", openblas_threads: "1", mkl_threads: "1", omp_threads: ""}
- {os: ubuntu-22.04, cc: gcc-12, cxx: g++-12, blas: imkl, cmake_flags: "-DBLA_VENDOR=Intel10_64_dyn -DNRGLJUBLJANA_MKL_THREADING_LAYER=GNU", openblas_threads: "1", mkl_threads: "2", mkl_threading_layer: GNU, omp_threads: "2"}
- {os: ubuntu-22.04-arm, cc: clang-15, cxx: clang++-15, blas: openBLAS, cmake_flags: "-DBLA_VENDOR=OpenBLAS", openblas_threads: "1", mkl_threads: "1", omp_threads: "", openblas_coretype: ARMV8}
- {os: ubuntu-24.04, cc: gcc-14, cxx: g++-14, blas: openBLAS, cmake_flags: "-DBLA_VENDOR=OpenBLAS", openblas_threads: "2", mkl_threads: "1", omp_threads: ""}
- {os: ubuntu-24.04, cc: clang-18, cxx: clang++-18, blas: openBLAS, cmake_flags: "-DBLA_VENDOR=OpenBLAS", openblas_threads: "1", mkl_threads: "1", omp_threads: ""}
- {os: ubuntu-24.04-arm, cc: clang-18, cxx: clang++-18, blas: openBLAS, cmake_flags: "-DBLA_VENDOR=OpenBLAS", openblas_threads: "1", mkl_threads: "1", omp_threads: "", openblas_coretype: ARMV8}
- {os: macos-14, cc: clang, cxx: clang++, blas: accelerate, cmake_flags: "", omp_threads: ""}
- {os: macos-15, cc: clang, cxx: clang++, blas: accelerate, cmake_flags: "", omp_threads: ""}
- {os: macos-26, cc: clang, cxx: clang++, blas: accelerate, require_arm64: true, cmake_flags: "", omp_threads: ""}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: actions/cache/restore@v5
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ env.CACHE_VERSION }}-${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.blas }}-${{ github.run_id }}
restore-keys:
ccache-${{ env.CACHE_VERSION }}-${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.blas }}-
- name: Install ubuntu dependencies (openBLAS)
if: ${{ startsWith(matrix.os, 'ubuntu-22.04') && contains(matrix.blas, 'openBLAS') }}
run: >
sudo apt-get update &&
sudo apt-get install -y --no-install-recommends lsb-release wget software-properties-common &&
wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && sudo chmod +x /tmp/llvm.sh && sudo /tmp/llvm.sh 15 &&
sudo apt-get install -y --no-install-recommends
ccache
clang-15
g++-12
hdf5-tools
libboost-dev
libboost-mpi-dev
libboost-serialization-dev
libclang-15-dev
libc++-15-dev
libc++abi-15-dev
libomp-15-dev
libgmp-dev
libgsl-dev
libhdf5-dev
libopenblas-dev
libopenmpi-dev
openmpi-bin
openmpi-common
openmpi-doc
- name: Install ubuntu dependencies (Intel MKL)
if: ${{ (matrix.os == 'ubuntu-22.04') && contains(matrix.blas, 'imkl') }}
run: >
sudo apt-get update &&
sudo apt-get install -y --no-install-recommends lsb-release wget software-properties-common &&
wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && sudo chmod +x /tmp/llvm.sh && sudo /tmp/llvm.sh 15 &&
sudo apt-get install -y --no-install-recommends
ccache
clang-15
g++-12
hdf5-tools
libmkl-dev
libboost-dev
libboost-mpi-dev
libboost-serialization-dev
libclang-15-dev
libc++-15-dev
libc++abi-15-dev
libgmp-dev
libgsl-dev
libhdf5-dev
libopenmpi-dev
openmpi-bin
openmpi-common
openmpi-doc
- name: Install ubuntu 24.04 dependencies (openBLAS, GCC 14)
if: ${{ startsWith(matrix.os, 'ubuntu-24.04') && (matrix.cc == 'gcc-14') && contains(matrix.blas, 'openBLAS') }}
run: >
sudo apt-get update &&
sudo apt-get install -y --no-install-recommends
ccache
gcc-14
g++-14
hdf5-tools
libboost-dev
libboost-mpi-dev
libboost-serialization-dev
libgmp-dev
libgsl-dev
libhdf5-dev
libopenblas-dev
libopenmpi-dev
openmpi-bin
- name: Install ubuntu 24.04 dependencies (openBLAS, Clang 18)
if: ${{ startsWith(matrix.os, 'ubuntu-24.04') && (matrix.cc == 'clang-18') && contains(matrix.blas, 'openBLAS') }}
run: >
sudo apt-get update &&
sudo apt-get install -y --no-install-recommends
ccache
clang-18
hdf5-tools
libboost-dev
libboost-mpi-dev
libboost-serialization-dev
libclang-18-dev
libc++-18-dev
libc++abi-18-dev
libgmp-dev
libgsl-dev
libhdf5-dev
libopenblas-dev
libomp-18-dev
libopenmpi-dev
openmpi-bin
- name: Install homebrew dependencies (clang)
if: ${{ contains(matrix.os, 'macos') && contains(matrix.cxx, 'clang') }}
run: |
brew install ccache llvm gcc boost boost-mpi hdf5 libomp open-mpi openblas gsl gmp
- name: Assert Apple Silicon runner
if: ${{ matrix.require_arm64 == true }}
run: |
test "$(uname -m)" = "arm64"
- name: Add clang library path for ubuntu
if: ${{ startsWith(matrix.os, 'ubuntu-22.04') && contains(matrix.cxx, 'clang') }}
run: |
echo "LIBRARY_PATH=/usr/lib/llvm-15/lib" >> $GITHUB_ENV
- name: Add clang library path for ubuntu 24.04
if: ${{ startsWith(matrix.os, 'ubuntu-24.04') && contains(matrix.cxx, 'clang') }}
run: |
echo "LIBRARY_PATH=/usr/lib/llvm-18/lib" >> $GITHUB_ENV
- name: Add clang environment for macos
if: ${{ contains(matrix.os, 'macos') && contains(matrix.cxx, 'clang') }}
run: |
LLVM_PREFIX="$(brew --prefix llvm)"
GCC_PREFIX="$(brew --prefix gcc)"
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
echo "PATH=$LLVM_PREFIX/bin:$GCC_PREFIX/bin:$PATH" >> $GITHUB_ENV
- name: Build NRG Ljubljana
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/install ${{ matrix.cmake_flags }}
cmake --build . --parallel 2
- name: Configure test runtime environment
run: |
echo "OPENBLAS_NUM_THREADS=${{ matrix.openblas_threads || '1' }}" >> "$GITHUB_ENV"
echo "MKL_NUM_THREADS=${{ matrix.mkl_threads || '1' }}" >> "$GITHUB_ENV"
echo "OMP_NUM_THREADS=${{ matrix.omp_threads || '1' }}" >> "$GITHUB_ENV"
echo "OMP_DYNAMIC=FALSE" >> "$GITHUB_ENV"
echo "MKL_DYNAMIC=FALSE" >> "$GITHUB_ENV"
if [ -n "${{ matrix.mkl_threading_layer }}" ]; then
echo "MKL_THREADING_LAYER=${{ matrix.mkl_threading_layer }}" >> "$GITHUB_ENV"
fi
if [ -n "${{ matrix.openblas_coretype }}" ]; then
echo "OPENBLAS_CORETYPE=${{ matrix.openblas_coretype }}" >> "$GITHUB_ENV"
fi
- name: Test NRG Ljubljana
run: |
ctest_args=()
if [ -n "${{ matrix.ctest_regex }}" ]; then
ctest_args=(-R "${{ matrix.ctest_regex }}")
fi
cd build
ctest -j2 "${ctest_args[@]}" --output-on-failure --timeout "${NRGLJUBLJANA_CTEST_TIMEOUT_SECONDS}" --no-tests=error
- name: Upload test logs
uses: actions/upload-artifact@v7
if: failure()
with:
name: test-logs-${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.blas }}
path: |
build/Testing/Temporary/LastTest.log
build/Testing/Temporary/LastTestsFailed.log
build/test/**/log
if-no-files-found: ignore
- name: ccache statistics
if: always()
run: |
if command -v ccache >/dev/null 2>&1; then
ccache -sv
else
echo "ccache not found; skipping statistics"
fi
- uses: actions/cache/save@v5
if: always()
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ env.CACHE_VERSION }}-${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.blas }}-${{ github.run_id }}
sanitizers:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- name: Install sanitizer dependencies
run: >
sudo apt-get update &&
sudo apt-get install -y --no-install-recommends lsb-release wget software-properties-common &&
wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && sudo chmod +x /tmp/llvm.sh && sudo /tmp/llvm.sh 15 &&
sudo apt-get install -y --no-install-recommends
ccache
clang-15
g++-12
hdf5-tools
libblas-dev
libboost-dev
libboost-mpi-dev
libboost-serialization-dev
libclang-15-dev
libc++-15-dev
libc++abi-15-dev
libomp-15-dev
libgmp-dev
libgsl-dev
libhdf5-dev
liblapack-dev
libopenmpi-dev
openmpi-bin
openmpi-common
openmpi-doc
- name: Add clang library path for ubuntu
run: |
echo "LIBRARY_PATH=/usr/lib/llvm-15/lib" >> $GITHUB_ENV
- name: Build with sanitizers
env:
CC: clang-15
CXX: clang++-15
run: |
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=$HOME/install -DASAN=ON -DUBSAN=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build build --parallel 2
- name: Test with sanitizers
env:
OPENBLAS_NUM_THREADS: "1"
# Small memory leaks expected from third-party dependencies
ASAN_OPTIONS: "detect_leaks=0"
run: |
ctest --test-dir build -j2 --output-on-failure --timeout "${NRGLJUBLJANA_CTEST_TIMEOUT_SECONDS}" --no-tests=error
analysis:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- name: Install analysis dependencies
run: >
sudo apt-get update &&
sudo apt-get install -y --no-install-recommends lsb-release wget software-properties-common &&
wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && sudo chmod +x /tmp/llvm.sh && sudo /tmp/llvm.sh 15 &&
sudo apt-get install -y --no-install-recommends
ccache
clang-15
clang-tidy-15
cppcheck
g++-12
hdf5-tools
libblas-dev
libboost-dev
libboost-mpi-dev
libboost-serialization-dev
libclang-15-dev
libc++-15-dev
libc++abi-15-dev
libomp-15-dev
libgmp-dev
libgsl-dev
libhdf5-dev
liblapack-dev
libopenmpi-dev
openmpi-bin
openmpi-common
openmpi-doc
- name: Add LLVM tools to environment
run: |
echo "/usr/lib/llvm-15/bin" >> $GITHUB_PATH
echo "LIBRARY_PATH=/usr/lib/llvm-15/lib" >> $GITHUB_ENV
- name: Run static analysis build
env:
CC: clang-15
CXX: clang++-15
run: |
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=$HOME/install -DANALYZE_SOURCES=ON
cmake --build build --target nrgljubljana_c --parallel 2
docs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- name: Install documentation dependencies
run: >
sudo apt-get update &&
sudo apt-get install -y --no-install-recommends
ccache
g++-12
hdf5-tools
libblas-dev
libboost-dev
libboost-mpi-dev
libboost-serialization-dev
libgmp-dev
libgsl-dev
libhdf5-dev
liblapack-dev
libopenmpi-dev
openmpi-bin
openmpi-common
openmpi-doc
python3-sphinx
- name: Build documentation
env:
CC: gcc-12
CXX: g++-12
run: |
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=$HOME/install -DBuild_Documentation=ON -DSphinx_Only=ON
cmake --build build --target docs_sphinx --parallel 2