-
Notifications
You must be signed in to change notification settings - Fork 185
/
Copy pathazure-pipelines.yml
390 lines (329 loc) · 12.9 KB
/
azure-pipelines.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
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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
pr:
branches:
include:
- '*'
paths:
exclude:
- doc
trigger:
branches:
include:
- '*'
paths:
exclude:
- doc
jobs:
- job:
timeoutInMinutes: 240
pool:
vmImage: $(imageName)
variables:
USE_CCACHE: 1
CCACHE_DIR: $(Pipeline.Workspace)/ccache
CCACHE_COMPRESS: 1
CCACHE_COMPRESSLEVEL: 9
CCACHE_CPP2: 1
CCACHE_MAXSIZE: 2G
OS_NAME: $(Agent.OS)
PARENT_BRANCH: 1.8
strategy:
matrix:
macOS 14:
imageName: 'macOS-14'
SELECTED_CC: clang
SELECTED_CXX: clang++
# clang-6 and newer compilers
clang-19 [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
UBUNTU_CODE_NAME: jammy
SOURCE_LINE: 'deb https://apt.llvm.org/$(UBUNTU_CODE_NAME)/ llvm-toolchain-$(UBUNTU_CODE_NAME)-19 main'
SELECTED_CC: clang-19
SELECTED_CXX: clang++-19
PACKAGES: 'clang-19 llvm-19-dev'
clang-18 [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
UBUNTU_CODE_NAME: jammy
SOURCE_LINE: 'deb https://apt.llvm.org/$(UBUNTU_CODE_NAME)/ llvm-toolchain-$(UBUNTU_CODE_NAME)-18 main'
SELECTED_CC: clang-18
SELECTED_CXX: clang++-18
PACKAGES: 'clang-18 llvm-18-dev'
clang-17 [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
UBUNTU_CODE_NAME: jammy
SOURCE_LINE: 'deb https://apt.llvm.org/$(UBUNTU_CODE_NAME)/ llvm-toolchain-$(UBUNTU_CODE_NAME)-17 main'
SELECTED_CC: clang-17
SELECTED_CXX: clang++-17
PACKAGES: 'clang-17 llvm-17-dev'
clang-16 [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
UBUNTU_CODE_NAME: jammy
SOURCE_LINE: 'deb https://apt.llvm.org/$(UBUNTU_CODE_NAME)/ llvm-toolchain-$(UBUNTU_CODE_NAME)-16 main'
SELECTED_CC: clang-16
SELECTED_CXX: clang++-16
PACKAGES: 'clang-16 llvm-16-dev'
clang-15 [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
UBUNTU_CODE_NAME: jammy
SOURCE_LINE: 'deb https://apt.llvm.org/$(UBUNTU_CODE_NAME)/ llvm-toolchain-$(UBUNTU_CODE_NAME)-15 main'
SELECTED_CC: clang-15
SELECTED_CXX: clang++-15
PACKAGES: 'clang-15 llvm-15-dev'
clang-14 [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
UBUNTU_CODE_NAME: jammy
SOURCE_LINE: 'deb https://apt.llvm.org/$(UBUNTU_CODE_NAME)/ llvm-toolchain-$(UBUNTU_CODE_NAME)-14 main'
SELECTED_CC: clang-14
SELECTED_CXX: clang++-14
PACKAGES: 'clang-14 llvm-14-dev'
clang-13 [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
UBUNTU_CODE_NAME: jammy
SOURCE_LINE: 'deb https://apt.llvm.org/$(UBUNTU_CODE_NAME)/ llvm-toolchain-$(UBUNTU_CODE_NAME)-13 main'
SELECTED_CC: clang-13
SELECTED_CXX: clang++-13
PACKAGES: 'clang-13 llvm-13-dev'
clang-12 [Ubuntu 20.04 Focal]:
imageName: 'ubuntu-20.04'
UBUNTU_CODE_NAME: focal
SOURCE_LINE: 'deb https://apt.llvm.org/$(UBUNTU_CODE_NAME)/ llvm-toolchain-$(UBUNTU_CODE_NAME)-12 main'
SELECTED_CC: clang-12
SELECTED_CXX: clang++-12
PACKAGES: 'clang-12 llvm-12-dev'
clang-11 [Ubuntu 20.04 Focal]:
imageName: 'ubuntu-20.04'
UBUNTU_CODE_NAME: focal
SOURCE_LINE: 'deb https://apt.llvm.org/$(UBUNTU_CODE_NAME)/ llvm-toolchain-$(UBUNTU_CODE_NAME)-11 main'
SELECTED_CC: clang-11
SELECTED_CXX: clang++-11
PACKAGES: 'clang-11 llvm-11-dev'
clang-10 [Ubuntu 20.04 Focal]:
imageName: 'ubuntu-20.04'
UBUNTU_CODE_NAME: focal
SOURCE_LINE: 'deb https://apt.llvm.org/$(UBUNTU_CODE_NAME)/ llvm-toolchain-$(UBUNTU_CODE_NAME)-10 main'
SELECTED_CC: clang-10
SELECTED_CXX: clang++-10
PACKAGES: 'clang-10 llvm-10-dev'
clang-9 [Ubuntu 20.04 Focal]:
imageName: 'ubuntu-20.04'
UBUNTU_CODE_NAME: focal
SOURCE_LINE: 'deb https://apt.llvm.org/$(UBUNTU_CODE_NAME)/ llvm-toolchain-$(UBUNTU_CODE_NAME)-9 main'
SELECTED_CC: clang-9
SELECTED_CXX: clang++-9
PACKAGES: 'clang-9 llvm-9-dev'
clang-8 [Ubuntu 20.04 Focal]:
imageName: 'ubuntu-20.04'
UBUNTU_CODE_NAME: focal
SELECTED_CC: clang-8
SELECTED_CXX: clang++-8
PACKAGES: 'clang-8 llvm-8-dev'
clang-7 [Ubuntu 20.04 Focal]:
imageName: 'ubuntu-20.04'
UBUNTU_CODE_NAME: focal
SELECTED_CC: clang-7
SELECTED_CXX: clang++-7
PACKAGES: 'clang-7 llvm-7-dev'
clang-6 [Ubuntu 20.04 Focal]:
imageName: 'ubuntu-20.04'
UBUNTU_CODE_NAME: focal
SELECTED_CC: clang-6.0
SELECTED_CXX: clang++-6.0
PACKAGES: 'clang-6.0 llvm-6.0-dev'
# gcc-7 and newer compilers
gcc-14 x86 64-bit [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
SELECTED_CC: gcc-14
SELECTED_CXX: g++-14
PACKAGES: 'g++-14'
gcc-14 x86 32-bit [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
SELECTED_CC: gcc-14
SELECTED_CXX: g++-14
PACKAGES: 'g++-14 g++-14-multilib gcc-multilib'
MORE_OPTIONS: 'BUILD_ARCH=32-bit'
gcc-13 [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
SELECTED_CC: gcc-13
SELECTED_CXX: g++-13
PACKAGES: 'g++-13'
gcc-12 [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
SELECTED_CC: gcc-12
SELECTED_CXX: g++-12
PACKAGES: 'g++-12'
gcc-11 [Ubuntu 20.04 Focal]:
imageName: 'ubuntu-20.04'
SELECTED_CC: gcc-11
SELECTED_CXX: g++-11
PACKAGES: 'g++-11'
gcc-10 [Ubuntu 20.04 Focal]:
imageName: 'ubuntu-20.04'
SELECTED_CC: gcc-10
SELECTED_CXX: g++-10
PACKAGES: 'g++-10'
gcc-9 [Ubuntu 20.04 Focal]:
imageName: 'ubuntu-20.04'
SELECTED_CC: gcc-9
SELECTED_CXX: g++-9
PACKAGES: 'g++-9'
gcc-8 [Ubuntu 20.04 Focal]:
imageName: 'ubuntu-20.04'
SELECTED_CC: gcc-8
SELECTED_CXX: g++-8
PACKAGES: 'g++-8'
gcc-7 [Ubuntu 20.04 Focal]:
imageName: 'ubuntu-20.04'
SELECTED_CC: gcc-7
SELECTED_CXX: g++-7
PACKAGES: 'g++-7'
gcc ARM 64-bit [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
SELECTED_CC: aarch64-linux-gnu-gcc
SELECTED_CXX: aarch64-linux-gnu-g++
PACKAGES: 'qemu-system-arm qemu-user-static gcc-aarch64-linux-gnu g++-aarch64-linux-gnu'
MORE_OPTIONS: 'BUILD_STATIC=1'
QEMU_INTERPRETER: 'qemu-aarch64-static -L /usr/aarch64-linux-gnu'
gcc ARM 32-bit [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
SELECTED_CC: arm-linux-gnueabi-gcc
SELECTED_CXX: arm-linux-gnueabi-g++
PACKAGES: 'qemu-system-arm qemu-user-static gcc-arm-linux-gnueabi g++-arm-linux-gnueabi'
MORE_OPTIONS: 'BUILD_STATIC=1'
QEMU_INTERPRETER: 'qemu-arm-static -L /usr/arm-linux-gnueabi'
gcc PowerPC 64-bit [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
SELECTED_CC: powerpc64-linux-gnu-gcc
SELECTED_CXX: powerpc64-linux-gnu-g++
PACKAGES: 'qemu-system-ppc64 qemu-user-static gcc-powerpc64-linux-gnu g++-powerpc64-linux-gnu'
MORE_OPTIONS: 'BUILD_STATIC=1 DONT_BUILD_YAPPY=1 DONT_BUILD_DENSITY=1 DONT_BUILD_ZLING=1'
QEMU_INTERPRETER: 'qemu-ppc64-static -L /usr/powerpc64-linux-gnu'
gcc PowerPC 32-bit [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
SELECTED_CC: powerpc-linux-gnu-gcc
SELECTED_CXX: powerpc-linux-gnu-g++
PACKAGES: 'qemu-system-ppc qemu-user-static gcc-powerpc-linux-gnu g++-powerpc-linux-gnu'
MORE_OPTIONS: 'BUILD_STATIC=1 DONT_BUILD_YAPPY=1 DONT_BUILD_DENSITY=1 DONT_BUILD_ZLING=1'
QEMU_INTERPRETER: 'qemu-ppc-static -L /usr/powerpc-linux-gnu'
steps:
- script: |
uname -r
df -Th
ls -l ..
pwd
ls -l
echo SELECTED_CC=$SELECTED_CC SELECTED_CXX=$SELECTED_CXX imageName=$(imageName) OS_NAME=$OS_NAME SOURCE_LINE=$SOURCE_LINE
echo --- Configure required LLVM and Ubuntu Toolchain repositories
if [[ "$SOURCE_LINE" != "" ]]; then
curl -sSL "http://apt.llvm.org/llvm-snapshot.gpg.key" | sudo -E apt-key add -
echo "$SOURCE_LINE" | sudo tee -a /etc/apt/sources.list > /dev/null
fi
echo --- Update list of packages and download dependencies
if [[ "$OS_NAME" == "Linux" ]]; then
sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
sudo -E apt-get -yq update >> ~/apt-get-update.log 2>&1
echo Instaling PACKAGES=$PACKAGES
PACKAGES="$(eval echo $PACKAGES)"
echo Instaling PACKAGES=$PACKAGES
sudo -E apt-get -yq --no-install-suggests --no-install-recommends --allow-unauthenticated install $PACKAGES ccache
if [[ "$(Compiler)" == "clang" ]]; then
REAL_COMPILER_VER=`$SELECTED_CC --version | grep -o "clang version.*" | awk '{print $3}'`
else
REAL_COMPILER_VER=`$SELECTED_CC --version | head -1 | awk '{print $4}'`
fi
else
REAL_COMPILER_VER=`$SELECTED_CC --version | grep -o "clang version.*" | awk '{print $3}'`
brew update
brew install ccache
fi
UPDATE_TIME=$SECONDS
echo --- Packages updated in $UPDATE_TIME seconds.
echo "##vso[task.setvariable variable=REAL_COMPILER_VER]${REAL_COMPILER_VER%%-*}"
echo "##vso[task.setvariable variable=UPDATE_TIME]$UPDATE_TIME"
displayName: '*** Install Build Dependencies'
- task: Cache@2
continueOnError: true
inputs:
key: '"ccache"| "$(PARENT_BRANCH)" | "$(imageName)-$(Compiler)-$(REAL_COMPILER_VER)" | "$(Build.SourceVersion)"'
restoreKeys: '"ccache" | "$(PARENT_BRANCH)" | "$(imageName)-$(Compiler)-$(REAL_COMPILER_VER)"'
path: $(CCACHE_DIR)
displayName: '*** Download/upload ccached files'
- checkout: self
fetchDepth: 32
- script: |
df -Th
git submodule sync
git submodule update --init --force --depth=256
git submodule
displayName: '*** Update git submodules'
- script: |
echo "SELECTED_CC=$SELECTED_CC (`which $SELECTED_CC`) SELECTED_CXX=$SELECTED_CXX (`which $SELECTED_CXX`) REAL_COMPILER_VER=$REAL_COMPILER_VER"
$SELECTED_CC -v
$SELECTED_CXX -v
ccache --version
ccache -p
ccache --zero-stats
df -Th
if [[ "$OS_NAME" == "Linux" ]]; then
cat /proc/cpuinfo
fi
displayName: '*** System and compiler info'
- script: |
echo SELECTED_CC=$SELECTED_CC SELECTED_CXX=$SELECTED_CXX REAL_COMPILER_VER=$REAL_COMPILER_VER imageName=$(imageName) OS_NAME=$OS_NAME
df -Th
make -j2 CC="ccache $SELECTED_CC" CXX="ccache $SELECTED_CXX" $MORE_OPTIONS || exit 1
ccache --show-stats
echo -------------------------------------
file ./lzbench
$QEMU_INTERPRETER ./lzbench
df -Th
BUILD_TIME=$SECONDS
echo --- Build took $BUILD_TIME seconds. Packages updated in $UPDATE_TIME seconds.
echo '##vso[task.setvariable variable=BUILD_TIME]'$BUILD_TIME
displayName: '*** Build'
- script: |
$QEMU_INTERPRETER ./lzbench -eall ./lzbench || exit 1
RUN_TIME=$SECONDS
echo --- Total time $(($RUN_TIME + $UPDATE_TIME + $BUILD_TIME)) seconds. Run time $RUN_TIME seconds. Build took $BUILD_TIME seconds. Packages updated in $UPDATE_TIME seconds.
df -Th
rm -rf *
df -Th
displayName: '*** Run'
- job:
pool:
vmImage: 'windows-latest'
strategy:
matrix:
mingw32-gcc x86 32-bit [Windows]:
toolchain: 'mingw32'
arch: '32-bit'
SELECTED_CC: gcc
SELECTED_CXX: g++
MORE_OPTIONS: 'DONT_BUILD_GLZA=1 DONT_BUILD_LZHAM=1'
ARCHIVE: https://github.com/niXman/mingw-builds-binaries/releases/download/14.2.0-rt_v12-rev1/i686-14.2.0-release-posix-dwarf-ucrt-rt_v12-rev1.7z
mingw64-gcc x86 64-bit [Windows]:
toolchain: 'mingw64'
arch: '64-bit'
SELECTED_CC: gcc
SELECTED_CXX: g++
MORE_OPTIONS: 'DONT_BUILD_LZHAM=1'
ARCHIVE: https://github.com/niXman/mingw-builds-binaries/releases/download/14.2.0-rt_v12-rev1/x86_64-14.2.0-release-posix-seh-ucrt-rt_v12-rev1.7z
steps:
- powershell: |
Invoke-WebRequest -Uri '$(ARCHIVE)' -OutFile '$(Build.ArtifactStagingDirectory)\mingw.7z'
displayName: 'Download MinGW'
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(Build.ArtifactStagingDirectory)\mingw.7z'
destinationFolder: '$(Build.SourcesDirectory)\mingw'
- script: |
echo Building with $(toolchain) for $(arch) architecture
set PATH=$(Build.SourcesDirectory)\mingw\$(toolchain)\bin;%PATH%
where $(SELECTED_CC)
$(SELECTED_CXX) --version
mingw32-make -j2 CC=$(SELECTED_CC) CXX=$(SELECTED_CXX) $(MORE_OPTIONS) || exit 1
file lzbench.exe
lzbench.exe
displayName: 'Build with $(toolchain)'
- script: |
echo Running a build for $(toolchain) for $(arch) architecture
lzbench.exe -eall lzbench.exe || exit 1
displayName: 'Run for $(arch) architecture'