Skip to content

Commit 3b03ab8

Browse files
committed
GitHub CI for NetCDF test
1 parent 5e29b96 commit 3b03ab8

File tree

1 file changed

+35
-14
lines changed

1 file changed

+35
-14
lines changed

.github/workflows/meta.yml

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ on:
44
# On push, only run if any of the metapackage files has changed
55
push:
66
paths:
7-
- 'src/*meta*.f90'
7+
- 'src/*meta*.f90'
88
- 'src/fpm/*meta*.f90'
99
- 'src/fpm/manifest/*meta*.f90'
1010
- 'src/ci/meta_tests.sh'
1111
- 'src/.github/workflows/meta.yml'
12-
# Always run on PR or release
12+
# Always run on PR or release
1313
pull_request:
1414
release:
1515
types: [published]
1616
# Allow manual triggering
17-
workflow_dispatch:
17+
workflow_dispatch:
1818

1919
env:
2020
CI: "ON" # We can detect this in the build system and other vendors implement it
@@ -51,7 +51,7 @@ jobs:
5151

5252
- name: (Ubuntu/macOS) setup gcc version
5353
if: contains(matrix.os,'ubuntu') || contains(matrix.os,'macos')
54-
run: |
54+
run: |
5555
echo "GCC_V=14" >> $GITHUB_ENV
5656
5757
- name: (Windows) Install MSYS2
@@ -67,6 +67,8 @@ jobs:
6767
unzip
6868
curl
6969
hdf5
70+
netcdf
71+
netcdf-fortran
7072
7173
- name: (Windows) Setup VS Build environment
7274
if: contains(matrix.os,'windows') && contains(matrix.mpi,'intel')
@@ -84,7 +86,7 @@ jobs:
8486
Remove-Item "oneAPI" -Force -Recurse
8587
8688
- name: (Ubuntu) Install gfortran
87-
if: contains(matrix.os,'ubuntu')
89+
if: contains(matrix.os,'ubuntu')
8890
run: |
8991
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
9092
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
@@ -94,13 +96,15 @@ jobs:
9496
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'openmpi')
9597
run: |
9698
sudo apt-get update
97-
sudo apt install -y -q openmpi-bin libopenmpi-dev hwloc fabric libhdf5-dev libhdf5-fortran-102
99+
sudo apt install -y -q openmpi-bin libopenmpi-dev hwloc fabric libhdf5-dev \
100+
libhdf5-fortran-102 libnetcdf-dev libnetcdff-dev
98101
99102
- name: (Ubuntu) Install MPICH
100103
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'mpich')
101104
run: |
102105
sudo apt-get update
103-
sudo apt install -y -q mpich hwloc fabric libhdf5-dev libhdf5-fortran-102
106+
sudo apt install -y -q mpich hwloc fabric libhdf5-dev libhdf5-fortran-102 \
107+
libnetcdf-dev libnetcdff-dev
104108
105109
- name: (Ubuntu) Retrieve Intel toolchain
106110
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'intel')
@@ -115,16 +119,16 @@ jobs:
115119
uses: fortran-lang/[email protected]
116120
id: setup-fortran
117121
with:
118-
compiler: intel
119-
version: 2024.1.0
122+
compiler: intel
123+
version: 2024.1.0
120124

121-
- name: (Ubuntu) finalize oneAPI environment
125+
- name: (Ubuntu) finalize oneAPI environment
122126
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'intel')
123127
run: |
124128
# Install MPI
125-
sudo apt-get install -y -q intel-oneapi-mpi-devel ninja-build cmake
129+
sudo apt-get install -y -q intel-oneapi-mpi-devel ninja-build cmake libcurl4-gnutls-dev
126130
source /opt/intel/oneapi/setvars.sh --force
127-
printenv >> $GITHUB_ENV
131+
printenv >> $GITHUB_ENV
128132
# To run HDF5 with oneAPI, we need to build it from source. Use CMake to generate pkg-config info
129133
curl -O -L https://github.com/HDFGroup/hdf5/archive/refs/tags/snapshot-1.14.tar.gz
130134
tar zxf snapshot-1.14.tar.gz
@@ -133,6 +137,17 @@ jobs:
133137
cd build
134138
make -j
135139
sudo make install
140+
curl -L https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.9.2.tar.gz -o - | tar xz
141+
cd netcdf-c-4.9.2
142+
CC=icx CXX=icpx FC=ifx ./configure --prefix=/usr --with-hdf5=/usr
143+
CC=icx CXX=icpx FC=ifx make -j
144+
sudo make install
145+
curl -L https://github.com/Unidata/netcdf-fortran/archive/refs/tags/v4.6.1.tar.gz -o - | tar xz
146+
cd netcdf-fortran-4.6.1
147+
cmake -B build -DCMAKE_Fortran_COMPILER=ifx -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DCMAKE_INSTALL_PREFIX=/usr
148+
cd build
149+
make -j
150+
sudo make install
136151
137152
- name: (Windows) Put MSYS2_MinGW64 on PATH
138153
if: contains(matrix.os,'windows') && (!contains(matrix.mpi,'intel'))
@@ -214,8 +229,14 @@ jobs:
214229
215230
- name: (macOS) Install homebrew HDF5
216231
if: contains(matrix.os,'macos')
217-
run: |
218-
brew install hdf5
232+
run: |
233+
brew install hdf5
234+
235+
- name: (macOS) Install homebrew NetCDF
236+
if: contains(matrix.os,'macos')
237+
run: |
238+
brew install netcdf
239+
brew install netcdf-fortran
219240
220241
# Phase 1: Bootstrap fpm with existing version
221242
- name: Install fpm

0 commit comments

Comments
 (0)