-
Notifications
You must be signed in to change notification settings - Fork 25
163 lines (143 loc) · 4.98 KB
/
ci.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
name: Continuous Integration testing
on: [push, pull_request]
env:
# This version of Meson should be available as an EasyBuild on Fram and Betzy
MESON_VERSION: '0.55.1'
jobs:
build:
name: Build BLOM on Github provided OS
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
mpi: [true, false]
openmp: ['enabled', 'disabled']
exclude:
# Do not build on macOS with MPI as that is having some dependency issues
- os: macos-latest
mpi: true
steps:
- name: Install dependencies - Ubuntu
run: |
sudo apt update
sudo apt install -y libnetcdff-dev mpi-default-dev ninja-build
if: runner.os == 'Linux'
- name: Install dependencies - macOS
run: brew install netcdf-fortran open-mpi ninja
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
if: runner.os == 'macOS'
- name: Setup Python for newer version of Meson
uses: actions/setup-python@v2
- name: Install Meson
run: python -m pip install meson==${{ env.MESON_VERSION }}
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Build
env:
CC: gcc-12
FC: gfortran-12
run: |
meson setup builddir -Dmpi=${{ matrix.mpi }} -Dopenmp=${{ matrix.openmp }} --buildtype=debugoptimized
meson compile -C builddir
- name: Test code
if: ${{ matrix.mpi == false }}
run: |
ulimit -s 65532
meson test -C builddir
- name: Upload test log
if: ${{ matrix.mpi == false }}
uses: actions/upload-artifact@v2
with:
name: testlog-${{ runner.os }}-gcc
path: builddir/meson-logs/testlog.txt
intel:
name: Build BLOM using Intel compilers
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
mpi: [true, false]
openmp: ['enabled', 'disabled']
ecosys: [true, false]
exclude:
# Run test (fuk95 executed with mpi=false) fails with ecosys
- ecosys: true
mpi: false
# Tell Meson to use Intel compilers
env:
CC: icc
FC: ifort
NFDIR: '/opt/netcdf'
steps:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y ninja-build libnetcdf-dev
- name: Cache Intel setup
id: cache-intel
uses: actions/cache@v2
with:
path: /opt/intel/
key: intel-${{ runner.os }}-compiler
- name: Setup Intel compiler
if: steps.cache-intel.outputs.cache-hit != 'true'
run: |
wget -q 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
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt update
sudo apt install -y\
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic\
intel-oneapi-compiler-fortran intel-oneapi-mpi-devel
- name: Cache netCDF install
id: cache-netcdf
uses: actions/cache@v2
with:
path: ${{ env.NFDIR }}
key: netcdf-4.5.2-${{ runner.os }}-intel
- name: Checkout netCDF for compiling with Intel
if: steps.cache-netcdf.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: 'Unidata/netcdf-fortran'
ref: 'v4.5.2'
- name: Compile and install custom netCDF
if: steps.cache-netcdf.outputs.cache-hit != 'true'
run: |
source /opt/intel/oneapi/setvars.sh
./configure --prefix="$NFDIR"
make
sudo make install
- name: Setup netCDF environment
run: |
echo "${NFDIR}/bin" >> $GITHUB_PATH
echo "PKG_CONFIG_PATH=${NFDIR}/lib/pkgconfig" >> $GITHUB_ENV
- name: Setup Python for newer version of Meson
uses: actions/setup-python@v2
- name: Install Meson
run: python -m pip install meson==${{ env.MESON_VERSION }}
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Build with Intel compilers
run: |
source /opt/intel/oneapi/setvars.sh
meson setup builddir -Dmpi=${{ matrix.mpi }} -Dopenmp=${{ matrix.openmp }} -Decosys=${{ matrix.ecosys }} --buildtype=debugoptimized
meson compile -C builddir
- name: Test code
# Test fuk95 frequently times out when openmp='disabled'
if: ${{ matrix.mpi == false }} && ${{ matrix.openmp == 'enabled' }}
run: |
source /opt/intel/oneapi/setvars.sh
meson test -C builddir
- name: Upload test log
uses: actions/upload-artifact@v2
if: ${{ matrix.mpi == false }}
with:
name: testlog-${{ runner.os }}-intel
path: builddir/meson-logs/testlog.txt