-
-
Notifications
You must be signed in to change notification settings - Fork 80
209 lines (195 loc) · 6.48 KB
/
cmake-build-linux.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
name: CMake-based build on (Ubuntu) Linux
on:
workflow_dispatch:
push:
branches: [ master, development, driver-wrappers, workflows ]
paths:
- "**"
- "!.github/**"
- ".github/action-scripts/install-cuda-linux.ps1"
- ".github/workflows/cmake-build-linux.yml"
pull_request:
branches: [ master, development, driver-wrappers, workflows ]
paths:
- "**"
- "!.github/**"
- ".github/action-scripts/install-cuda-linux.ps1"
- ".github/workflows/cmake-build-linux.yml"
env:
build_type: "Release"
build_examples: "ON"
makeflags: "--no-print-directory"
jobs:
build:
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
# explicit include-based build matrix, of known valid options
matrix:
include:
- os: ubuntu-20.04
cuda: "12.3.1"
gcc: 10
shell: "bash"
cmake-generator: "Unix Makefiles"
- os: ubuntu-20.04
cuda: "12.2.2"
gcc: 10
shell: "bash"
cmake-generator: "Unix Makefiles"
- os: ubuntu-20.04
cuda: "12.1.1"
gcc: 10
shell: "bash"
cmake-generator: "Unix Makefiles"
- os: ubuntu-20.04
cuda: "12.0.1"
gcc: 10
shell: "bash"
cmake-generator: "Unix Makefiles"
- os: ubuntu-20.04
cuda: "11.8"
gcc: 10
shell: "bash"
cmake-generator: "Unix Makefiles"
- os: ubuntu-20.04
cuda: "11.7"
gcc: 10
shell: "bash"
cmake-generator: "Unix Makefiles"
- os: ubuntu-20.04
cuda: "11.6.2"
gcc: 10
shell: "bash"
cmake-generator: "Unix Makefiles"
- os: ubuntu-20.04
cuda: "11.6.1"
gcc: 10
shell: "bash"
cmake-generator: "Unix Makefiles"
- os: ubuntu-20.04
cuda: "11.6"
gcc: 10
shell: "bash"
cmake-generator: "Unix Makefiles"
- os: ubuntu-20.04
cuda: "11.5"
gcc: 10
shell: "bash"
cmake-generator: "Unix Makefiles"
- os: ubuntu-20.04
cuda: "11.4"
gcc: 10
shell: "bash"
cmake-generator: "Unix Makefiles"
- os: ubuntu-20.04
cuda: "11.3"
gcc: 9 # may fail with gcc-10 due to an internal compiler error
shell: "bash"
cmake-generator: "Unix Makefiles"
- os: ubuntu-20.04
cuda: "11.2"
gcc: 9 # may fail with gcc-10 due to an internal compiler error
shell: "bash"
cmake-generator: "Unix Makefiles"
- os: ubuntu-20.04
cuda: "11.1"
gcc: 9 # may fail with gcc-10 due to an internal compiler error
shell: "bash"
cmake-generator: "Unix Makefiles"
- os: ubuntu-20.04
cuda: "11.0"
gcc: 9 # may fail with gcc-10 due to an internal compiler error
shell: "bash"
cmake-generator: "Unix Makefiles"
# NVIDIA has deprecated Ubuntu 16.04 and 18.04 runners
#
# - os: ubuntu-18.04
# cuda: "10.2"
# gcc: 8
# shell: "bash"
# cmake-generator: "Unix Makefiles"
# - os: ubuntu-18.04
# cuda: "10.1"
# gcc: 8
# shell: "bash"
# cmake-generator: "Unix Makefiles"
# - os: ubuntu-18.04
# cuda: "10.0"
# gcc: 7 # fails with GCC 8 - no supported in CUDA 10.0
# shell: "bash"
# cmake-generator: "Unix Makefiles"
# - os: ubuntu-16.04
# cuda: "9.2"
# gcc: 6
# shell: "bash"
# cmake-generator: "Unix Makefiles"
# - os: ubuntu-16.04
# cuda: "9.1"
# gcc: 6
# shell: "bash"
# cmake-generator: "Unix Makefiles"
# - os: ubuntu-16.04
# cuda: "9.0"
# gcc: 6
# shell: "bash"
# cmake-generator: "Unix Makefiles"
# - os: ubuntu-16.04
# cuda: "8.0"
# gcc: 6
# shell: "bash"
# cmake-generator: "Unix Makefiles"
env:
build_dir: "build"
steps:
- uses: actions/checkout@v3
- name: Install CUDA on Ubuntu systems
if: contains(matrix.os, 'ubuntu')
env:
cuda: ${{ matrix.cuda }}
run: .github/action-scripts/install-cuda-ubuntu.sh
shell: bash
- name: Install CUDA on Windows
if: contains(matrix.os, 'windows')
env:
cuda: ${{ matrix.cuda }}
run: .github\action-scripts\install-cuda-windows.ps1
shell: powershell
- name: Install/Select GCC and G++
if: ${{ matrix.os-type == 'ubuntu' }}
run: |
sudo apt-get install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
echo "CC=/usr/bin/gcc-${{ matrix.gcc }}" >> $GITHUB_ENV
echo "CXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
echo "CUDAHOSTCXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
# - name: Log the CMake version
# run: cmake --version
- name: CMake configure
id: configure
run: cmake -B ${{ env.build_dir }} -G "${{ matrix.cmake-generator }}" ${{ matrix.platform-flag }} -DCMAKE_BUILD_TYPE=${{ env.build_type }} -DCAW_BUILD_EXAMPLES=ON
- name: Process potential errors in CMake configuration
if: ${{ failure() && steps.configure.outcome == 'failure' }}
working-directory: ${{ env.build_dir }}
run: |
if [[ -f "CMakeFiles/CMakeOutput.log" ]]; then
echo "---- CMakeFiles/CMakeOutput.log"
cat CMakeFiles/CMakeOutput.log
echo "----"
fi
if [[ -f "CMakeFiles/CMakeError.log" ]]; then
echo "---- CMakeFiles/CMakeError.log"
cat CMakeFiles/CMakeError.log
echo "----"
fi
- name: Build
env:
MAKEFLAGS: "--no-print-dir"
# Note: `--config` will do nothing with single-config generation, e.g. GNU Make.
run: cmake --build ${{env.build_dir}} --config ${{ env.build_type }} --verbose --parallel `nproc`
# - name: Test
# working-directory: ${{github.workspace}}/build
# There are currently no unit tests defined by the cmake configuration!
# ... plus, the tests will be mostly useless on a machine without a GPU,
# so we can't really test.
# run: ctest -C ${{env.BUILD_TYPE}}