-
Notifications
You must be signed in to change notification settings - Fork 6
206 lines (174 loc) · 5.95 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
name: Build and Test
on: [push, pull_request]
env:
CI: "ON"
BUILD_DIR: _build
CMAKE_OPTIONS: >-
-DCMAKE_BUILD_TYPE=Debug
-DFYPP_FLAGS='-DTRAVIS'
jobs:
gcc-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
mpi: [nompi, openmpi]
socket: [nosocket, socket]
config: [Debug]
version: [11]
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install GCC (Linux)
if: ${{ contains(matrix.os, 'ubuntu') }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-${{ matrix.version}} gfortran-${{ matrix.version }} g++-${{ matrix.version }}
sudo update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.version }} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ matrix.version }} \
--slave /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.version }} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${{ matrix.version }}
- name: Enable MPI build
if: contains(matrix.mpi, 'openmpi') || contains(matrix.mpi, 'mpich')
run: echo "WITH_MPI=true" >> $GITHUB_ENV
- name: Disable MPI build
if: contains(matrix.mpi, 'nompi')
run: echo "WITH_MPI=false" >> $GITHUB_ENV
- name: Enable socket build
if: contains(matrix.socket, 'socket')
run: echo "WITH_SOCKETS=true" >> $GITHUB_ENV
- name: Disable socket build
if: contains(matrix.socket, 'nosocket')
run: echo "WITH_SOCKETS=false" >> $GITHUB_ENV
- name: Set Compiler (Linux)
if: contains(matrix.os, 'ubuntu')
run: |
echo "FC=gfortran" >> $GITHUB_ENV
echo "CC=gcc" >> $GITHUB_ENV
- name: Install HDF5
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install hdf5-tools libhdf5-dev libhdf5-103
- name: Install OpenMPI (Linux)
if: contains(matrix.os, 'ubuntu') && contains(matrix.mpi, 'openmpi')
run: |
sudo apt-get update
sudo apt-get install libopenmpi-dev
echo "CMAKE_OPTIONS=${CMAKE_OPTIONS}" >> $GITHUB_ENV
- name: Install cmake
run: pip3 install cmake ninja fypp numpy h5py
- name: Configure build
run: >-
cmake -B _build -G Ninja
-DCMAKE_INSTALL_PREFIX=${PWD}/_install
${CMAKE_OPTIONS}
-DWITH_MPI=${WITH_MPI}
-DWITH_SOCKETS=${WITH_SOCKETS}
- name: Build project
run: cmake --build ${BUILD_DIR}
- name: Run regression tests
run: |
pushd ${BUILD_DIR}
ctest -j 2 --output-on-failure
popd
- name: Install project
run: |
cmake --install ${BUILD_DIR}
intel-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
mpi: [nompi]
socket: [nosocket, socket]
fc: [ifort]
cc: [icx]
env:
FC: ${{ matrix.fc }}
CC: ${{ matrix.cc }}
WITH_MPI: false
APT_PACKAGES: >-
intel-oneapi-compiler-fortran
intel-oneapi-compiler-dpcpp-cpp
intel-oneapi-mkl
intel-oneapi-mkl-devel
CMAKE_OPTIONS: >-
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DFYPP_FLAGS='-DTRAVIS'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Add Intel repository
if: contains(matrix.os, 'ubuntu')
run: |
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-get update
- name: Install Intel oneAPI compiler
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install ${APT_PACKAGES}
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
- name: Install HDF5 (gcc)
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install hdf5-tools libhdf5-dev libhdf5-103
- name: Install HDF5 (intel)
if: contains(matrix.os, 'ubuntu')
run: |
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.13/hdf5-1.13.2/src/CMake-hdf5-1.13.2.tar.gz
tar xfz CMake-hdf5-1.13.2.tar.gz
cd CMake-hdf5-1.13.2/hdf5-1.13.2/
CC=icx CXX=icx FC=ifort F9X=ifort ./configure --prefix=${PWD}/hdf5 --enable-fortran --with-default-api-version=v110 --enable-shared
make -j -l2
make install
export HDF5_ROOT=${PWD}/hdf5
cd ../../
printenv >> $GITHUB_ENV
- name: Disable MPI build
if: contains(matrix.mpi, 'nompi')
run: |
echo "WITH_MPI=false" >> $GITHUB_ENV
echo "FC=ifort" >> $GITHUB_ENV
- name: Enable socket build
if: contains(matrix.socket, 'socket')
run: echo "WITH_SOCKETS=true" >> $GITHUB_ENV
- name: Disable socket build
if: contains(matrix.socket, 'nosocket')
run: echo "WITH_SOCKETS=false" >> $GITHUB_ENV
- name: Install cmake
run: |
pip3 install --upgrade pip
pip3 install cmake ninja fypp numpy h5py
- name: Configure build
run: >-
cmake -B _build -G Ninja
-DCMAKE_INSTALL_PREFIX=${PWD}/_install
${CMAKE_OPTIONS}
-DWITH_MPI=${WITH_MPI}
-DWITH_SOCKETS=${WITH_SOCKETS}
- name: Build project
run: cmake --build ${BUILD_DIR}
- name: Run regression tests
run: |
pushd ${BUILD_DIR}
ctest -j 2 --output-on-failure
popd
- name: Install project
run: |
cmake --install ${BUILD_DIR}