-
Notifications
You must be signed in to change notification settings - Fork 633
280 lines (249 loc) · 9.54 KB
/
cmake.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
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
name: cmake
env:
# update urls for oneapi packages according to
# https://github.com/oneapi-src/oneapi-ci/blob/master/.github/workflows/build_all.yml
WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ae29263e-38b9-4d43-86c3-376d6e0668e7/intel-oneapi-base-toolkit-2025.0.1.47_offline.exe
WINDOWS_BASEKIT_COMPONENTS: intel.oneapi.win.mkl.devel
WINDOWS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/a37c30c3-a846-4371-a85d-603e9a9eb94c/intel-oneapi-hpc-toolkit-2025.0.1.48_offline.exe
WINDOWS_HPCKIT_COMPONENTS: intel.oneapi.win.ifort-compiler:intel.oneapi.win.mpi.devel
on:
push:
paths:
- .github/**
- Build/**
- Source/**
- CMakeLists.txt
pull_request:
paths:
- .github/**
- Build/**
- Source/**
- CMakeLists.txt
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
cmake-linux:
name: ${{ matrix.container }} ${{ matrix.compiler_mpi }} openmp=${{ matrix.openmp }} ${{ matrix.build_type }}
runs-on: [ubuntu-24.04]
container: ${{ matrix.container }}
strategy:
matrix:
container:
# - "fedora:40"
- "rockylinux:9"
- "ubuntu:24.04"
compiler_mpi:
- "intel_intelmpi"
# - "intel_openmpi"
- "gnu_openmpi"
openmp:
- "ON"
- "OFF"
build_type:
- "Debug"
- "Release"
defaults:
run:
shell: bash
steps:
- name: Install prerequisites (dnf)
if: matrix.container != 'ubuntu:24.04'
run: dnf install -y git gcc make cmake sudo environment-modules
- name: Install prerequisites (apt)
if: matrix.container == 'ubuntu:24.04'
run: |
apt-get -y update
apt-get -y install -y git gcc make cmake sudo environment-modules
# # Setup OneAPI, icx is necessary for third-party libs
# - uses: rscohn2/setup-oneapi@v0
# if: endsWith(matrix.compiler_mpi, '_intelmpi') != true
# with:
# components: |
# ifx
# icx
# mkl
# Setup OneAPI, icx is necessary for third-party libs
- uses: rscohn2/setup-oneapi@v0
# if: endsWith(matrix.compiler_mpi, '_intelmpi')
with:
components: |
- name: install openmpi
if: endsWith(matrix.compiler_mpi, '_openmpi') && (startsWith(matrix.container, 'rockylinux') || startsWith(matrix.container, 'fedora'))
run: dnf install -y openmpi-devel
- name: install openmpi
if: endsWith(matrix.compiler_mpi, '_openmpi') && startsWith(matrix.container, 'ubuntu')
run: |
sudo apt-get -y update
sudo apt-get -y install libopenmpi-dev openmpi-bin
- uses: actions/checkout@v4
- run: git config --global --add safe.directory /__w/fds/fds
- name: set linux-gnu compiler
if: startsWith(matrix.compiler_mpi, 'gnu_')
shell: bash
run: |
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
echo "FC=gfortran" >> $GITHUB_ENV
- name: set linux-gnu compiler
if: startsWith(matrix.compiler_mpi, 'intel_')
shell: bash
run: |
echo "CC=mpiicx" >> $GITHUB_ENV
echo "CXX=mpiicx" >> $GITHUB_ENV
echo "FC=mpiifx" >> $GITHUB_ENV
- name: build fds
if: endsWith(matrix.compiler_mpi, '_intelmpi')
run: |
source /opt/intel/oneapi/setvars.sh
cmake -B builddir -S . -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DMKL_LINK=dynamic -DUSE_OPENMP=${{matrix.openmp}}
cmake --build builddir -j --target fds
- name: build fds
if: endsWith(matrix.compiler_mpi, '_openmpi')
run: |
# source /opt/intel/oneapi/setvars.sh
if [ "${{matrix.container}}" = "rockylinux:9" ]; then
source /etc/profile.d/modules.sh
module load mpi/openmpi-x86_64
fi
cmake -B builddir -S . -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DMKL_LINK=dynamic -DUSE_OPENMP=${{matrix.openmp}}
cmake --build builddir -j --target fds
- name: Test
if: endsWith(matrix.compiler_mpi, '_intelmpi')
run: |
source /opt/intel/oneapi/setvars.sh
ctest --test-dir builddir -j --output-on-failure -V
- name: Test
if: endsWith(matrix.compiler_mpi, '_openmpi')
run: |
source /opt/intel/oneapi/setvars.sh
if [ "${{matrix.container}}" = "rockylinux:9" ]; then
source /etc/profile.d/modules.sh
module load mpi/openmpi-x86_64
fi
ctest --test-dir builddir -j --output-on-failure -V
cmake-osx:
# Set the name of this build, variable depending on the OS
name: ${{ matrix.os }} ${{ matrix.compiler_mpi }} openmp=${{ matrix.openmp }} ${{ matrix.build_type }}
strategy:
fail-fast: false
# The matrix sets all the different combinations of builds, e.g. platforms
# and build configurations
matrix:
os:
- macos-latest
compiler_mpi:
- "gnu_openmpi"
openmp:
- "ON"
- "OFF"
build_type:
- "Debug"
- "Release"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: install openmpi
run: brew install open-mpi
- name: set macos gcc
if: startsWith(matrix.compiler_mpi, 'gnu_')
shell: bash
run: |
echo "CC=gcc-14" >> $GITHUB_ENV
echo "CXX=g++-14" >> $GITHUB_ENV
echo "FC=gfortran-14" >> $GITHUB_ENV
echo "OMPI_FC=gfortran-14" >> $GITHUB_ENV
brew install glew gd zlib json-c
- name: set macos intel
if: startsWith(matrix.compiler_mpi, 'intel_')
shell: bash
run: |
echo "CC=icx" >> $GITHUB_ENV
echo "CXX=icx" >> $GITHUB_ENV
echo "FC=mpiifx" >> $GITHUB_ENV
echo "OMPI_FC=mpiifx" >> $GITHUB_ENV
- name: Build
if: startsWith(matrix.compiler_mpi, 'gnu_')
shell: bash
run: |
cmake -B builddir -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DUSE_OPENMP=${{matrix.openmp}}
cmake --build builddir -j1 --target fds
- name: Build
if: startsWith(matrix.compiler_mpi, 'intel_')
shell: bash
run: |
source /opt/intel/oneapi/setvars.sh
cmake -B builddir -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DUSE_OPENMP=${{matrix.openmp}}
cmake --build builddir -j1 --target fds
- name: Test
if: startsWith(matrix.compiler_mpi, 'gnu_')
run: ctest --test-dir builddir -j --output-on-failure -V
- name: Test
if: startsWith(matrix.compiler_mpi, 'intel_')
run: |
source /opt/intel/oneapi/setvars.sh
ctest --test-dir builddir -j --output-on-failure -V
cmake-windows:
# build on windows using ifort with intelmpi and mkl based on
# https://github.com/oneapi-src/oneapi-ci
name: windows ${{matrix.compiler}} intelmpi openmp=${{ matrix.openmp }} ${{ matrix.build_type }}
runs-on: [windows-latest]
strategy:
fail-fast: false
# The matrix sets all the different combinations of builds, e.g. platforms
# and build configurations
matrix:
build_type:
- "Debug"
- "Release"
openmp:
- "ON"
- "OFF"
compiler:
- "mpiifort"
- "mpiifx"
defaults:
run:
shell: cmd
steps:
- uses: actions/checkout@v4
# install oneapi components from web installer based on
# oneapi-ci/scripts/install_windows.bat
- name: cache install oneapi
id: cache-install
uses: actions/cache@v4
with:
path: C:\Program Files (x86)\Intel\oneAPI\
key: install-${{ env.WINDOWS_BASEKIT_URL }}-${{ env.WINDOWS_BASEKIT_COMPONENTS }}-${{ env.WINDOWS_HPCKIT_URL }}-${{ env.WINDOWS_HPCKIT_COMPONENTS }}
- name: install oneapi mkl
if: steps.cache-install.outputs.cache-hit != 'true'
run: |
curl.exe --output %TEMP%\webimage_base.exe --url %WINDOWS_BASEKIT_URL% --retry 5 --retry-delay 5
start /b /wait %TEMP%\webimage_base.exe -s -x -f webimage_base_extracted --log extract_base.log
del %TEMP%\webimage_base.exe
webimage_base_extracted\bootstrapper.exe -s --action install --components=%WINDOWS_BASEKIT_COMPONENTS% --eula=accept -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 --log-dir=.
rd /s/q "webimage_base_extracted"
- name: install oneapi compiler, mpi
if: steps.cache-install.outputs.cache-hit != 'true'
run: |
curl.exe --output %TEMP%\webimage_hpc.exe --url %WINDOWS_HPCKIT_URL% --retry 5 --retry-delay 5
start /b /wait %TEMP%\webimage_hpc.exe -s -x -f webimage_hpc_extracted --log extract_hpc.log
del %TEMP%\webimage_hpc.exe
webimage_hpc_extracted\bootstrapper.exe -s --action install --components=%WINDOWS_HPCKIT_COMPONENTS% --eula=accept -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 --log-dir=.
rd /s/q "webimage_hpc_extracted"
- name: build fds
run: |
call Build\Scripts\setup_intel_compilers.bat
cmake -B builddir -S . -G Ninja -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DUSE_SUNDIALS=OFF -DUSE_HYPRE=ON -DUSE_OPENMP=${{matrix.openmp}}
cmake --build builddir -j --target fds
- name: Test
run: |
call Build\Scripts\setup_intel_compilers.bat
ctest --test-dir builddir -j --output-on-failure -V