forked from ecmwf/atlas
-
Notifications
You must be signed in to change notification settings - Fork 1
281 lines (237 loc) · 8.7 KB
/
build.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
name: build
# Controls when the action will run
on:
# Trigger the workflow on all pushes, except on tag creation
push:
branches:
- '**'
tags-ignore:
- '**'
# Trigger the workflow on all pull requests
pull_request: ~
# Allow workflow to be dispatched on demand
workflow_dispatch: ~
env:
ATLAS_TOOLS: ${{ github.workspace }}/tools
CTEST_PARALLEL_LEVEL: 1
CACHE_SUFFIX: v1
jobs:
ci:
name: ci
strategy:
fail-fast: false # false: try to complete all jobs
matrix:
build_type: [Release,Debug]
name:
- linux gnu-10
- linux gnu-12
- linux gnu-7
- linux clang-12
# - linux nvhpc-22.11
- linux intel
- linux intel-classic
- macos
include:
- name: linux gnu-10
os: ubuntu-20.04
compiler: gnu-10
compiler_cc: gcc-10
compiler_cxx: g++-10
compiler_fc: gfortran-10
caching: true
coverage: true
- name: linux gnu-12
os: ubuntu-22.04
compiler: gnu-12
compiler_cc: gcc-12
compiler_cxx: g++-12
compiler_fc: gfortran-12
cmake_options: -DENABLE_OMP_CXX=OFF
caching: true
coverage: false
- name: linux gnu-7
os: ubuntu-20.04
compiler: gnu-7
compiler_cc: gcc-7
compiler_cxx: g++-7
compiler_fc: gfortran-7
caching: true
coverage: false
- name: linux clang-12
os: ubuntu-20.04
compiler: clang-12
compiler_cc: clang-12
compiler_cxx: clang++-12
compiler_fc: gfortran-10
caching: true
coverage: false
- name: linux clang-12
build_type: Release
os: ubuntu-20.04
compiler: clang-12
compiler_cc: clang-12
compiler_cxx: clang++-12
compiler_fc: gfortran-10
ctest_options: "-LE mpi" # For now until Checkerboard fixed
caching: true
coverage: false
# - name: linux nvhpc-22.11
# os: ubuntu-20.04
# compiler: nvhpc-22.11
# compiler_cc: nvc
# compiler_cxx: nvc++
# compiler_fc: nvfortran
# cmake_options: -DCMAKE_CXX_FLAGS=--diag_suppress177
# ctest_options: "-LE mpi" # For now until Checkerboard fixed
# caching: false
# coverage: false
- name : linux intel
os: ubuntu-20.04
compiler: intel
compiler_cc: icx
compiler_cxx: icpx
compiler_fc: ifx
caching: true
coverage: false
- name : linux intel-classic
os: ubuntu-20.04
compiler: intel-classic
compiler_cc: icc
compiler_cxx: icpc
compiler_fc: ifort
caching: true
coverage: false
- name: macos
# Xcode compiler requires empty environment variables, so we pass null (~) here
os: macos-12
compiler: clang-14
compiler_cc: ~
compiler_cxx: ~
compiler_fc: gfortran-11
caching: true
coverage: false
cmake_options: -DMPI_SLOTS=4
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Environment
run: |
echo "DEPS_DIR=${{ runner.temp }}/deps" >> $GITHUB_ENV
echo "CC=${{ matrix.compiler_cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.compiler_cxx }}" >> $GITHUB_ENV
echo "FC=${{ matrix.compiler_fc }}" >> $GITHUB_ENV
if [[ "${{ matrix.os }}" =~ macos ]]; then
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_INSTALL_CLEANUP=1
echo "HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1" >> $GITHUB_ENV
echo "HOMEBREW_NO_AUTO_UPDATE=1" >> $GITHUB_ENV
echo "HOMEBREW_NO_INSTALL_CLEANUP=1" >> $GITHUB_ENV
brew install ninja
brew install libomp
else
sudo apt-get update
if [[ "${{ matrix.compiler }}" =~ gnu-7 ]]; then
sudo apt-get install gcc-7 g++-7 gfortran-7
fi
sudo apt-get install ninja-build
fi
printenv
- name: Cache Dependencies
# There seems to be a problem with cached NVHPC dependencies, leading to SIGILL perhaps due to slightly different architectures
if: matrix.caching
id: deps-cache
uses: pat-s/[email protected]
with:
path: ${{ env.DEPS_DIR }}
key: deps-${{ matrix.os }}-${{ matrix.compiler }}-v1
- name: Install NVHPC compiler
if: contains( matrix.compiler, 'nvhpc' )
shell: bash -eux {0}
run: |
${ATLAS_TOOLS}/install-nvhpc.sh --prefix ${DEPS_DIR}/nvhpc --version 22.11
source ${DEPS_DIR}/nvhpc/env.sh
echo "${NVHPC_DIR}/compilers/bin" >> $GITHUB_PATH
[ -z ${MPI_HOME+x} ] || echo "MPI_HOME=${MPI_HOME}" >> $GITHUB_ENV
- name: Install Intel oneAPI compiler
if: contains( matrix.compiler, 'intel' )
run: |
${ATLAS_TOOLS}/install-intel-oneapi.sh
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
echo "CACHE_SUFFIX=$CC-$($CC -dumpversion)" >> $GITHUB_ENV
- name: Install MPI
shell: bash -eux {0}
run: |
FCFLAGS=-fPIC CFLAGS=-fPIC FFLAGS=-fPIC ${ATLAS_TOOLS}/install-mpi.sh --mpi openmpi --prefix ${DEPS_DIR}/openmpi
[ -f ${DEPS_DIR}/openmpi/env.sh ] && source ${DEPS_DIR}/openmpi/env.sh
[ -z ${MPI_HOME+x} ] || echo "MPI_HOME=${MPI_HOME}" >> $GITHUB_ENV
- name: Install FFTW
shell: bash -eux {0}
run: |
${ATLAS_TOOLS}/install-fftw.sh --version 3.3.10 --prefix ${DEPS_DIR}/fftw
echo "FFTW_ROOT=${DEPS_DIR}/fftw" >> $GITHUB_ENV
- name: Install Qhull
shell: bash -eux {0}
run: |
${ATLAS_TOOLS}/install-qhull.sh --version 8.1-alpha3 --prefix ${DEPS_DIR}/qhull
echo "Qhull_ROOT=${DEPS_DIR}/qhull" >> $GITHUB_ENV
- name: Install LZ4
if: "!contains( matrix.compiler, 'nvhpc' )"
run: |
brew install lz4
echo "LZ4_ROOT=$(brew --prefix lz4)" >> $GITHUB_ENV
- name: Install Eigen
if: "!contains( matrix.compiler, 'nvhpc' )"
run: |
brew install eigen
- name: Set Build & Test Environment
run: |
# Only add --oversubscribe arg for openmpi
[ -z ${I_MPI_ROOT+x} ] && echo "ATLAS_RUN_MPI_ARGS=--oversubscribe" >> $GITHUB_ENV
# Add mpirun to path for testing
[ -z ${MPI_HOME+x} ] || echo "${MPI_HOME}/bin" >> $GITHUB_PATH
if [[ "${{matrix.compiler}}" == intel-classic ]]; then
echo "CFLAGS=-diag-disable=10441" >> $GITHUB_ENV
echo "CXXFLAGS=-diag-disable=10441" >> $GITHUB_ENV
echo "FCFLAGS=-diag-disable=10441" >> $GITHUB_ENV
echo "FFLAGS=-diag-disable=10441" >> $GITHUB_ENV
fi
if [[ "${{matrix.compiler}}" == intel ]]; then
echo "CFLAGS=-Rno-debug-disables-optimization" >> $GITHUB_ENV
echo "CXXFLAGS=-Rno-debug-disables-optimization" >> $GITHUB_ENV
fi
- name: Build & Test
id: build-test
uses: ecmwf-actions/build-package@v2
with:
self_coverage: ${{ matrix.coverage }}
force_build: true
cache_suffix: "${{ matrix.build_type }}-${{ env.CACHE_SUFFIX }}"
recreate_cache: ${{ matrix.caching == false }}
dependencies: |
ecmwf/ecbuild
ecmwf/eckit
ecmwf/fckit
dependency_branch: develop
dependency_cmake_options: |
ecmwf/eckit: "-G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_TESTS=OFF -DENABLE_ECKIT_CMD=OFF -DENABLE_ECKIT_SQL=OFF"
ecmwf/fckit: "-G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_TESTS=OFF"
cmake_options: "-G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DATLAS_BITS_LOCAL=32 ${{ matrix.cmake_options }}"
ctest_options: "${{ matrix.ctest_options }}"
- name: Verify tools
run: |
export PATH=${{ steps.build-test.outputs.bin_path }}:$PATH
echo "+ atlas --info"
atlas --info
echo "+ atlas-grids --list"
atlas-grids --list
- name: Codecov Upload
if: steps.build-test.outputs.coverage_file
uses: codecov/codecov-action@v2
with:
files: ${{ steps.build-test.outputs.coverage_file }}