-
Notifications
You must be signed in to change notification settings - Fork 3.5k
324 lines (263 loc) · 10.7 KB
/
build_cpp.yml
File metadata and controls
324 lines (263 loc) · 10.7 KB
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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
name: C++
on:
push:
branches:
- master
paths:
- ".github/workflows/build_cpp.yml"
- "**.cpp"
- "**.h"
- "**.c"
- "**.cu"
- "**.cmake"
- "**CMakeLists.txt"
pull_request:
branches:
- master
paths:
- ".github/workflows/build_cpp.yml"
- "**.cpp"
- "**.h"
- "**.c"
- "**.cu"
- "**.cmake"
- "**CMakeLists.txt"
defaults:
run:
shell: bash
working-directory: dlib/test
jobs:
ubuntu-latest-gcc-default-cmake-3-17-ffmpeg5:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt update
sudo apt install libwebp-dev make yasm
- name: Cache cmake 3.17.0
uses: actions/cache@v3
id: cache-cmake-download
with:
# cache this folder:
path: ~/cmake-3.17.0-Linux-x86_64
key: cmake-3.17.0_try1
- run: |
# Get the minimum version of cmake dlib supports
wget https://cmake.org/files/v3.17/cmake-3.17.0-Linux-x86_64.tar.gz
tar -xf cmake-3.17.0-Linux-x86_64.tar.gz -C ~
if: steps.cache-cmake-download.outputs.cache-hit != 'true'
- name: Cache FFmpeg 5
uses: actions/cache@v3
id: cache-ffmpeg5
with:
path: /home/runner/ffmpeg-n5.1.3_installation
key: ffmpeg-n5.1.3_try4
- name: Build FFmpeg 5
if: steps.cache-ffmpeg5.outputs.cache-hit != 'true'
run: |
wget https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n5.1.3.tar.gz
tar -xf n5.1.3.tar.gz
cd FFmpeg-n5.1.3
./configure --prefix=/home/runner/ffmpeg-n5.1.3_installation --disable-doc --disable-programs
make -j4
make install
cd ..
- name: Configure tests
run: ~/cmake-3.17.0-Linux-x86_64/bin/cmake ${{ github.workspace }}/dlib/test -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n5.1.3_installation
- name: Build tests
run: ~/cmake-3.17.0-Linux-x86_64/bin/cmake --build build --parallel 4
- name: Run tests
run: build/dtest --runall -q
- name: Configure examples
run: ~/cmake-3.17.0-Linux-x86_64/bin/cmake ${{ github.workspace }}/examples -B build2 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n5.1.3_installation
- name: Build examples
run: ~/cmake-3.17.0-Linux-x86_64/bin/cmake --build build2 --parallel 4
ubuntu-latest-gcc-11-blas:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt update
sudo apt install libwebp-dev libavformat-dev libavcodec-dev libavdevice-dev libavfilter-dev libswresample-dev libswscale-dev libavutil-dev
sudo apt install libopenblas-dev liblapack-dev
- name: Install gcc 11
run: |
sudo apt install gcc-11 g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
- name: Configure tests
run: cmake ${{ github.workspace }}/dlib/test -B build -DCMAKE_BUILD_TYPE=Release
- name: Build tests (including BLAS tests)
run: cmake --build build --parallel 4
- name: Test
run: build/dtest --runall -q
- name: Configure examples
run: cmake ${{ github.workspace }}/examples -B build2 -DCMAKE_BUILD_TYPE=Release
- name: Build examples
run: cmake --build build2 --parallel 4
ubuntu-latest-ffmpeg-mkl:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- name: Install dependencies
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 update
sudo apt install libwebp-dev libavformat-dev libavcodec-dev libavdevice-dev libavfilter-dev libswresample-dev libswscale-dev libavutil-dev
sudo apt install intel-oneapi-mkl-devel
- name: Configure tests with MKL sequential
run: cmake . -B build -DCMAKE_BUILD_TYPE=Release -DDLIB_USE_MKL_SEQUENTIAL=ON -DDLIB_USE_MKL_WITH_TBB=OFF
- name: Build tests with MKL sequential
run: cmake --build build --target dtest --parallel 4
- name: Test with MKL sequential
run: build/dtest --runall -q
- name: Configure tests with MKL tbb
run: cmake . -B build2 -DCMAKE_BUILD_TYPE=Release -DDLIB_USE_MKL_SEQUENTIAL=OFF -DDLIB_USE_MKL_WITH_TBB=ON
- name: Build tests with MKL tbb
run: cmake --build build2 --target dtest --parallel 4
- name: Test with MKL tbb
run: build2/dtest --runall -q
ubuntu-20_04-gcc-7:
runs-on: 'ubuntu-20.04'
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt update
sudo apt install libwebp-dev make yasm
- name: Install gcc 7
run: |
sudo apt install gcc-7 g++-7
- name: Cache FFmpeg 3.2.18
uses: actions/cache@v3
id: cache-ffmpeg3
with:
path: /home/runner/ffmpeg-n3.2.18_installation
key: ffmpeg-n3.2.18_try1
- name: Build FFmpeg 3.2.18
if: steps.cache-ffmpeg3.outputs.cache-hit != 'true'
run: |
wget https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n3.2.18.tar.gz
tar -xf n3.2.18.tar.gz
cd FFmpeg-n3.2.18
./configure --prefix=/home/runner/ffmpeg-n3.2.18_installation --disable-doc --disable-programs
make -j4
make install
cd ..
- name: Configure tests
run: |
export CC=/usr/bin/gcc-7
export CXX=/usr/bin/g++-7
cmake ${{ github.workspace }}/dlib/test -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n3.2.18_installation
- name: Build tests
run: cmake --build build --parallel 4
- name: Test
run: build/dtest --runall -q
- name: Configure examples
run: cmake ${{ github.workspace }}/examples -B build2 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n3.2.18_installation
- name: Build examples
run: cmake --build build2 --parallel 4
# Test cmake scrips can build standalone dlib as a shared library
- name: Configure dlib as shared library
run: cmake ${{ github.workspace }}/dlib -B build_dlib_shared -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n3.2.18_installation
- name: Build dlib as shared library
run: cmake --build build_dlib_shared --parallel 4
ubuntu-latest-clang-default-avx:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt update
sudo apt install libwebp-dev libavformat-dev libavcodec-dev libavdevice-dev libavfilter-dev libswresample-dev libswscale-dev libavutil-dev
- name: Configure test
run: |
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
cmake ${{ github.workspace }}/dlib/test -B build -DCMAKE_BUILD_TYPE=Release -DDLIB_USE_AVX=ON
- name: Build tests
run: cmake --build build --parallel 4
- name: Configure examples
run: cmake ${{ github.workspace }}/examples -B build2 -DCMAKE_BUILD_TYPE=Release -DDLIB_USE_AVX=ON
- name: Build examples
run: cmake --build build2 --parallel 4
- name: Test
run: build/dtest --runall -q
ubuntu-latest-intalled_dlib:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- name: Configure library
run: cmake ${{ github.workspace }}/dlib -B build
- name: Build library
run: cmake --build build --parallel 4
- name: Install library
run: cmake --install build --prefix /home/runner/dlib_installation
- name: Configure example using find_package
run: cmake ${{ github.workspace }}/tools/test -B build2 -DCMAKE_PREFIX_PATH=/home/runner/dlib_installation
- name: Build example
run: cmake --build build2
- name: Run example
run: build2/assignment_learning_ex
- name: Configure example using pkg-config
run: cmake ${{ github.workspace }}/tools/test_pkgconfig -B build3 -DCMAKE_PREFIX_PATH=/home/runner/dlib_installation
- name: Build example
run: cmake --build build3
- name: Run example
run: build3/assignment_learning_ex
windows-latest:
runs-on: 'windows-latest'
steps:
- uses: actions/checkout@v2
- name: Configure
run: |
# don't use CMake 3.25.0 https://gitlab.kitware.com/cmake/cmake/-/issues/23975
pip3 install cmake==3.24.0
cmake . -B build
- name: Build just tests
run: cmake --build build --config Release --target dtest --parallel 4
- name: Test
run: build/Release/dtest.exe --runall -q
- name: Build ancillary tools
run: |
cmake ../../tools/imglab -B build_imglab
cmake --build build_imglab --config Release --parallel 4
cmake ../../tools/htmlify -B build_htmlify
cmake --build build_htmlify --config Release --parallel 4
cmake ../../tools/convert_dlib_nets_to_caffe -B build_dtoc
cmake --build build_dtoc --config Release --parallel 4
windows-2019:
runs-on: 'windows-2019'
steps:
- uses: actions/checkout@v2
- name: Configure
run: |
# don't use CMake 3.25.0 https://gitlab.kitware.com/cmake/cmake/-/issues/23975
pip3 install cmake==3.24.0
cmake . -B build
- name: Build just tests
run: cmake --build build --config Debug --parallel 4
- name: Build ancillary tools
run: |
cmake ../../tools/imglab -B build_imglab
cmake --build build_imglab --config Release --parallel 4
cmake ../../tools/htmlify -B build_htmlify
cmake --build build_htmlify --config Release --parallel 4
cmake ../../tools/convert_dlib_nets_to_caffe -B build_dtoc
cmake --build build_dtoc --config Release --parallel 4
# Disable this because macos targets aren't working on github actions right now.
#macos-latest:
# runs-on: 'macos-latest'
# steps:
# - uses: actions/checkout@v2
# - name: Configure
# # MacOS machines often come with low quality BLAS libraries installed, so don't use those.
# run: cmake ${{ github.workspace }}/dlib/test -B build -DDLIB_USE_BLAS=0 -DDLIB_USE_LAPACK=0
# - name: Build just tests
# run: cmake --build build --config Release --target dtest --parallel 4
# - name: Test
# run: build/dtest --runall --no_test_timer -q
# - name: Build examples, etc
# run: cmake --build build --config Release --parallel 2