-
Notifications
You must be signed in to change notification settings - Fork 5
459 lines (397 loc) · 13.7 KB
/
gfortran.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
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
name: GFortran CI
on:
push:
branches: [ master ]
pull_request:
env:
# FFLAGS for building ABIN, applicable for most jobs
ABIN_FFLAGS: -O0 -fopenmp --coverage -ffpe-trap=invalid,zero,overflow,denormal -fimplicit-none -Wall -Wno-integer-division -Wno-maybe-uninitialized
ABIN_LDLIBS: --coverage
OPTIMIZED_FFLAGS: -O3 -fopenmp -fimplicit-none -Wall -Wno-integer-division
jobs:
basic_build:
name: Basic build
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
gcc_v: [7, 9, 10]
env:
FC: gfortran
GCC_V: ${{ matrix.gcc_v}}
CODECOV_NAME: ${{format('{0} GCC-{1}', github.job, matrix.gcc_v)}}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Set GFortran version
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
# pFUnit library is used to build and run unit tests
- name: pFUnit build Cache
id: pfunit-cache
uses: actions/cache@v2
with:
path: ~/pfunit/build/installed
# To force a pFUnit rebuild (bust the cache), make a change to install_pfunit.sh
key: ${{ runner.os }}-pfunit-gfortran${{ env.GCC_V }}-${{ hashFiles('dev_scripts/install_pfunit.sh') }}
- name: Download and build pFUnit
if: steps.pfunit-cache.outputs.cache-hit != 'true'
run: ./dev_scripts/install_pfunit.sh ${HOME}/pfunit
- name: Build ABIN
run: ./configure --pfunit ${HOME}/pfunit/build/installed/ && make
env:
FFLAGS: ${{ env.ABIN_FFLAGS }}
LDLIBS: ${{ env.ABIN_LDLIBS }}
- name: Run Unit tests
run: make unittest && cd src/ && gcov *.o
- name: Codecov upload unit tests
uses: codecov/codecov-action@v3
with:
name: ${{env.CODECOV_NAME}}
flags: unittests
gcov: false
- name: Run End-to-End tests
run: make e2etest && cd src/ && gcov *.o
- name: Codecov upload
uses: codecov/codecov-action@v3
with:
name: ${{env.CODECOV_NAME}}
fail_ci_if_error: true
verbose: true
gcov: false
intel_build:
name: Intel OneAPI build
runs-on: ubuntu-20.04
env:
FC: mpiifort
# Use GCC for C++ code to speed up the build
#CC: icc
#CXX: icpc
APT_PACKAGES: >-
intel-oneapi-compiler-fortran
intel-oneapi-mpi
intel-oneapi-mpi-devel
# intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Add Intel repository
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
- name: Install Intel oneAPI compiler
run: |
sudo apt-get install ${{ env.APT_PACKAGES }}
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
- name: Build ABIN
run: ./configure --mpi "" && make
env:
FFLAGS: -O0 -fopenmp -warn all,noextern
- name: Run End-to-End tests
run: make e2etest
tcpb_build:
name: TCPB build
# NOTE: tcpb-cpp fails to build on Ubuntu 18.04,
# probably because of old libprotobuf library?
runs-on: ubuntu-20.04
needs: basic_build
env:
FC: gfortran
GCC_V: 9
CODECOV_NAME: ${{format('{0} GCC9', github.job)}}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Install protocol buffers library
run: sudo apt install protobuf-compiler
- name: TCBP build cache
id: tcpb-cache
uses: actions/cache@v2
with:
path: ~/tcpb-cpp/lib
# To force a rebuild (bust the cache), make a change to install_tcpb.sh
key: ${{ runner.os }}-tcpb-gfortran${{ env.GCC_V }}-${{ hashFiles('dev_scripts/install_tcpb.sh') }}
- name: Download and build tcpb_cpp
if: steps.tcpb-cache.outputs.cache-hit != 'true'
run: ./dev_scripts/install_tcpb.sh ${HOME}/tcpb-cpp
- name: Build ABIN
run: ./configure --tcpb ${HOME}/tcpb-cpp/lib && make
env:
FFLAGS: ${{ env.ABIN_FFLAGS }}
LDLIBS: ${{ env.ABIN_LDLIBS }}
- name: Run End-to-End tests
run: make e2etest && cd src/ && gcov *.o
- name: Codecov upload
uses: codecov/codecov-action@v3
with:
name: tcpb
fail_ci_if_error: true
verbose: true
gcov: false
optimized_build:
name: Optimized build
runs-on: ubuntu-18.04
needs: basic_build
strategy:
matrix:
gcc_v: [7, 9, 10]
env:
FC: gfortran
GCC_V: ${{ matrix.gcc_v}}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Set GFortran version
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V}
- name: pFUnit build Cache
id: pfunit-cache
uses: actions/cache@v2
with:
path: ~/pfunit/build/installed
key: ${{ runner.os }}-pfunit-gfortran${{ env.GCC_V }}-${{ hashFiles('dev_scripts/install_pfunit.sh') }}
- name: Download and build pFUnit
if: steps.pfunit-cache.outputs.cache-hit != 'true'
run: ./dev_scripts/install_pfunit.sh ${HOME}/pfunit
- name: build ABIN
run: ./configure --pfunit ${HOME}/pfunit/build/installed/ && make
env:
FFLAGS: ${{ env.OPTIMIZED_FFLAGS }}
- name: Run Unit tests
run: make unittest
- name: Run End-to-End tests
run: make e2etest
# Here we just take the defaults everywhere, except turning on FFTW
# To use FFTW with other Gfortran versions, we would need to build it.
fftw_build:
# NOTE: I tried using `ubuntu-20.04` instead of `ubuntu-18.04`.
# https://github.com/actions/virtual-environments#available-environments
# However, some tests started to fail, with small numerical differences ~1E-15.
# Not sure why, since default gfortran on 20.04 is 9.3.0, i.e. the same as we already
# test above. I tested this with both -O0 and -O2.
runs-on: ubuntu-18.04
name: FFTW build
needs: basic_build
strategy:
fail-fast: false
matrix:
gcc_v: [7]
env:
GCC_V: ${{ matrix.gcc_v}}
CODECOV_NAME: ${{format('{0} GCC-{1}', github.job, matrix.gcc_v)}}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Install FFTW libraries
run: sudo apt-get install libfftw3-dev
- name: pFUnit build Cache
id: pfunit-cache
uses: actions/cache@v2
with:
path: ~/pfunit/build/installed
key: ${{ runner.os }}-pfunit-gfortran${{ env.GCC_V }}-${{ hashFiles('dev_scripts/install_pfunit.sh') }}
- name: Download and build pFUnit
if: steps.pfunit-cache.outputs.cache-hit != 'true'
run: ./dev_scripts/install_pfunit.sh ${HOME}/pfunit
- name: Build ABIN
run: ./configure --pfunit ${HOME}/pfunit/build/installed/ --fftw && make
env:
FFLAGS: ${{ env.ABIN_FFLAGS }}
LDLIBS: ${{ env.ABIN_LDLIBS }}
- name: Run Unit tests
run: make unittest
- name: Codecov upload unit tests
uses: codecov/codecov-action@v3
with:
name: ${{env.CODECOV_NAME}}
flags: unittests
gcov: true
- name: Run End-to-End tests
run: make e2etest
- name: Codecov upload
uses: codecov/codecov-action@v3
with:
name: ${{env.CODECOV_NAME}}
fail_ci_if_error: true
gcov: true
mpich_build:
name: MPICH build
runs-on: ubuntu-18.04
timeout-minutes: 25
needs: basic_build
strategy:
fail-fast: false
matrix:
gcc_v: [7, 10]
mpich_v: ["3.4.3", "4.0.2"]
env:
# To speed-up MPICH build
CFLAGS: -O0
GCC_V: ${{ matrix.gcc_v}}
MPICH_V: ${{matrix.mpich_v}}
CODECOV_NAME: ${{format('{0} GCC-{1} MPICH-{2}', github.job, matrix.gcc_v, matrix.mpich_v)}}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Set GFortran version
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
- name: MPICH build Cache
id: mpich-cache
uses: actions/cache@v2
with:
path: ~/mpich/${{ env.MPICH_V }}/install
key: ${{runner.os}}-mpich${{ env.MPICH_V }}-gfortran${{ env.GCC_V }}-${{hashFiles('dev_scripts/install_mpich.sh')}}
- name: Build and Install MPICH
if: steps.mpich-cache.outputs.cache-hit != 'true'
# Without the extra "-fallow-argument-mismatch" FFLAG, configure with GFortran-10 fails with:
# "The Fortran compiler gfortran does not accept programs
# that call the same routine with arguments of different types"
# Unfortunately, previous GCC versions do not have this flag
# so we need to set it conditionally.
# MPICH 4.0 also needs FCFLAGS set.
# We also need to set it for ABIN compilation below.
run: |
if [ $GCC_V -eq 10 ];then export FFLAGS="-fallow-argument-mismatch";export FCFLAGS="-fallow-argument-mismatch";fi && \
./dev_scripts/install_mpich.sh ${HOME}/mpich ${MPICH_V}
- name: build ABIN
run: |
if [ $GCC_V -eq 10 ];then export FFLAGS="-fallow-argument-mismatch $FFLAGS";fi && \
./configure --mpi ${HOME}/mpich/${MPICH_V}/install && make
env:
FFLAGS: ${{ env.ABIN_FFLAGS }} -g
LDLIBS: ${{ env.ABIN_LDLIBS }}
- name: test ABIN
run: make test && cd src/ && gcov *.o
- name: Codecov upload
uses: codecov/codecov-action@v3
with:
name: ${{env.CODECOV_NAME}}
fail_ci_if_error: true
gcov: false
openmpi_build:
name: OpenMPI build
runs-on: ubuntu-18.04
timeout-minutes: 25
needs: basic_build
strategy:
fail-fast: false
# Let's just test one GFortran version, we do not really
# use OpenMPI with ABIN, and we already test all GCC
# versions with MPICH.
matrix:
gcc_v: [7]
env:
# To speed-up OpenMPI build
CFLAGS: -O0
GCC_V: ${{ matrix.gcc_v}}
CODECOV_NAME: ${{format('{0} GCC-{1} OpenMPI-4.0', github.job, matrix.gcc_v)}}
OPENMPI_V: "4.1"
OPENMPI_PATCH: "2"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Set GFortran version
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V}
- name: OpenMPI build cache
id: openmpi-cache
uses: actions/cache@v2
with:
path: ~/openmpi/${{ env.OPENMPI_V }}/install
key: ${{runner.os}}-openmpi${{ env.OPENMPI_V }}-gfortran${{ env.GCC_V }}-${{hashFiles('dev_scripts/install_openmpi.sh')}}
- name: Build and Install OpenMPI
if: steps.openmpi-cache.outputs.cache-hit != 'true'
run: ./dev_scripts/install_openmpi.sh ${HOME}/openmpi ${OPENMPI_V} ${OPENMPI_PATCH}
- name: build ABIN
run: ./configure --mpi "${HOME}/openmpi/${OPENMPI_V}/install" && make
env:
FFLAGS: ${{ env.ABIN_FFLAGS }}
LDLIBS: ${{ env.ABIN_LDLIBS }}
- name: test ABIN
run: make test
- name: Codecov upload
uses: codecov/codecov-action@v3
with:
name: ${{env.CODECOV_NAME}}
fail_ci_if_error: true
gcov: true
plumed_build:
name: PLUMED build
runs-on: ubuntu-18.04
needs: basic_build
strategy:
fail-fast: false
matrix:
plumed_v: [2.7.4, 2.8.0]
gcc_v: [7]
env:
PLUMED_V: ${{ matrix.plumed_v}}
GCC_V: ${{ matrix.gcc_v}}
# Speeding up the Plumed build
CFLAGS: -O0
CXXLAGS: -O0
CODECOV_NAME: ${{format('{0} GCC-{1} PLUMED-{2}', github.job, matrix.gcc_v, matrix.plumed_v)}}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Plumed build cache
id: plumed-cache
uses: actions/cache@v2
with:
path: ~/plumed/${{ env.PLUMED_V }}/install
key: ${{runner.os}}-plumed${{env.PLUMED_V}}-gcc${{ env.GCC_V }}-${{hashFiles('dev_scripts/install_plumed.sh')}}
- name: Build and Install PLUMED
if: steps.plumed-cache.outputs.cache-hit != 'true'
run: ./dev_scripts/install_plumed.sh ${HOME}/plumed ${PLUMED_V}
- name: pFUnit build Cache
id: pfunit-cache
uses: actions/cache@v2
with:
path: ~/pfunit/build/installed
key: ${{ runner.os }}-pfunit-gfortran${{ env.GCC_V }}-${{ hashFiles('dev_scripts/install_pfunit.sh') }}
- name: Download and build pFUnit
if: steps.pfunit-cache.outputs.cache-hit != 'true'
run: ./dev_scripts/install_pfunit.sh ${HOME}/pfunit
- name: build ABIN
run: |
./configure --plumed "${HOME}/plumed/${PLUMED_V}/install"\
--pfunit ~/pfunit/build/installed/ &&\
make
env:
FFLAGS: ${{ env.ABIN_FFLAGS }}
LDLIBS: ${{ env.ABIN_LDLIBS }}
- name: Run Unit tests
run: make unittest
- name: Codecov upload unit tests
uses: codecov/codecov-action@v3
with:
name: ${{env.CODECOV_NAME}}
flags: unittests
gcov: true
- name: Run End-to-End tests
run: make e2etest
- name: Codecov upload
uses: codecov/codecov-action@v3
with:
name: ${{env.CODECOV_NAME}}
fail_ci_if_error: true
gcov: true