-
Notifications
You must be signed in to change notification settings - Fork 245
643 lines (514 loc) · 19.9 KB
/
CI.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
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
name: CI
on:
pull_request:
push:
env:
GLOBAL_MULTIPLIER: 1
concurrency:
# group by workflow and ref; the last slightly strange component ensures that for pull
# requests, we limit to 1 concurrent job, but for the main branch we don't
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/main' || github.run_number }}
# Cancel intermediate builds, but only if it is a pull request build.
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
##############################################################################
# ubuntu, gcc, code coverage
##############################################################################
ubuntu-codecoverage:
name: Ubuntu GCC, Code Coverage (x10)
runs-on: ubuntu-24.04
env:
CC: "gcc"
FLINT_TEST_MULTIPLIER: "10"
steps:
- name: "Rescale multiplier"
run: |
FLINT_TEST_MULTIPLIER=$(echo "${FLINT_TEST_MULTIPLIER} * ${GLOBAL_MULTIPLIER}" | bc)
echo "FLINT_TEST_MULTIPLIER=${FLINT_TEST_MULTIPLIER}"
echo "FLINT_TEST_MULTIPLIER=${FLINT_TEST_MULTIPLIER}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: "Setup"
run: |
sudo apt-get install -y \
libgmp-dev \
libmpfr-dev \
autoconf \
libtool-bin \
lcov
# Check versions
gcc --version
make --version
autoconf --version
libtool --version
lcov --version
python3 --version
echo "MAKE=make -j$(expr $(nproc) + 1) --output-sync=target" >> $GITHUB_ENV
- name: "Configure"
run: |
./bootstrap.sh
./configure \
CC=${CC} \
--enable-avx2 \
--enable-coverage
- name: "Compile library"
run: |
$MAKE
ldd libflint.so
- name: "Compile tests"
run: |
$MAKE tests
- name: "Check"
run: |
$MAKE check
- name: "Check Python"
run: |
$MAKE check PYTHON=1
- name: "Gather coverage data"
run: |
$MAKE coverage
- name: "Upload coverage data"
uses: codecov/codecov-action@v4
if: github.repository == 'flintlib/flint'
with:
files: build/coverage/coverage.info
token: ${{ secrets.CODECOV_TOKEN }}
##############################################################################
# gcc build check no regressions
##############################################################################
gcc-build-regression-check:
name: GCC build regression check (no tests)
runs-on: ubuntu-24.04
env:
CC: "gcc"
CFLAGS: "-march=native -std=c11 -Wall -Wextra -Werror"
MODULES: "build/thread_pool_merged.lo build/thread_support_merged.lo build/ulong_extras_merged.lo build/long_extras_merged.lo build/perm_merged.lo build/double_extras_merged.lo build/d_vec_merged.lo build/d_mat_merged.lo build/mpn_extras_merged.lo build/mpfr_vec_merged.lo build/mpfr_mat_merged.lo build/nmod_merged.lo build/nmod_vec_merged.lo build/nmod_mat_merged.lo build/nmod_poly_merged.lo build/mpn_mod_merged.lo build/fmpz_merged.lo build/fmpz_vec_merged.lo build/fmpz_mat_merged.lo build/fmpz_poly_merged.lo build/fmpz_mod_merged.lo build/fmpz_mod_vec_merged.lo build/fmpz_mod_mat_merged.lo build/fmpz_mod_poly_merged.lo build/fmpq_merged.lo build/fmpq_vec_merged.lo build/fmpq_mat_merged.lo build/fmpq_poly_merged.lo build/fq_merged.lo build/fq_vec_merged.lo build/fq_mat_merged.lo build/fq_poly_merged.lo build/fq_nmod_merged.lo build/fq_nmod_vec_merged.lo build/fq_nmod_mat_merged.lo build/fq_nmod_poly_merged.lo build/fq_zech_merged.lo build/fq_zech_mat_merged.lo build/fq_zech_poly_merged.lo build/fq_default_merged.lo build/fq_default_mat_merged.lo build/fq_default_poly_merged.lo build/fq_embed_merged.lo build/fq_nmod_embed_merged.lo build/fq_zech_embed_merged.lo build/padic_merged.lo build/padic_mat_merged.lo build/padic_poly_merged.lo build/qadic_merged.lo build/nmod_poly_factor_merged.lo build/fmpz_factor_merged.lo build/fmpz_poly_factor_merged.lo build/fmpz_mod_poly_factor_merged.lo build/fq_poly_factor_merged.lo build/fq_nmod_poly_factor_merged.lo build/fq_zech_poly_factor_merged.lo build/fq_default_poly_factor_merged.lo build/nmod_poly_mat_merged.lo build/fmpz_poly_mat_merged.lo build/mpoly_merged.lo build/nmod_mpoly_merged.lo build/fmpz_mpoly_merged.lo build/fmpz_mod_mpoly_merged.lo build/fmpq_mpoly_merged.lo build/fq_nmod_mpoly_merged.lo build/fq_zech_mpoly_merged.lo build/nmod_mpoly_factor_merged.lo build/fmpz_mpoly_factor_merged.lo build/fmpz_mod_mpoly_factor_merged.lo build/fmpq_mpoly_factor_merged.lo build/fq_nmod_mpoly_factor_merged.lo build/fq_zech_mpoly_factor_merged.lo build/fft_merged.lo build/fft_small_merged.lo"
# Everything until fmpz_poly_q
steps:
- uses: actions/checkout@v4
- name: "Setup"
run: |
sudo apt-get install -y libgmp-dev libmpfr-dev autoconf libtool-bin
gcc --version
make --version
autoconf --version
libtool --version
echo "MAKE=make -j$(expr $(nproc) + 1) --output-sync=target" >> $GITHUB_ENV
- name: "Configure"
run: |
./bootstrap.sh
./configure \
CC=${CC} \
CFLAGS="${CFLAGS}" \
--disable-debug
- name: "Check regression in a subset of modules"
run: |
$MAKE $MODULES
##############################################################################
# ubuntu gcc with assert
##############################################################################
ubuntu-gcc-assert:
name: Ubuntu GCC with NTL (assert, x2)
runs-on: ubuntu-24.04
env:
CC: "gcc"
FLINT_TEST_MULTIPLIER: "2"
steps:
- name: "Rescale multiplier"
run: |
FLINT_TEST_MULTIPLIER=$(echo "${FLINT_TEST_MULTIPLIER} * ${GLOBAL_MULTIPLIER}" | bc)
echo "FLINT_TEST_MULTIPLIER=${FLINT_TEST_MULTIPLIER}"
echo "FLINT_TEST_MULTIPLIER=${FLINT_TEST_MULTIPLIER}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: "Setup"
run: |
sudo apt-get install -y libgmp-dev libmpfr-dev libntl-dev autoconf libtool-bin
gcc --version
make --version
autoconf --version
libtool --version
echo "MAKE=make -j$(expr $(nproc) + 1) --output-sync=target" >> $GITHUB_ENV
- name: "Configure"
run: |
./bootstrap.sh
./configure \
CC=${CC} \
--with-ntl \
--enable-assert \
--disable-debug
- name: "Compile library"
run: |
$MAKE
ldd libflint.so
- name: "Compile tests"
run: |
$MAKE tests
- name: "Check"
run: |
$MAKE check
##############################################################################
# macos (M1) with clang
##############################################################################
macos-m1:
name: macOS-M1, Clang (x3)
runs-on: macos-14
env:
FLINT_TEST_MULTIPLIER: "3"
steps:
- name: "Rescale multiplier"
run: |
FLINT_TEST_MULTIPLIER=$(echo "${FLINT_TEST_MULTIPLIER} * ${GLOBAL_MULTIPLIER}" | bc)
echo "FLINT_TEST_MULTIPLIER=${FLINT_TEST_MULTIPLIER}"
echo "FLINT_TEST_MULTIPLIER=${FLINT_TEST_MULTIPLIER}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: "Setup"
run: |
brew install make
brew install gmp
brew install mpfr
brew install autoconf
brew install libtool
brew install automake
$(brew --prefix llvm@15)/bin/clang --version
gmake --version
autoconf --version
echo "MAKE=gmake -j$(expr $(nproc) + 1) -l 10 --output-sync=target" >> $GITHUB_ENV
- name: "Configure"
run: |
./bootstrap.sh
./configure \
CC=$(brew --prefix llvm@15)/bin/clang \
--with-gmp=$(brew --prefix) \
--with-mpfr=$(brew --prefix) \
--disable-debug
- name: "Compile library"
run: |
$MAKE
- name: "Compile tests"
run: |
$MAKE tests
- name: "Check"
run: |
$MAKE check
##############################################################################
# macos (x86) with clang and blas
##############################################################################
macos-x86:
name: macOS-x86 Clang with BLAS (x2)
runs-on: macos-12
env:
FLINT_TEST_MULTIPLIER: "2"
steps:
- name: "Rescale multiplier"
run: |
FLINT_TEST_MULTIPLIER=$(echo "${FLINT_TEST_MULTIPLIER} * ${GLOBAL_MULTIPLIER}" | bc)
echo "FLINT_TEST_MULTIPLIER=${FLINT_TEST_MULTIPLIER}"
echo "FLINT_TEST_MULTIPLIER=${FLINT_TEST_MULTIPLIER}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: "Setup"
run: |
brew install make
brew install gmp
brew install mpfr
brew install autoconf
brew install libtool
brew install automake
brew install openblas
$(brew --prefix llvm@15)/bin/clang --version
gmake --version
autoconf --version
echo "MAKE=gmake -j$(expr $(nproc) + 1) -l 10 --output-sync=target" >> $GITHUB_ENV
- name: "Configure"
run: |
./bootstrap.sh
./configure \
CC=$(brew --prefix llvm@15)/bin/clang \
--with-gmp=$(brew --prefix) \
--with-mpfr=$(brew --prefix) \
--with-blas=$(brew --prefix)/opt/openblas \
--disable-debug
- name: "Compile library"
run: |
$MAKE
- name: "Compile tests"
run: |
$MAKE tests
- name: "Check"
run: |
$MAKE check
#############################################################################
# ubuntu with clang
#############################################################################
ubuntu-clang:
name: Ubuntu Clang with examples (x5)
runs-on: ubuntu-latest
env:
LOCAL: ${{ github.workspace }}/local
LDFLAGS: "-Wl,-rpath,$LOCAL/lib"
CC: "clang"
FLINT_TEST_MULTIPLIER: "5"
steps:
- name: "Rescale multiplier"
run: |
FLINT_TEST_MULTIPLIER=$(echo "${FLINT_TEST_MULTIPLIER} * ${GLOBAL_MULTIPLIER}" | bc)
echo "FLINT_TEST_MULTIPLIER=${FLINT_TEST_MULTIPLIER}"
echo "FLINT_TEST_MULTIPLIER=${FLINT_TEST_MULTIPLIER}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: "Setup"
run: |
sudo apt-get install -y libgmp-dev libmpfr-dev autoconf libtool-bin perl
clang --version
make --version
autoconf --version
libtool --version
perl --version
echo "MAKE=make -j$(expr $(nproc) + 1) --output-sync=target" >> $GITHUB_ENV
- name: "Configure"
run: |
./bootstrap.sh
./configure \
CC=${CC} \
--disable-debug
- name: "Compile library"
run: |
$MAKE
ldd libflint.so
- name: "Compile tests"
run: |
$MAKE tests
- name: "Check"
run: |
$MAKE check
- name: "Compile examples"
run: |
$MAKE examples
- name: "Check examples"
run: |
$MAKE checkexamples
#############################################################################
# mingw with gcc
#############################################################################
mingw64-gcc:
name: MinGW GCC (x0.5)
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
env:
CC: "gcc"
FLINT_TEST_MULTIPLIER: "0.5"
steps:
- uses: actions/checkout@v4
- name: "Setup MinGW"
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: true
install: bc mingw-w64-x86_64-gcc mingw-w64-x86_64-autotools
- name: "Rescale multiplier"
run: |
FLINT_TEST_MULTIPLIER=$(echo "${FLINT_TEST_MULTIPLIER} * ${GLOBAL_MULTIPLIER}" | bc)
echo "FLINT_TEST_MULTIPLIER=${FLINT_TEST_MULTIPLIER}"
echo "FLINT_TEST_MULTIPLIER=${FLINT_TEST_MULTIPLIER}" >> $GITHUB_ENV
- name: "Setup"
run: |
gcc --version
make --version
autoconf --version
libtool --version
echo "MAKE=make -j$(expr $(nproc) + 1) --output-sync=target" >> $GITHUB_ENV
- name: "Configure"
run: |
./bootstrap.sh
./configure \
CC=${CC} \
--disable-debug
- name: "Compile library"
run: |
${MAKE}
- name: "Compile tests"
run: |
${MAKE} tests
- name: "Check"
run: |
${MAKE} check
##############################################################################
# msvc
##############################################################################
msvc:
name: MSVC (x1)
runs-on: windows-latest
env:
FLINT_TEST_MULTIPLIER: 1
TIMEOUT: 150
steps:
- name: "Rescale multiplier (powershell)"
run: |
$FLINT_TEST_MULTIPLIER = $env:FLINT_TEST_MULTIPLIER * $env:GLOBAL_MULTIPLIER
echo "FLINT_TEST_MULTIPLIER=$FLINT_TEST_MULTIPLIER | Out-File -Append -FilePath $env:GITHUB_ENV"
$TIMEOUT = $env:TIMEOUT * $env:GLOBAL_MULTIPLIER
echo "TIMEOUT=$TIMEOUT | Out-File -Append -FilePath $env:GITHUB_ENV"
shell: powershell
- uses: actions/checkout@v4
- name: "Setup cache for dependencies"
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: "Install dependencies"
run: |
vcpkg install gmp mpfr pthreads --binarysource="clear;x-gha,readwrite"
- name: "Setup MSVC"
uses: ilammy/[email protected]
with:
arch: x86_64
- name: "Configure"
run: |
mkdir build
cd build
# For single build, we need atomics
cmake `
-G "Ninja" `
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake `
-DCMAKE_C_FLAGS="/wd4018 /wd4146 /wd4244 /wd4267 /wd4305 /wd4996 /experimental:c11atomics" `
-DBUILD_TESTING=ON `
-DCMAKE_BUILD_TYPE=Release `
..
- name: "Build"
run: |
cd build
# NOTE: Number of threads for Github's CI runners are 4.
cmake --build . -j5
- name: "Check"
run: |
cd build
set "FLINT_TEST_MULTIPLIER=$env:FLINT_TEST_MULTIPLIER"
ctest -j5 --output-on-failure --timeout $env:TIMEOUT
shell: powershell
##############################################################################
# alpine linux, musl, 32-bit (assert)
##############################################################################
alpine-32bit:
name: Alpine Linux, musl, 32-bit (assert, x1.5)
runs-on: ubuntu-latest
env:
CC: "gcc"
FLINT_TEST_MULTIPLIER: "1.5"
steps:
- name: "Rescale multiplier"
run: |
FLINT_TEST_MULTIPLIER=$(echo "${FLINT_TEST_MULTIPLIER} * ${GLOBAL_MULTIPLIER}" | bc)
echo "FLINT_TEST_MULTIPLIER=${FLINT_TEST_MULTIPLIER}"
echo "FLINT_TEST_MULTIPLIER=${FLINT_TEST_MULTIPLIER}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: "Setup latest Alpine Linux"
uses: jirutka/setup-alpine@v1
with:
arch: x86
branch: edge
packages: >
gmp-dev
mpfr-dev
gcc
musl-dev
make
autoconf
automake
libtool
- name: "Setup"
run: |
gcc --version
make --version
autoconf --version
libtool --version
echo "MAKE=make -j$(expr $(nproc) + 1) --output-sync=target" >> $GITHUB_ENV
shell: alpine.sh {0}
- name: "Configure"
run: |
./bootstrap.sh
./configure \
CC=${CC} \
--enable-assert \
--disable-debug
shell: alpine.sh {0}
- name: "Compile library"
run: |
$MAKE
shell: alpine.sh {0}
- name: "Compile tests"
run: |
$MAKE tests
shell: alpine.sh {0}
- name: "Check"
run: |
$MAKE check
shell: alpine.sh {0}
##############################################################################
# nemo
##############################################################################
nemo:
name: Nemo.jl (temporary branch)
runs-on: ubuntu-24.04
env:
LOCAL: ${{ github.workspace }}/local
CC: "gcc"
steps:
- uses: actions/checkout@v4
- name: "Setup"
run: |
sudo apt-get install -y sed
sudo apt-get install -y autoconf
sudo apt-get install -y libtool-bin
gcc --version
make --version
autoconf --version
libtool --version
julia --version
julia -e 'println(Base.BinaryPlatforms.HostPlatform())'
echo "MAKE=make -j$(expr $(nproc) + 1) --output-sync=target" >> $GITHUB_ENV
- name: "Configure"
run: |
# Find path to GMP and MPFR
gmp_path=$(julia -e 'include("dev/find_gmp_mpfr.jl"); print(gmp_artifact_dir())')
echo "Path to GMP: ${gmp_path}"
mpfr_path=$(julia -e 'include("dev/find_gmp_mpfr.jl"); print(mpfr_artifact_dir())')
echo "Path to MPFR: ${mpfr_path}"
# Make sure that we output an soname which corresponds to FLINT_JLL's
# soname
wget https://raw.githubusercontent.com/JuliaPackaging/Yggdrasil/master/F/FLINT/build_tarballs.jl
FLINT_JLL_VERSION=$(grep "upstream_version =" build_tarballs.jl | sed "s/upstream_version = v\"\([0-9\.]*\)\"/\1/")
FLINT_JLL_SONAME=$(grep "$FLINT_JLL_VERSION => " configure.ac | sed "s/# $FLINT_JLL_VERSION => \([0-9\.]\+\)/\1/")
FLINT_JLL_MAJOR=$(echo $FLINT_JLL_SONAME | sed "s/\([0-9]\+\)\.[0-9]\+\.[0-9]\+/\1/")
FLINT_JLL_MINOR=$(echo $FLINT_JLL_SONAME | sed "s/[0-9]\+\.\([0-9]\+\)\.[0-9]\+/\1/")
FLINT_JLL_PATCH=$(echo $FLINT_JLL_SONAME | sed "s/[0-9]\+\.[0-9]\+\.\([0-9]\+\)/\1/")
sed -i "s/^\(FLINT_MAJOR_SO=\)[0-9]\+/\1$FLINT_JLL_MAJOR/" configure.ac
sed -i "s/^\(FLINT_MINOR_SO=\)[0-9]\+/\1$FLINT_JLL_MINOR/" configure.ac
sed -i "s/^\(FLINT_PATCH_SO=\)[0-9]\+/\1$FLINT_JLL_PATCH/" configure.ac
# Now we can configure FLINT. However, recent versions of MPFR_jll has
# memory sanitation which messes with finding mpfr_init in the
# configure-script. Hence, we also omit the check for finding MPFR.
# FIXME: Probably want to fix this.
./bootstrap.sh
./configure \
CC=${CC} \
--prefix=${LOCAL} \
--with-gmp=${gmp_path} \
--with-mpfr=${mpfr_path} \
--disable-mpfr-check \
--disable-debug
- name: "Compile and install"
run: |
$MAKE
$MAKE install
- name: "Set up Nemo.jl"
run: |
# Use Nemo's master branch
git clone https://github.com/Nemocas/Nemo.jl.git
# Override FLINT_jll's libflint with ours
julia -e "import Pkg; Pkg.develop(path=\"./Nemo.jl\");"
echo -e "[e134572f-a0d5-539d-bddf-3cad8db41a82]\nFLINT = \"${LOCAL}\"" > ~/.julia/artifacts/Overrides.toml
touch Nemo.jl/src/Nemo.jl
julia -e "using Nemo; println(\"Path to Nemo's libflint:\", Nemo.libflint)"
- name: "Check Nemo.jl"
run: |
julia -e "import Pkg; Pkg.test(\"Nemo\")"