Skip to content

Commit d12df58

Browse files
mjrenomjrenomjr-deltares
authored
ci(netcdf): windows extended build and tests (#2037)
* baseline netcdf windows tests * add windows extended build and test * idm update post rebase * release extended instead of parallel * build release netcdf-fortran libraries * remove temporary artifact upload --------- Co-authored-by: mjreno <mjreno@IGSAAA071L01144.gs.doi.net> Co-authored-by: mjr-deltares <45555666+mjr-deltares@users.noreply.github.com>
1 parent c88c436 commit d12df58

25 files changed

Lines changed: 454 additions & 85 deletions
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build Extended MF6 (Windows)
2+
description: Build Extended MODFLOW 6 on Windows
3+
runs:
4+
using: "composite"
5+
steps:
6+
7+
- name: Setup PETSc
8+
uses: ./modflow6/.github/actions/build-petsc-win
9+
10+
- name: Setup NetCDF
11+
uses: ./modflow6/.github/actions/build-netcdf-win
12+
13+
- name: Build modflow6
14+
shell: cmd
15+
run: |
16+
unix2dos -n "%GITHUB_WORKSPACE%\modflow6\.github\common\compile_modflow6_extended.bat" "%TEMP%\compile_modflow6_extended.bat"
17+
"%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "%TEMP%\compile_modflow6_extended.bat"
18+
19+
- name: Show Meson logs
20+
if: failure()
21+
shell: bash
22+
working-directory: modflow6
23+
run: cat builddir/meson-logs/meson-log.txt
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Build NetCDF MF6 (Windows)
2+
description: Build NetCDF MODFLOW 6 on Windows
3+
runs:
4+
using: "composite"
5+
steps:
6+
7+
- name: Build modflow6
8+
shell: cmd
9+
run: |
10+
unix2dos -n "%GITHUB_WORKSPACE%\modflow6\.github\common\compile_modflow6_netcdf.bat" "%TEMP%\compile_modflow6_netcdf.bat"
11+
"%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "%TEMP%\compile_modflow6_netcdf.bat"
12+
13+
- name: Show Meson logs
14+
if: failure()
15+
shell: bash
16+
working-directory: modflow6
17+
run: |
18+
cat builddir/meson-logs/meson-log.txt
19+
cat builddir/build.ninja
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build NetCDF (Windows)
2+
description: Build NetCDF on Windows
3+
runs:
4+
using: "composite"
5+
steps:
6+
7+
- name: Convert line endings
8+
shell: cmd
9+
run: |
10+
unix2dos -n "%GITHUB_WORKSPACE%\modflow6\.github\common\compile_netcdf.bat" "%TEMP%\compile_netcdf.bat"
11+
12+
- name: Install latest cmake and ninja
13+
uses: lukka/get-cmake@latest
14+
with:
15+
cmakeVersion: latest
16+
ninjaVersion: latest
17+
18+
- name: Setup oneAPI
19+
uses: ./modflow6/.github/actions/setup-par-oneapi
20+
21+
- name: Setup 7-zip
22+
uses: milliewalky/setup-7-zip@v1
23+
24+
- name: Download NetCDF-C
25+
shell: bash
26+
run: |
27+
mkdir -p netcdf/netCDF4.9.2-NC4-64
28+
cd netcdf/netCDF4.9.2-NC4-64
29+
curl https://downloads.unidata.ucar.edu/netcdf-c/4.9.2/netCDF4.9.2-NC4-64.exe -O -J
30+
7z x netCDF4.9.2-NC4-64.exe -aou
31+
32+
- name: Download NetCDF-Fortran
33+
shell: bash
34+
run: |
35+
mkdir -p netcdf/netcdf-fortran-4.6.1/build
36+
cd netcdf/netcdf-fortran-4.6.1
37+
curl https://downloads.unidata.ucar.edu/netcdf-fortran/4.6.1/netcdf-fortran-4.6.1.zip -O -J
38+
unzip netcdf-fortran-4.6.1.zip
39+
40+
- name: Build NetCDF
41+
shell: cmd
42+
run: |
43+
"%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "%TEMP%\compile_netcdf.bat"
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Test extended MF6 (Windows)
2+
description: Build and test extended MODFLOW 6 on Windows
3+
runs:
4+
using: "composite"
5+
steps:
6+
7+
- name: Build MF6 parallel
8+
uses: ./modflow6/.github/actions/build-extended-win
9+
10+
- name: Update flopy
11+
working-directory: modflow6
12+
shell: cmd
13+
run: pixi run update-flopy
14+
15+
- name: Get executables
16+
working-directory: modflow6/autotest
17+
shell: cmd
18+
env:
19+
GITHUB_TOKEN: ${{ github.token }}
20+
run: pixi run get-exes
21+
22+
- name: Convert unix2dos
23+
shell: cmd
24+
run: |
25+
unix2dos -n "%GITHUB_WORKSPACE%\modflow6\.github\common\test_modflow6_parallel.bat" "%TEMP%\test_modflow6_parallel.bat"
26+
unix2dos -n "%GITHUB_WORKSPACE%\modflow6\.github\common\test_modflow6_serial.bat" "%TEMP%\test_modflow6_serial.bat"
27+
unix2dos -n "%GITHUB_WORKSPACE%\modflow6\.github\common\test_modflow6_netcdf.bat" "%TEMP%\test_modflow6_netcdf.bat"
28+
29+
- name: Test programs (parallel)
30+
if: github.ref_name != 'master'
31+
shell: cmd
32+
env:
33+
REPOS_PATH: ${{ github.workspace }}
34+
run: |
35+
"%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "%TEMP%\test_modflow6_parallel.bat"
36+
37+
- name: Test programs (parallel)
38+
if: github.ref_name == 'master'
39+
shell: cmd
40+
env:
41+
REPOS_PATH: ${{ github.workspace }}
42+
MARKERS: not developmode
43+
run: |
44+
"%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "%TEMP%\test_modflow6_parallel.bat"
45+
46+
- name: Test programs (netcdf)
47+
if: github.ref_name != 'master'
48+
shell: cmd
49+
env:
50+
REPOS_PATH: ${{ github.workspace }}
51+
run: |
52+
"%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "%TEMP%\test_modflow6_netcdf.bat"
53+
54+
- name: Test programs (netcdf)
55+
if: github.ref_name == 'master'
56+
shell: cmd
57+
env:
58+
REPOS_PATH: ${{ github.workspace }}
59+
MARKERS: not developmode
60+
run: |
61+
"%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "%TEMP%\test_modflow6_netcdf.bat"
62+
63+
- name: Test programs (serial)
64+
if: github.ref_name != 'master'
65+
shell: cmd
66+
env:
67+
REPOS_PATH: ${{ github.workspace }}
68+
run: |
69+
"%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "%TEMP%\test_modflow6_serial.bat"
70+
71+
- name: Test programs (serial)
72+
if: github.ref_name == 'master'
73+
shell: cmd
74+
env:
75+
REPOS_PATH: ${{ github.workspace }}
76+
MARKERS: not developmode
77+
run: |
78+
"%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "%TEMP%\test_modflow6_serial.bat"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Test NetCDF MF6 (Windows)
2+
description: Build and test NetCDF MODFLOW 6 on Windows
3+
runs:
4+
using: "composite"
5+
steps:
6+
7+
- name: Build MF6 NetCDF
8+
uses: ./modflow6/.github/actions/build-netcdf-win
9+
10+
- name: Build MF6 NetCDF
11+
uses: ./modflow6/.github/actions/build-netcdf-mf6
12+
13+
- name: Update flopy
14+
working-directory: modflow6
15+
shell: cmd
16+
run: pixi run update-flopy
17+
18+
- name: Get executables
19+
working-directory: modflow6/autotest
20+
shell: cmd
21+
env:
22+
GITHUB_TOKEN: ${{ github.token }}
23+
run: pixi run get-exes
24+
25+
- name: Convert unix2dos
26+
shell: cmd
27+
run: |
28+
unix2dos -n "%GITHUB_WORKSPACE%\modflow6\.github\common\test_modflow6_netcdf.bat" "%TEMP%\test_modflow6_netcdf.bat"
29+
30+
- name: Test programs
31+
if: github.ref_name != 'master'
32+
shell: cmd
33+
env:
34+
REPOS_PATH: ${{ github.workspace }}
35+
run: |
36+
"%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "%TEMP%\test_modflow6_netcdf.bat"
37+
38+
- name: Test programs
39+
if: github.ref_name == 'master'
40+
shell: cmd
41+
env:
42+
REPOS_PATH: ${{ github.workspace }}
43+
MARKERS: not developmode
44+
run: |
45+
"%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "%TEMP%\test_modflow6_netcdf.bat"
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Test NetCDF MF6
2+
description: Build and test NetCDF MODFLOW 6
3+
runs:
4+
using: "composite"
5+
steps:
6+
7+
- name: Setup GNU Fortran
8+
uses: fortran-lang/setup-fortran@v1
9+
with:
10+
compiler: gcc
11+
version: 13
12+
13+
- name: Install netcdf
14+
if: runner.os == 'Linux'
15+
shell: bash
16+
run: |
17+
sudo apt-get update
18+
sudo apt-get install build-essential \
19+
libnetcdf-dev \
20+
libnetcdff-dev \
21+
netcdf-bin
22+
nc-config --all
23+
nf-config --all
24+
25+
- name: Install netcdf
26+
if: runner.os == 'macOS'
27+
shell: bash
28+
run: |
29+
brew install netcdf-fortran
30+
nc-config --all
31+
nf-config
32+
33+
- name: Build modflow6
34+
shell: bash
35+
working-directory: modflow6
36+
run: |
37+
pixi run setup -Dnetcdf=true builddir
38+
pixi run build builddir
39+
pixi run test builddir
40+
41+
- name: Show Meson logs
42+
if: failure()
43+
shell: bash
44+
working-directory: modflow6
45+
run: cat builddir/meson-logs/meson-log.txt
46+
47+
- name: Update flopy
48+
shell: bash
49+
working-directory: modflow6
50+
run: pixi run update-flopy
51+
52+
- name: Get executables
53+
shell: bash
54+
working-directory: modflow6
55+
env:
56+
GITHUB_TOKEN: ${{ github.token }}
57+
run: pixi run get-exes
58+
59+
- name: Test programs
60+
shell: bash
61+
working-directory: modflow6
62+
env:
63+
REPOS_PATH: ${{ github.workspace }}
64+
run: pixi run autotest --netcdf -k "test_netcdf"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
set FC=ifort
2+
cd "%GITHUB_WORKSPACE%\modflow6"
3+
pixi run setup -Dextended=true builddir
4+
pixi run build builddir
5+
pixi run test builddir
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set FC=ifort
2+
cd "%GITHUB_WORKSPACE%\modflow6"
3+
pixi run setup -Dnetcdf=true builddir
4+
pixi run build builddir

.github/common/compile_netcdf.bat

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
cd "%GITHUB_WORKSPACE%\netcdf\netcdf-fortran-4.6.1\build"
2+
3+
:: build/install static libs
4+
cmake --fresh -G Ninja -DCMAKE_Fortran_COMPILER="C:/Program Files (x86)/Intel/oneAPI/compiler/latest/bin/ifort.exe" -DCMAKE_BUILD_TYPE=Release -DNETCDF_C_LIBRARY="%GITHUB_WORKSPACE%/netcdf/netCDF4.9.2-NC4-64/lib/netcdf.lib" -DNETCDF_C_INCLUDE_DIR="%GITHUB_WORKSPACE%/netcdf/netCDF4.9.2-NC4-64/include" -DBUILD_SHARED_LIBS=0 -DCMAKE_INSTALL_PREFIX="%GITHUB_WORKSPACE%/netcdf/netcdf-fortran-4.6.1/build" ../netcdf-fortran-4.6.1
5+
cmake --build .
6+
cmake –install .
7+
8+
:: build/install shared libs
9+
cmake --fresh -G Ninja -DCMAKE_Fortran_COMPILER="C:/Program Files (x86)/Intel/oneAPI/compiler/latest/bin/ifort.exe" -DCMAKE_BUILD_TYPE=Release -DNETCDF_C_LIBRARY="%GITHUB_WORKSPACE%/netcdf/netCDF4.9.2-NC4-64/lib/netcdf.lib" -DNETCDF_C_INCLUDE_DIR="%GITHUB_WORKSPACE%/netcdf/netCDF4.9.2-NC4-64/include" -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_PREFIX="%GITHUB_WORKSPACE%/netcdf/netcdf-fortran-4.6.1/build" ../netcdf-fortran-4.6.1
10+
cmake --build .
11+
cmake –install .
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cd "%GITHUB_WORKSPACE%\modflow6\autotest"
2+
ldd ..\bin\mf6
3+
pixi run pytest -v --durations=0 --keep-failed .failed --netcdf -k "test_netcdf" -m "%MARKERS%"

0 commit comments

Comments
 (0)