4
4
# On push, only run if any of the metapackage files has changed
5
5
push :
6
6
paths :
7
- - ' src/*meta*.f90'
7
+ - ' src/*meta*.f90'
8
8
- ' src/fpm/*meta*.f90'
9
9
- ' src/fpm/manifest/*meta*.f90'
10
10
- ' src/ci/meta_tests.sh'
11
11
- ' src/.github/workflows/meta.yml'
12
- # Always run on PR or release
12
+ # Always run on PR or release
13
13
pull_request :
14
14
release :
15
15
types : [published]
16
16
# Allow manual triggering
17
- workflow_dispatch :
17
+ workflow_dispatch :
18
18
19
19
env :
20
20
CI : " ON" # We can detect this in the build system and other vendors implement it
@@ -44,14 +44,13 @@ jobs:
44
44
- os : macos-13
45
45
mpi : mpich
46
46
47
-
48
47
steps :
49
48
- name : Checkout code
50
49
uses : actions/checkout@v4
51
50
52
51
- name : (Ubuntu/macOS) setup gcc version
53
52
if : contains(matrix.os,'ubuntu') || contains(matrix.os,'macos')
54
- run : |
53
+ run : |
55
54
echo "GCC_V=14" >> $GITHUB_ENV
56
55
57
56
- name : (Windows) Install MSYS2
@@ -67,24 +66,11 @@ jobs:
67
66
unzip
68
67
curl
69
68
hdf5
70
-
71
- - name : (Windows) Setup VS Build environment
72
- if : contains(matrix.os,'windows') && contains(matrix.mpi,'intel')
73
- uses : seanmiddleditch/gha-setup-vsdevenv@master
74
-
75
- - name : (Windows) Retrieve Intel toolchain
76
- if : contains(matrix.os,'windows') && contains(matrix.mpi,'intel')
77
- shell : pwsh
78
- working-directory : C:\TEMP
79
- run : |
80
- curl.exe --output webimage.exe --url https://registrationcenter-download.intel.com/akdlm/irc_nas/19085/w_HPCKit_p_2023.0.0.25931_offline.exe --retry 5 --retry-delay 5
81
- Start-Process -FilePath "webimage.exe" -ArgumentList "-s -x -f oneAPI --log extract.log" -Wait
82
- Remove-Item "webimage.exe" -Force
83
- Start-Process -FilePath "oneAPI\bootstrapper.exe" -ArgumentList "-s --action install --eula=accept --components=""intel.oneapi.win.cpp-compiler:intel.oneapi.win.ifort-compiler:intel.oneapi.win.mpi.devel"" -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 --log-dir=." -Wait
84
- Remove-Item "oneAPI" -Force -Recurse
69
+ netcdf
70
+ netcdf-fortran
85
71
86
72
- name : (Ubuntu) Install gfortran
87
- if : contains(matrix.os,'ubuntu')
73
+ if : contains(matrix.os,'ubuntu')
88
74
run : |
89
75
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
90
76
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
@@ -94,45 +80,76 @@ jobs:
94
80
if : contains(matrix.os,'ubuntu') && contains(matrix.mpi,'openmpi')
95
81
run : |
96
82
sudo apt-get update
97
- sudo apt install -y -q openmpi-bin libopenmpi-dev hwloc fabric libhdf5-dev libhdf5-fortran-102
83
+ sudo apt install -y -q openmpi-bin libopenmpi-dev hwloc fabric libhdf5-dev \
84
+ libhdf5-fortran-102 libnetcdf-dev libnetcdff-dev
98
85
99
86
- name : (Ubuntu) Install MPICH
100
87
if : contains(matrix.os,'ubuntu') && contains(matrix.mpi,'mpich')
101
88
run : |
102
89
sudo apt-get update
103
- sudo apt install -y -q mpich hwloc fabric libhdf5-dev libhdf5-fortran-102
90
+ sudo apt install -y -q mpich hwloc fabric libhdf5-dev libhdf5-fortran-102 \
91
+ libnetcdf-dev libnetcdff-dev
104
92
105
- - name : (Ubuntu) Retrieve Intel toolchain
106
- if : contains(matrix.os,'ubuntu') && contains(matrix.mpi,'intel')
107
- timeout-minutes : 1
108
- run : |
109
- wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
110
- echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
111
- sudo apt-get update
93
+ # Intel
112
94
113
- - name : (Ubuntu) Install Intel oneAPI
114
- if : contains(matrix.os,'ubuntu') && contains(matrix.mpi,'intel')
115
- uses :
fortran-lang/[email protected]
116
- id : setup-fortran
95
+ - name : Setup Intel Environment
96
+ if : contains(matrix.mpi, 'intel')
97
+ uses : ./.github/actions/setup-intel
117
98
with :
118
- compiler : intel
119
- version : 2024.1.0
99
+ os : ${{ matrix.os }}
120
100
121
- - name : (Ubuntu) finalize oneAPI environment
122
- if : contains(matrix.os,'ubuntu') && contains(matrix.mpi,'intel')
101
+ - name : (Ubuntu) Build and Install HDF5 from source
102
+ if : contains(matrix.os, 'ubuntu') && contains(matrix.mpi, 'intel')
103
+ # Needs checkout if source code isn't available, adjust if needed
104
+ # Ensure compilers are available from the previous step's environment setup
105
+ shell : bash
123
106
run : |
124
- # Install MPI
125
- sudo apt-get install -y -q intel-oneapi-mpi-devel ninja-build cmake
107
+ # Source again just in case shell context is lost (shouldn't be, but safer)
126
108
source /opt/intel/oneapi/setvars.sh --force
127
- printenv >> $GITHUB_ENV
128
- # To run HDF5 with oneAPI, we need to build it from source. Use CMake to generate pkg-config info
109
+ # Download HDF5
129
110
curl -O -L https://github.com/HDFGroup/hdf5/archive/refs/tags/snapshot-1.14.tar.gz
130
111
tar zxf snapshot-1.14.tar.gz
131
112
cd hdf5-snapshot-1.14
113
+ # Configure HDF5 with Intel compilers
132
114
cmake -B build -DCMAKE_Fortran_COMPILER=ifx -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DHDF5_BUILD_FORTRAN=ON -DCMAKE_INSTALL_PREFIX=/usr
133
115
cd build
134
- make -j
116
+ make -j $(nproc)
135
117
sudo make install
118
+ cd ../.. # Go back to workspace directory
119
+ rm -rf hdf5-snapshot-1.14 snapshot-1.14.tar.gz # Clean up
120
+
121
+ - name : (Ubuntu) Build and Install NetCDF-C from source
122
+ if : contains(matrix.os, 'ubuntu') && contains(matrix.mpi, 'intel')
123
+ shell : bash
124
+ run : |
125
+ source /opt/intel/oneapi/setvars.sh --force
126
+ # Download NetCDF-C
127
+ curl -L https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.9.2.tar.gz -o - | tar xz
128
+ cd netcdf-c-4.9.2
129
+ # Configure NetCDF-C with Intel Compilers, referencing installed HDF5
130
+ # Set CC/CXX/FC explicitly in environment for configure script
131
+ export CC=icx CXX=icpx FC=ifx
132
+ ./configure --prefix=/usr --enable-netcdf-4 --with-hdf5=/usr
133
+ make -j $(nproc)
134
+ sudo make install
135
+ cd .. # Go back to workspace directory
136
+ rm -rf netcdf-c-4.9.2 # Clean up
137
+
138
+ - name : (Ubuntu) Build and Install NetCDF-Fortran from source
139
+ if : contains(matrix.os, 'ubuntu') && contains(matrix.mpi, 'intel')
140
+ shell : bash
141
+ run : |
142
+ source /opt/intel/oneapi/setvars.sh --force
143
+ # Download NetCDF-Fortran
144
+ curl -L https://github.com/Unidata/netcdf-fortran/archive/refs/tags/v4.6.1.tar.gz -o - | tar xz
145
+ cd netcdf-fortran-4.6.1
146
+ # Configure NetCDF-Fortran with Intel Compilers using CMake
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 $(nproc)
150
+ sudo make install
151
+ cd ../.. # Go back to workspace directory
152
+ rm -rf netcdf-fortran-4.6.1 # Clean up
136
153
137
154
- name : (Windows) Put MSYS2_MinGW64 on PATH
138
155
if : contains(matrix.os,'windows') && (!contains(matrix.mpi,'intel'))
@@ -153,26 +170,13 @@ jobs:
153
170
# can't use MSMPI_BIN as Actions doesn't update PATH from msmpisetup.exe
154
171
run : Test-Path "C:\Program Files\Microsoft MPI\Bin\mpiexec.exe" -PathType leaf
155
172
156
- - name : (Windows) test that OneAPI is installed
157
- if : contains(matrix.os,'windows') && contains(matrix.mpi,'intel')
158
- run : |
159
- Test-Path -Path "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" -PathType leaf
160
- Test-Path -Path "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\env\vars.bat" -PathType leaf
161
-
162
173
- name : (Windows) put MSMPI_BIN on PATH (where mpiexec is)
163
174
if : contains(matrix.os,'windows') && contains(matrix.mpi,'msmpi')
164
175
run : |
165
176
echo "C:\Program Files\Microsoft MPI\Bin\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
166
177
echo "/c/Program Files/Microsoft MPI/Bin/" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
167
178
echo "MSMPI_BIN=C:\Program Files\Microsoft MPI\Bin\" | Out-File -FilePath $env:GITHUB_ENV -Append
168
179
169
- - name : (Windows) load OneAPI environment variables
170
- if : contains(matrix.os,'windows') && contains(matrix.mpi,'intel')
171
- shell : cmd
172
- run : |
173
- "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
174
- "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\env\vars.bat"
175
-
176
180
- name : (Windows) Install MSYS2 msmpi package
177
181
if : contains(matrix.os,'windows') && contains(matrix.mpi,'msmpi')
178
182
shell : msys2 {0}
@@ -214,8 +218,14 @@ jobs:
214
218
215
219
- name : (macOS) Install homebrew HDF5
216
220
if : contains(matrix.os,'macos')
217
- run : |
218
- brew install hdf5
221
+ run : |
222
+ brew install hdf5
223
+
224
+ - name : (macOS) Install homebrew NetCDF
225
+ if : contains(matrix.os,'macos')
226
+ run : |
227
+ brew install netcdf
228
+ brew install netcdf-fortran
219
229
220
230
# Phase 1: Bootstrap fpm with existing version
221
231
- name : Install fpm
0 commit comments