-
Notifications
You must be signed in to change notification settings - Fork 2
279 lines (239 loc) · 10.2 KB
/
make_test.yml
File metadata and controls
279 lines (239 loc) · 10.2 KB
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
name: Build GPEC
on:
workflow_dispatch:
pull_request:
branches: [develop]
jobs:
build-netcdf-gfortran:
runs-on: ubuntu-latest
env:
PREFIX: ${{ github.workspace }}/deps
FC: gfortran
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore NetCDF-gfortran cache
id: netcdf-cache
uses: actions/cache@v4
with:
path: ${{ env.PREFIX }}
key: ${{ runner.os }}-netcdf-gfortran-v1
- name: Install dependencies
if: steps.netcdf-cache.outputs.cache-hit != 'true'
run: |
sudo rm /var/lib/man-db/auto-update
sudo apt update
sudo apt install -y build-essential gfortran m4 curl libhdf5-dev libnetcdf-dev
- name: Build NetCDF-Fortran 4.6.1
if: steps.netcdf-cache.outputs.cache-hit != 'true'
run: |
mkdir -p $PREFIX/src
cd $PREFIX/src
curl -L -o netcdf-fortran.tar.gz https://github.com/Unidata/netcdf-fortran/archive/refs/tags/v4.6.1.tar.gz
tar xf netcdf-fortran.tar.gz
cd netcdf-fortran-4.6.1
export CPPFLAGS="-I/usr/include/hdf5/serial"
export LDFLAGS="-L/usr/lib/x86_64-linux-gnu/hdf5/serial"
export LIBS="-lnetcdf -lhdf5 -lhdf5_hl -lm -lz"
echo "::group::Configure log"
./configure --prefix=$PREFIX --enable-shared --disable-static || (cat config.log && exit 1)
echo "::endgroup::"
make -j$(nproc)
make check
make install
- name: Confirm cache result
run: |
if [ "${{ steps.netcdf-cache.outputs.cache-hit }}" = "true" ]; then
echo "Cache found. Skipping build."
else
echo "Cache not found. Built from source."
fi
- name: Confirm all shared libs
run: |
ls -lh $PREFIX/lib
ls -lh $PREFIX/include
build-netcdf-ifort:
runs-on: ubuntu-latest
env:
PREFIX: ${{ github.workspace }}/deps
ONEAPI_ROOT: /opt/intel/oneapi
FC: ifort
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Try restore NetCDF-ifort cache
id: netcdf-cache
uses: actions/cache@v4
with:
path: ${{ env.PREFIX }}
key: ${{ runner.os }}-netcdf-ifort-v1
- name: Install Intel oneAPI + deps
if: steps.netcdf-cache.outputs.cache-hit != 'true'
run: |
sudo rm /var/lib/man-db/auto-update
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
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
sudo apt update
sudo apt install -y curl gnupg lsb-release build-essential m4 curl libhdf5-dev libnetcdf-dev
sudo apt install -y intel-oneapi-compiler-fortran-2022.2.1
- name: Source oneAPI and check ifort
if: steps.netcdf-cache.outputs.cache-hit != 'true'
shell: bash
run: |
source /opt/intel/oneapi/setvars.sh
echo "Which ifort: $(which ifort)"
ifort --version
- name: Build NetCDF-Fortran 4.6.1 with ifort
if: steps.netcdf-cache.outputs.cache-hit != 'true'
run: |
source /opt/intel/oneapi/setvars.sh
mkdir -p $PREFIX/src
cd $PREFIX/src
curl -L -o netcdf-fortran.tar.gz https://github.com/Unidata/netcdf-fortran/archive/refs/tags/v4.6.1.tar.gz
tar xf netcdf-fortran.tar.gz
cd netcdf-fortran-4.6.1
export CPPFLAGS="-I/usr/include -I/usr/include/hdf5/serial"
export LDFLAGS="-L/usr/lib -L/usr/lib/x86_64-linux-gnu/hdf5/serial"
export LIBS="-lnetcdf -lhdf5 -lhdf5_hl -lm -lz"
echo "::group::Configure log"
./configure --prefix=$PREFIX --enable-shared --disable-static || (cat config.log && exit 1)
echo "::endgroup::"
make -j$(nproc)
make check
make install
- name: Confirm cache result
run: |
if [ "${{ steps.netcdf-cache.outputs.cache-hit }}" = "true" ]; then
echo "Cache found. Skipping build."
else
echo "Cache not found. Built from source."
fi
- name: Confirm all shared libs
run: |
ls -lh $PREFIX/lib
ls -lh $PREFIX/include
make_gpec_gfortran:
runs-on: ubuntu-latest
needs: build-netcdf-gfortran
env:
PREFIX: ${{ github.workspace }}/deps
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore NetCDF-gfortran cache
uses: actions/cache@v4
with:
path: ${{ env.PREFIX }}
key: ${{ runner.os }}-netcdf-gfortran-v1
- name: Rewrite .gitmodules to use HTTPS
run: |
git config --file .gitmodules submodule.harvest.url https://github.com/gafusion/harvest_client.git
git submodule sync
git submodule update --init --recursive
- name: Install Dependencies
run: |
sudo rm /var/lib/man-db/auto-update
sudo apt update
sudo apt install -y gfortran libopenblas-dev libx11-dev libnetcdf-dev
- name: Compile
run: |
cd install
export NETCDF_C_HOME=/usr
export NETCDF_FORTRAN_HOME=$PREFIX
export LAPACKHOME=/usr
export FC=/usr/bin/gfortran
export CC=/usr/bin/gcc
export FFLAGS='-fallow-argument-mismatch -O0 -Wall -Wextra -fcheck=all,no-array-temps -fbacktrace -finit-real=snan -finit-integer=-9999 -fstack-protector-all -fsanitize=bounds -Wno-array-temporaries -Wno-unused-variable -Wno-unused-dummy-argument -Wno-compare-reals -Wno-unused-parameter -Wno-unused-label -fno-omit-frame-pointer -frecord-marker=4 -gdwarf-4 -ffloat-store -fbounds-check'
make
- name: Run Soloviev ideal example
run: |
export GPECHOME=$(pwd)
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
cd docs/examples/regression_solovev_ideal_example
ulimit -s unlimited
../../../bin/dcon && ../../../bin/gpec && ../../../bin/stride && ../../../bin/pentrc
- name: Run Soloviev kinetic example
run: |
export GPECHOME=$(pwd)
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
cd docs/examples/regression_solovev_kinetic_example
ulimit -s unlimited
../../../bin/dcon && ../../../bin/gpec && ../../../bin/pentrc
- name: Run Soloviev resistive example
run: |
export GPECHOME=$(pwd)
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
cd docs/examples/regression_solovev_resistive_example
ulimit -s unlimited
../../../bin/rdcon && ../../../bin/rmatch && ../../../bin/gpec && ../../../bin/stride
make_gpec_ifort:
runs-on: ubuntu-latest
needs: build-netcdf-ifort
env:
PREFIX: ${{ github.workspace }}/deps
ONEAPI_ROOT: /opt/intel/oneapi
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore NetCDF-ifort cache
uses: actions/cache@v4
with:
path: ${{ env.PREFIX }}
key: ${{ runner.os }}-netcdf-ifort-v1
- name: Install Intel oneAPI + deps
run: |
sudo rm /var/lib/man-db/auto-update
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
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
sudo apt update
sudo apt install -y curl gnupg lsb-release build-essential m4 curl libhdf5-dev libnetcdf-dev
sudo apt install -y intel-oneapi-compiler-fortran-2022.2.1 intel-oneapi-mkl-2022.2.1 libx11-dev libnetcdf-dev
- name: Source oneAPI and check ifort and icx
shell: bash
run: |
source /opt/intel/oneapi/setvars.sh
echo "Which ifort: $(which ifort)"
ifort --version
- name: Rewrite .gitmodules to use HTTPS
run: |
git config --file .gitmodules submodule.harvest.url https://github.com/gafusion/harvest_client.git
git submodule sync
git submodule update --init --recursive
- name: Compile
run: |
source /opt/intel/oneapi/setvars.sh
cd install
export NETCDF_C_HOME=/usr
export NETCDF_FORTRAN_HOME=$PREFIX
export MKLROOT=/opt/intel/oneapi/mkl/2022.2.1
export FC=/opt/intel/oneapi/compiler/2022.2.1/linux/bin/intel64/ifort
export CC=/usr/bin/gcc
export FFLAGS='-O0 -warn all -check all -check noarg_temp_created -traceback -fpe3 -fstack-protector -fopenmp'
make
- name: Run Soloviev ideal example
run: |
source /opt/intel/oneapi/setvars.sh
export GPECHOME=$(pwd)
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
export FOR_DISABLE_STACK_TRACE=TRUE
cd docs/examples/regression_solovev_ideal_example
ulimit -s unlimited
../../../bin/dcon && ../../../bin/gpec && ../../../bin/stride && ../../../bin/pentrc
- name: Run Soloviev kinetic example
run: |
source /opt/intel/oneapi/setvars.sh
export GPECHOME=$(pwd)
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
export FOR_DISABLE_STACK_TRACE=TRUE
cd docs/examples/regression_solovev_kinetic_example
ulimit -s unlimited
../../../bin/dcon && ../../../bin/gpec && ../../../bin/pentrc
- name: Run Soloviev resistive example
run: |
source /opt/intel/oneapi/setvars.sh
export GPECHOME=$(pwd)
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
export FOR_DISABLE_STACK_TRACE=TRUE
cd docs/examples/regression_solovev_resistive_example
ulimit -s unlimited
../../../bin/rdcon && ../../../bin/rmatch && ../../../bin/gpec && ../../../bin/stride