-
Notifications
You must be signed in to change notification settings - Fork 6
212 lines (207 loc) · 7.62 KB
/
tests-macos.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
# Copyright (C) The DDC development team, see COPYRIGHT.md file
#
# SPDX-License-Identifier: MIT
name: Tests on macOS
on:
schedule:
- cron: "0 1 * * *" # every day at 1am
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref == github.ref_protected && github.run_id || github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
id_repo:
runs-on: macos-latest
steps:
- name: Identify repository
id: identify_repo
run: |
echo "in_base_repo=${{ (github.event_name == 'push' && github.repository == 'CExA-project/ddc') || github.event.pull_request.head.repo.full_name == 'CExA-project/ddc' }}" >> "$GITHUB_OUTPUT"
outputs: { in_base_repo: '${{ steps.identify_repo.outputs.in_base_repo }}' }
test-macos:
if: github.ref_name != 'main'
strategy:
fail-fast: false
matrix:
backend:
- name: 'cpu'
c_compiler: 'clang'
cxx_compiler: 'clang++'
ddc_extra_cxx_flags: '-Wextra-semi -Wextra-semi-stmt -Wold-style-cast'
kokkos_extra_cmake_flags: ''
cxx_version: ['17', '20', '23']
cmake_build_type: ['Debug', 'Release']
exclude:
- cxx_version: '20' # To be removed as soon as PDI supports C++20 with clang
- cxx_version: '23' # To be removed as soon as PDI supports C++20 with clang
runs-on: macos-latest
needs: [id_repo]
env:
benchmark_ROOT: ${{github.workspace}}/opt/benchmark
DDC_ROOT: ${{github.workspace}}/opt/ddc
Ginkgo_ROOT: ${{github.workspace}}/opt/ginkgo
GTest_ROOT: ${{github.workspace}}/opt/gtest
Kokkos_ROOT: ${{github.workspace}}/opt/kokkos
KokkosFFT_ROOT: ${{github.workspace}}/opt/kokkos-fft
KokkosKernels_ROOT: ${{github.workspace}}/opt/kokkos-kernels
PDI_ROOT: ${{github.workspace}}/opt/pdi
CMAKE_BUILD_PARALLEL_LEVEL: 4
PKG_CONFIG_PATH: /opt/homebrew/opt/lapack/lib/pkgconfig
LAPACKE_DIR: /opt/homebrew/opt/lapack
CC: ${{matrix.backend.c_compiler}}
CXX: ${{matrix.backend.cxx_compiler}}
CMAKE_BUILD_TYPE: ${{matrix.cmake_build_type}}
steps:
- name: Checkout built branch
uses: actions/checkout@v4
with: { submodules: true }
- name: Install PDI+user code plugin and dependencies
run: |
git clone --branch 1.8.1 --depth 1 https://github.com/pdidev/pdi.git
# PATCH: remove <link.h> for macOS
sed -i.bak 's|#include <link.h>||g' pdi/plugins/user_code/user_code.cxx
rm -f pdi/plugins/user_code/user_code.cxx.bak
cmake \
-DBUILD_BENCHMARKING=OFF \
-DBUILD_DECL_HDF5_PLUGIN=OFF \
-DBUILD_DECL_NETCDF_PLUGIN=OFF \
-DBUILD_DEISA_PLUGIN=OFF \
-DBUILD_DOCUMENTATION=OFF \
-DBUILD_FORTRAN=OFF \
-DBUILD_MPI_PLUGIN=OFF \
-DBUILD_PYCALL_PLUGIN=OFF \
-DBUILD_SERIALIZE_PLUGIN=OFF \
-DBUILD_SET_VALUE_PLUGIN=OFF \
-DBUILD_TESTING=OFF \
-DBUILD_TRACE_PLUGIN=OFF \
-DBUILD_USER_CODE_PLUGIN=ON \
-DCMAKE_CXX_FLAGS="-Wno-unqualified-std-cast-call" \
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-B build \
-S ./pdi
cmake --build build
cmake --install build --prefix $PDI_ROOT
rm -rf build
- name: Install fftw
run: brew install fftw
- name: Install lapack
run: brew install lapack
- run: git config --global --add safe.directory '*'
- name: Install Ginkgo
run: |
git clone --branch v1.8.0 --depth 1 https://github.com/ginkgo-project/ginkgo.git
cmake \
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-DGINKGO_BUILD_BENCHMARKS=OFF \
-DGINKGO_BUILD_EXAMPLES=OFF \
-DGINKGO_BUILD_MPI=OFF \
-DGINKGO_BUILD_REFERENCE=ON \
-DGINKGO_BUILD_TESTS=OFF \
-B build \
-S ./ginkgo
cmake --build build
cmake --install build --prefix $Ginkgo_ROOT
rm -rf build
- name: Install Google benchmark
run: |
cmake \
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-DBENCHMARK_ENABLE_GTEST_TESTS=OFF \
-DBENCHMARK_ENABLE_TESTING=OFF \
-DBENCHMARK_INSTALL_DOCS=OFF \
-DBENCHMARK_USE_BUNDLED_GTEST=OFF \
-B build \
-S ./vendor/benchmark
cmake --build build
cmake --install build --prefix $benchmark_ROOT
rm -rf build
- name: Install Google Test
run: |
cmake \
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-B build \
-S ./vendor/googletest
cmake --build build
cmake --install build --prefix $GTest_ROOT
rm -rf build
- name: Install Kokkos
run: |
cmake \
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-DKokkos_ENABLE_DEPRECATED_CODE_4=OFF \
-DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF \
-DKokkos_ENABLE_SERIAL=ON \
${{matrix.backend.kokkos_extra_cmake_flags}} \
-B build \
-S ./vendor/kokkos
cmake --build build
cmake --install build --prefix $Kokkos_ROOT
rm -rf build
- name: Install Kokkos-fft
run: |
cmake \
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-DKokkosFFT_ENABLE_HOST_AND_DEVICE=ON \
-B build \
-S ./vendor/kokkos-fft
cmake --build build
cmake --install build --prefix $KokkosFFT_ROOT
rm -rf build
- name: Install Kokkos Kernels
run: |
cmake \
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-DKokkosKernels_ADD_DEFAULT_ETI=OFF \
-DKokkosKernels_ENABLE_ALL_COMPONENTS=OFF \
-DKokkosKernels_ENABLE_COMPONENT_BLAS=ON \
-DKokkosKernels_ENABLE_COMPONENT_BATCHED=ON \
-DKokkosKernels_ENABLE_COMPONENT_LAPACK=OFF \
-DKokkosKernels_ENABLE_TPL_BLAS=OFF \
-DKokkosKernels_ENABLE_TPL_CUSOLVER=OFF \
-DKokkosKernels_ENABLE_TPL_LAPACK=OFF \
-B build \
-S ./vendor/kokkos-kernels
cmake --build build
cmake --install build --prefix $KokkosKernels_ROOT
rm -rf build
- name: Build DDC
run: |
cmake \
-DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-sign-compare -pedantic-errors ${{matrix.backend.ddc_extra_cxx_flags}}" \
-DCMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
-DDDC_BUILD_BENCHMARKS=ON \
-DDDC_benchmark_DEPENDENCY_POLICY=INSTALLED \
-DDDC_GTest_DEPENDENCY_POLICY=INSTALLED \
-DDDC_Kokkos_DEPENDENCY_POLICY=INSTALLED \
-DDDC_KokkosFFT_DEPENDENCY_POLICY=INSTALLED \
-DBLA_PREFER_PKGCONFIG=ON \
-B build
cmake --build build
- name: Run unit tests
run: ctest --test-dir build --output-on-failure --timeout 10 --output-junit tests.xml
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: ( success() || failure() ) # always run even if the previous step fails
with:
report_paths: '${{github.workspace}}/build/tests.xml'
- name: Run examples
run: |
./build/examples/characteristics_advection
./build/examples/game_of_life
./build/examples/heat_equation_spectral
./build/examples/heat_equation
./build/examples/non_uniform_heat_equation
./build/examples/uniform_heat_equation
- name: Install DDC
run: |
cmake --install build --prefix $DDC_ROOT
rm -rf build
- name: Run install tests
run: |
cmake \
-B build \
-S ./install_test
cmake --build build