-
Notifications
You must be signed in to change notification settings - Fork 43
374 lines (374 loc) · 15.8 KB
/
fabm.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
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
370
371
372
373
374
name: Build and test
on:
push:
branches:
- "**"
pull_request:
jobs:
gfortran:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
version: [9, 10, 11, 12]
os: [ubuntu-latest]
include:
#- version: 4.8
# os: ubuntu-18.04
# cmake_args: -DFABM_USE_IEEE_ARITHMETIC=OFF
#- version: 5
# os: ubuntu-18.04
#- version: 6
# os: ubuntu-18.04
- version: 7
os: ubuntu-20.04
- version: 8
os: ubuntu-20.04
cmake_args: -DFABM_USE_CONTIGUOUS=OFF
- version: 13
os: ubuntu-24.04
- version: 14
os: ubuntu-24.04
fail-fast: false
runs-on: ${{ matrix.os }}
env:
FFLAGS: -fcheck=all
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ">=3.7"
- name: Install Python dependencies
run: python -m pip install --upgrade pip pyyaml
- name: Install compiler
run: |
sudo apt-get update
sudo apt-get install gfortran-${{ matrix.version }}
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Run all test cases with host emulators
run: python3 util/developers/run_all_testcases.py harness --show_logs --compiler gfortran-${{ matrix.version }} ${{ matrix.cmake_args }}
- name: Run all test cases with pyfabm
run: python3 util/developers/run_all_testcases.py pyfabm --show_logs --compiler gfortran-${{ matrix.version }} ${{ matrix.cmake_args }}
ifort:
# for available versions, see https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
include:
- version: "2021.1.2.62"
url_dir: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/17508"
# - version: "2022.2.1.16992"
# url_dir: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/18998"
# - version: "2023.2.0.49254"
# url_dir: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/237236c4-434b-4576-96ac-020ceeb22619"
- version: "2024.2.0.426"
url_dir: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/801143de-6c01-4181-9911-57e00fe40181"
fail-fast: false
runs-on: ubuntu-latest
env:
FFLAGS: -check all
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ">=3.7"
- name: Install Python dependencies
run: python -m pip install --upgrade pip pyyaml
- name: Install compiler
run: |
wget --no-verbose ${{ matrix.url_dir }}/l_fortran-compiler_p_${{ matrix.version }}_offline.sh
/bin/sh l_fortran-compiler_p_${{ matrix.version }}_offline.sh -a --silent --cli --install-dir ${HOME}/intel --eula accept
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Run all test cases with host emulators
run: |
source ${HOME}/intel/setvars.sh
python3 util/developers/run_all_testcases.py harness --show_logs --compiler ifort
- name: Run all test cases with pyfabm
run: |
source ${HOME}/intel/setvars.sh
python3 util/developers/run_all_testcases.py pyfabm --show_logs --compiler ifort
env:
FFLAGS: ${{ env.FFLAGS }} -fp-model precise -fp-model source
ifx:
# for available versions, see https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
include:
- version: "2023.2.0.49254"
url_dir: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/237236c4-434b-4576-96ac-020ceeb22619"
fflags: -check all,nouninit,nocontiguous
# nouninit because https://community.intel.com/t5/Intel-Fortran-Compiler/ifx-missing-clang-rt-msan-to-link-Fortran-program-in-debug-build/m-p/1536555
# nocontiguous because spurious errors occur when assigning null() to contiguous pointers, see https://community.intel.com/t5/Intel-Fortran-Compiler/ifx-2024-0-2-runtime-error-about-non-contiguous-target/m-p/1583909
#- version: "2024.0.2.28"
# url_dir: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/41df6814-ec4b-4698-a14d-421ee2b02aa7"
- version: "2024.2.0.426"
url_dir: "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/801143de-6c01-4181-9911-57e00fe40181"
fflags: -check all,nouninit,nocontiguous
# memory sanitizer (uninit) still seems broken, as it reports errors in libc.so (it should be auto-linked to sanitized libc, but apparently not)
# contiguous check still broken, to be fixed in 2025.x as per https://community.intel.com/t5/Intel-Fortran-Compiler/ifx-2024-0-2-runtime-error-about-non-contiguous-target/m-p/1583909
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ">=3.7"
- name: Install Python dependencies
run: python -m pip install --upgrade pip pyyaml
- name: Install compiler
run: |
wget --no-verbose ${{ matrix.url_dir }}/l_fortran-compiler_p_${{ matrix.version }}_offline.sh
/bin/sh l_fortran-compiler_p_${{ matrix.version }}_offline.sh -a --silent --cli --install-dir ${HOME}/intel --eula accept
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Run all test cases with host emulators
run: |
source ${HOME}/intel/setvars.sh
python3 util/developers/run_all_testcases.py harness --show_logs --compiler ifx
env:
FFLAGS: ${{ matrix.fflags }}
- name: Run all test cases with pyfabm
run: |
source ${HOME}/intel/setvars.sh
python3 util/developers/run_all_testcases.py pyfabm --show_logs --compiler ifx
env:
FFLAGS: ${{ matrix.fflags }} -fp-model=precise
nvfortran:
# for available versions, see https://developer.nvidia.com/nvidia-hpc-sdk-releases
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
include:
- version: "20.7" # released 2020-08
exe: nvhpc_2020_207_Linux_x86_64_cuda_11.0
# - version: "20.9" # released 2020-10
# exe: nvhpc_2020_209_Linux_x86_64_cuda_11.0
# - version: "22.9" # released 2022-10
# exe: nvhpc_2022_229_Linux_x86_64_cuda_11.7
# - version: "23.7" # released 2023-07
# exe: nvhpc_2023_237_Linux_x86_64_cuda_12.2
- version: "24.5" # released 2024-05
exe: nvhpc_2024_245_Linux_x86_64_cuda_12.4
fail-fast: false
runs-on: ubuntu-latest
env:
FFLAGS: -Mbounds -Mchkptr
steps:
- name: Free up disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ">=3.7"
- name: Install Python dependencies
run: python -m pip install --upgrade pip pyyaml
- name: Install compiler
run: |
wget --no-verbose https://developer.download.nvidia.com/hpc-sdk/${{ matrix.version }}/${{ matrix.exe }}.tar.gz
tar xpzf ${{ matrix.exe }}.tar.gz
rm ${{ matrix.exe }}.tar.gz
${{ matrix.exe }}/install
env:
NVHPC_SILENT: true
NVHPC_INSTALL_DIR: /home/runner/nvhpc
NVHPC_INSTALL_TYPE: single
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Run all test cases with host emulators
run: python3 util/developers/run_all_testcases.py harness --show_logs --compiler /home/runner/nvhpc/Linux_x86_64/${{ matrix.version }}/compilers/bin/pgfortran
- name: Run all test cases with pyfabm
run: python3 util/developers/run_all_testcases.py pyfabm --show_logs --compiler /home/runner/nvhpc/Linux_x86_64/${{ matrix.version }}/compilers/bin/pgfortran
aocc:
# for available versions, see https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/aocc/package.py
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
include:
- version: "3.2.0" # released 2021-12-02 (LLVM 13.0)
pyfabm_cmake_args: -DCMAKE_Fortran_FLAGS_DEBUG= # skip -g as that triggers segfault
url_dir: https://download.amd.com/developer/eula/aocc-compiler
# - version: "4.0.0" # released 2022-11-10 (LLVM 14.0.6)
# url_dir: https://download.amd.com/developer/eula/aocc-compiler
# - version: "4.1.0" # released 2023-08-04 (LLVM 16.0.3)
# url_dir: https://download.amd.com/developer/eula/aocc/aocc-4-1
- version: "4.2.0" # released 2024-02-27 (LLVM 16.0.3)
url_dir: https://download.amd.com/developer/eula/aocc/aocc-4-2
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ">=3.7"
- name: Install Python dependencies
run: python -m pip install --upgrade pip pyyaml
- name: Install compiler
run: |
cd /home/runner
wget --no-verbose ${{ matrix.url_dir }}/aocc-compiler-${{ matrix.version }}.tar
tar xpf aocc-compiler-${{ matrix.version }}.tar
rm aocc-compiler-${{ matrix.version }}.tar
./aocc-compiler-${{ matrix.version }}/install.sh
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Run all test cases with host emulators
run: |
source /home/runner/setenv_AOCC.sh
python3 util/developers/run_all_testcases.py harness --show_logs --compiler flang
- name: Run all test cases with pyfabm
run: |
source /home/runner/setenv_AOCC.sh
python3 util/developers/run_all_testcases.py pyfabm --show_logs --compiler flang ${{ matrix.pyfabm_cmake_args }}
flang-new:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
os: [windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
defaults:
run:
shell: cmd /C call {0}
env:
CMAKE_GENERATOR: Ninja
steps:
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
- name: Install Python dependencies
run: conda install -c conda-forge pyyaml flang>=19.0 ninja c-compiler
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Run all test cases with host emulators
run: |
set CMAKE_GENERATOR_PLATFORM=
set CMAKE_GENERATOR_TOOLSET=
python util/developers/run_all_testcases.py harness --show_logs --compiler flang-new
- name: Run all test cases with pyfabm
run: |
set CMAKE_GENERATOR_PLATFORM=
set CMAKE_GENERATOR_TOOLSET=
python util/developers/run_all_testcases.py pyfabm --show_logs --compiler flang-new -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE
pyfabm:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: false
defaults:
run:
shell: bash -el {0}
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }} with conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
- name: Install dependencies
run: conda install pip python-build
- name: Build distribution
run: python -m build
- name: Install
run: python -m pip install -v .
- name: Test
run: |
python -c "import pyfabm;print('pyfabm version =', getattr(pyfabm, '__version__', None))"
for f in testcases/*.yaml; do fabm_describe_model $f; done
for f in testcases/*.yaml; do fabm_complete_yaml --add_missing $f; done
- name: Run notebooks
if: matrix.python-version != '3.7' # due to https://github.com/conda-forge/webcolors-feedstock/issues/26
run: |
conda install ipython jupyterlab ipympl matplotlib scipy
cd testcases/python
for f in *.ipynb; do ipython --gui qt -c "%run $f"; done
- name: Install with customization via command line arguments
run: |
rm -rf build
python -m pip install -v -C--build-option=build_ext -C--build-option="--cmake-opts=-DFABM_INSTITUTES=examples" .
- name: Install with customization via setup.cfg
run: |
rm -rf build
echo "[build_ext]" > setup.cfg
echo "cmake_opts=-DFABM_INSTITUTES=examples" >> setup.cfg
python -m pip install -v .
fabm0d:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- name: Install NetCDF
run: |
sudo apt-get update
sudo apt-get install libnetcdff-dev
- name: Clone FABM
uses: actions/checkout@v4
with:
submodules: recursive
- name: Clone GOTM
uses: actions/checkout@v4
with:
repository: gotm-model/code
ref: v6.0
path: gotm
submodules: recursive
- name: Build
run: |
cmake -S src/drivers/0d -B build -DGOTM_BASE=gotm
cmake --build build --target install
stat ~/local/fabm/0d/bin/fabm0d
cmake:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
cmake-version: ["3.13"]
runs-on: ubuntu-latest
steps:
- name: Clone FABM
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download and extract cmake
run: |
wget --no-verbose https://cmake.org/files/v${{ matrix.cmake-version }}/cmake-${{ matrix.cmake-version }}.0-Linux-x86_64.tar.gz
tar -xvf cmake-${{ matrix.cmake-version }}.0-Linux-x86_64.tar.gz
- name: Build
run: |
cmake-${{ matrix.cmake-version }}.0-Linux-x86_64/bin/cmake -S . -B build
cmake-${{ matrix.cmake-version }}.0-Linux-x86_64/bin/cmake --build build --target install
ninja:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- name: Clone FABM
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Ninja
run: |
sudo apt-get update
sudo apt-get install ninja-build
- name: Build
run: |
cmake -S . -B build -G Ninja
cmake --build build --target install