Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
b072605
build: add a meson build configuration
oscarbenjamin Apr 7, 2024
eb28e40
Add missing headers
oscarbenjamin Apr 8, 2024
e54ccfa
build: actually install libflint
oscarbenjamin Apr 8, 2024
b682277
build: use release as the default buildtype
oscarbenjamin Apr 8, 2024
5caf5fc
build: build fft_small and assembly with meson
oscarbenjamin Apr 11, 2024
a967783
build: build some tests with meson
oscarbenjamin Apr 11, 2024
e9f22f3
build: fix tests and add -Dtests=enabled option
oscarbenjamin Apr 12, 2024
013a37b
build: make meson build files with meson_boostrap
oscarbenjamin Apr 13, 2024
9f939be
build: generate build for fft_small and assembly
oscarbenjamin Apr 13, 2024
6792035
build: add dummy configure script
oscarbenjamin Apr 13, 2024
09c511b
build: fix paths in meson Makefile/configure
oscarbenjamin Apr 14, 2024
d311ba5
fix typo
oscarbenjamin Apr 14, 2024
9a5eefe
build: fix options in dummy configure script
oscarbenjamin Apr 14, 2024
2557ae1
build: make a generated headers dir in build
oscarbenjamin Apr 14, 2024
5973fd2
build: add variables to config.h and flint-config.h
oscarbenjamin Apr 14, 2024
5d64f24
build: generate all built headers in meson build
oscarbenjamin Apr 14, 2024
9482862
build: generate fmpz.c and config.m4 in meson build
oscarbenjamin Apr 14, 2024
982c2ce
build: add config.m4.in
oscarbenjamin Apr 14, 2024
0b2ac4f
build: add gmp_internals option to meson build
oscarbenjamin Apr 15, 2024
009b588
move mparam check after assembly
oscarbenjamin Apr 15, 2024
712e9b8
don't compile assembly if option disabled
oscarbenjamin Apr 15, 2024
d55615b
build: add pthread and tls options
oscarbenjamin Apr 15, 2024
af7a6c2
build: add most options to meson build
oscarbenjamin Apr 16, 2024
5a3a511
build: Fix Makefile install dep in meson build
oscarbenjamin Apr 20, 2024
1513f4f
build: Add make uninstall
oscarbenjamin Apr 20, 2024
a639c5e
build: fix installing headers in meson build
oscarbenjamin Apr 20, 2024
2ab6dae
build: disable avx2 and avx512 by default
oscarbenjamin Apr 20, 2024
81faa87
build: detect fft_small requirements in meson build
oscarbenjamin Apr 20, 2024
74944a1
build: fix fft_small checking
oscarbenjamin Apr 20, 2024
ba2770a
Run config.guess to check for exact CPU
oscarbenjamin Jun 20, 2024
30773a9
Move detection script to config dir
oscarbenjamin Jun 20, 2024
c34b981
Add CPU configuration tables to meson build
oscarbenjamin Jun 20, 2024
9024028
Enable assembly based on exact_cpu in meson build
oscarbenjamin Jun 22, 2024
f1ae7da
Use exact_cpu to detect FLINT_KNOW_STRONG_ORDER
oscarbenjamin Jun 22, 2024
e265a0f
Set FLINT_COVERAGE for coverage build
oscarbenjamin Jun 22, 2024
8c206b1
Add --with-ntl in meson build
oscarbenjamin Jun 22, 2024
74b94f9
Add header dependencies to libflint
oscarbenjamin Jun 16, 2026
93b8433
Update to FLINT 3.5 header files
oscarbenjamin Jun 16, 2026
6878b4c
Copy executable bit for ./configure
oscarbenjamin Jun 16, 2026
886955e
Detect FLINT_BITS by compiling with GMP
oscarbenjamin Jun 16, 2026
ecd216f
Add compiler pragmas in meson configuration
oscarbenjamin Jun 16, 2026
c2c4936
Set minimum meson version
oscarbenjamin Jun 16, 2026
3fe0775
Update exact CPU checking in meson
oscarbenjamin Jun 16, 2026
97a8e82
Only use assembly for 64 bit machines
oscarbenjamin Jun 16, 2026
758536a
Fix versions specified in the meson build
oscarbenjamin Jun 16, 2026
5ee526c
Pass CPU-specific compiler flags through
oscarbenjamin Jun 16, 2026
7599d59
Add GMP full link argument
oscarbenjamin Jun 16, 2026
4531b93
Fix AVX and assembly handling in meson build
oscarbenjamin Jun 16, 2026
615eb31
Add ABI option to the meson build
oscarbenjamin Jun 16, 2026
c25bf8c
Add BLAS option to meson build
oscarbenjamin Jun 16, 2026
3c22b0c
Add Boehm GC option to mesno build
oscarbenjamin Jun 16, 2026
7796983
Add NTL option in the meson build
oscarbenjamin Jun 16, 2026
cce2d33
Check manddatory heraders during meson configure
oscarbenjamin Jun 16, 2026
3db40df
Build tests automatically for meson test
oscarbenjamin Jun 17, 2026
41795e0
Update notes about missing options in meson build
oscarbenjamin Jun 17, 2026
8c167ff
Remove stale comments
oscarbenjamin Jun 17, 2026
d4dae7b
Add check for _alligned_malloc in meson build
oscarbenjamin Jun 17, 2026
e05d691
Add asm syntax detection in the meson build
oscarbenjamin Jun 17, 2026
7edec77
Move non-generated meson files to root directory
oscarbenjamin Jun 17, 2026
c4ec5b8
CI: add a CI job as a basic test of the meson build
oscarbenjamin Jun 17, 2026
5bc13eb
build: Add CPU args for fft_small
oscarbenjamin Jun 17, 2026
9c4dc6c
Increase test timeout from 30s to 120s
oscarbenjamin Jun 17, 2026
08c1c06
CI: Use meson the ARM CI jobs
oscarbenjamin Jun 17, 2026
4cff28c
CI: Use meson for alpine 32 and mingw-gcc jobs
oscarbenjamin Jun 17, 2026
2f65498
build: don't require a C++ compiler if not using NTL
oscarbenjamin Jun 17, 2026
50f4652
suppress the same warnings in the meson build
oscarbenjamin Jun 17, 2026
bf24b9e
Add dependency on the generated headers
oscarbenjamin Jun 17, 2026
9cae23f
CI use meson instead of cmake for the MSVC job
oscarbenjamin Jun 17, 2026
0c735ea
CI: use the vcpkg pkgconfig rather than the Strawberry one in CI
oscarbenjamin Jun 17, 2026
c161f72
CI: tell meson to use CMake to find pthreads
oscarbenjamin Jun 17, 2026
8b8c0dd
build examples with meson and use meson for ASan CI job
oscarbenjamin Jun 17, 2026
1210252
Show vcpkg pthreads information (for debugging)
oscarbenjamin Jun 17, 2026
11739a8
CI: Use meson for ASan job
oscarbenjamin Jun 17, 2026
1a7ff49
Try more approaches for vcpkg pthreads...
oscarbenjamin Jun 17, 2026
6375c95
More attempts at pthreads for MSVC
oscarbenjamin Jun 17, 2026
837100d
build: add /experimental:c11atomics for MSVC
oscarbenjamin Jun 17, 2026
117b782
meson: export symbols for MSVC shared builds
oscarbenjamin Jun 18, 2026
8052851
Suppress MSVC warning C4146
oscarbenjamin Jun 18, 2026
31b4180
CI: Use meson for the coverage job in CI
oscarbenjamin Jun 18, 2026
f24acb8
meson: generate MSVC exports from public headers
oscarbenjamin Jun 18, 2026
34e58e4
CI: install gcovr for coverage build
oscarbenjamin Jun 18, 2026
9e70a8b
meson: Use dumpbin for exported symbols with MSVC
oscarbenjamin Jun 18, 2026
fa3a141
Use ninja directly to build the coverage target
oscarbenjamin Jun 18, 2026
f145c1e
meson: work around Windows command length limits
oscarbenjamin Jun 18, 2026
8ba9d64
CI: use meaon for the regressino check job
oscarbenjamin Jun 18, 2026
9bcf189
CI: regression-check use -O0
oscarbenjamin Jun 18, 2026
165116b
meson: add -Wmissing-prototypes
oscarbenjamin Jun 18, 2026
0ee03f0
meson: try to match compiler flags with autotools
oscarbenjamin Jun 18, 2026
9958f44
tmp: add debug scripts for checking command line flags
oscarbenjamin Jun 18, 2026
11538be
meson: use -pedantic to match autotools
oscarbenjamin Jun 18, 2026
c5885c1
meson: add profile target to build profile executables
oscarbenjamin Jun 19, 2026
03efe0e
meson: add tunes build target
oscarbenjamin Jun 19, 2026
8486149
meson: add mpfr_check optino to check MPFR internals
oscarbenjamin Jun 19, 2026
7b6f598
meson: remove libtool_lock option
oscarbenjamin Jun 19, 2026
974b02a
meson: Add a Makefile wrapper around meson
oscarbenjamin Jun 19, 2026
1218cec
Don't use feature flags for build targets
oscarbenjamin Jun 19, 2026
aa2b1c7
meson: don't include examples as tests
oscarbenjamin Jun 19, 2026
df50b15
meson: link each module into a static library
oscarbenjamin Jun 19, 2026
6ee36b5
meson: don't add -lgmp multipple times
oscarbenjamin Jun 19, 2026
24090da
meson: add all missing make rules to match autotools
oscarbenjamin Jun 19, 2026
a4556f7
meson: add make bench to run benchmarks
oscarbenjamin Jun 20, 2026
8cd1ea3
meson: add dev/gcc to build ad-hoc executables
oscarbenjamin Jun 20, 2026
d6172f3
meson: create build links after meson and set -g
oscarbenjamin Jun 20, 2026
9105ebd
meson: set debaug=false for regression check target
oscarbenjamin Jun 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
276 changes: 163 additions & 113 deletions .github/workflows/CI.yml

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ config/*
!config/config.sub
!config/configfsf.guess
!config/configfsf.sub
!config/check_assembly.py
!config/generate_msvc_def.py
!config/meson.build
config.log
confdefs.h
conftest.*
/Makefile
doc/build
doc/latex/flint-manual.*
!doc/latex/flint-manual.tex
Expand Down Expand Up @@ -66,3 +68,5 @@ config.m4
src/flint-mparam.h
.gdb_history
vgcore.*
src/**/meson.build
examples/meson.build
164 changes: 164 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# Convenience wrapper for the Meson build.
#
# Override BUILD to use a different build directory, for example:
# make check BUILD=build-debug

BUILD ?= build
MESON ?= $(if $(wildcard .venv/bin/meson),.venv/bin/meson,meson)
MESON_SETUP_ARGS ?=
MESON_COMPILE_ARGS ?=
MESON_TEST_ARGS ?=
GDB ?= gdb
VALGRIND ?= valgrind
VALGRIND_ARGS ?= --track-origins=yes --leak-check=full --show-reachable=yes
DESTDIR ?=

.PHONY: all setup library shared static test tests check debug valgrind examples checkexamples profile tune bench coverage coverage_html install uninstall clean distclean print-%

ifneq ($(NJOBS),)
number_generator = $(words $2) $(if $(word $1,$2),,$(call number_generator,$1,w $2))
THREAD_LIST := $(call number_generator,$(NJOBS),w)
CHECK_THREAD_TARGETS := $(foreach mod,$(MOD),$(foreach num,$(THREAD_LIST),check-$(mod)-thread-$(num)))

define check_mod_build_rule
.PHONY: check-$(1)-build
check-$(1)-build: setup
$$(MESON) compile -C $$(BUILD) src/$(1)/test/main $$(MESON_COMPILE_ARGS)
endef

define check_thread_rule
.PHONY: check-$(1)-thread-$(2)
check-$(1)-thread-$(2): check-$(1)-build
@exe="$$(BUILD)/src/$(1)/test/main"; \
if [ ! -f "$$$$exe" ]; then exe="$$$$exe.exe"; fi; \
echo "$$$$exe --numthreads=$$(NJOBS) --thread=$(2)"; \
LD_LIBRARY_PATH="$$(BUILD):$$$$LD_LIBRARY_PATH" DYLD_LIBRARY_PATH="$$(BUILD):$$$$DYLD_LIBRARY_PATH" "$$$$exe" --numthreads=$$(NJOBS) --thread=$(2)
endef

$(foreach mod,$(MOD),$(eval $(call check_mod_build_rule,$(mod))))
$(foreach mod,$(MOD),$(foreach num,$(THREAD_LIST),$(eval $(call check_thread_rule,$(mod),$(num)))))
endif

all: library

library: setup
$(MESON) compile -C $(BUILD) $(MESON_COMPILE_ARGS)

shared:
$(MESON) setup "$(BUILD)" --reconfigure -Ddefault_library=shared $(MESON_SETUP_ARGS)
$(MESON) compile -C $(BUILD) $(MESON_COMPILE_ARGS)

static:
$(MESON) setup "$(BUILD)" --reconfigure -Ddefault_library=static $(MESON_SETUP_ARGS)
$(MESON) compile -C $(BUILD) $(MESON_COMPILE_ARGS)

setup:
@if [ ! -f "$(BUILD)/build.ninja" ]; then \
$(MESON) setup "$(BUILD)" $(MESON_SETUP_ARGS); \
fi

test: check

tests: setup
$(MESON) compile -C $(BUILD) tests $(MESON_COMPILE_ARGS)
@python3 dev/create_build_links.py "$(BUILD)"

check: setup
ifneq ($(NJOBS),)
ifdef MOD
ifndef ARGS
check: $(CHECK_THREAD_TARGETS)
endif
endif
endif

ifdef PYTHON
$(MESON) compile -C $(BUILD) $(MESON_COMPILE_ARGS)
@LD_LIBRARY_PATH="$(BUILD):$${LD_LIBRARY_PATH}" DYLD_LIBRARY_PATH="$(BUILD):$${DYLD_LIBRARY_PATH}" python3 src/python/flint_ctypes.py
@echo ''
@echo 'All Python tests passed.'
else
ifdef ARGS
ifneq ($(words $(sort $(MOD))),1)
$(error Can only check one module with arguments)
endif
$(MESON) test -C $(BUILD) $(MESON_TEST_ARGS) --test-args='$(ARGS)' $(MOD)
else
ifdef NJOBS
ifdef MOD
@echo ''
@echo 'All tests passed for $(sort $(MOD)).'
else
$(MESON) test -C $(BUILD) $(MESON_TEST_ARGS)
endif
else
$(MESON) test -C $(BUILD) $(MESON_TEST_ARGS) $(MOD)
endif
endif
endif

debug: setup
ifndef MOD
$(error Use make debug MOD=module ARGS='test arguments')
endif
ifndef ARGS
$(error Use make debug MOD=module ARGS='test arguments')
endif
$(MESON) test -C $(BUILD) --gdb --gdb-path $(GDB) --interactive $(MESON_TEST_ARGS) --test-args='$(ARGS)' $(MOD)

valgrind: setup
$(MESON) test -C $(BUILD) --wrapper '$(VALGRIND) $(VALGRIND_ARGS)' $(MESON_TEST_ARGS) $(MOD)

examples: setup
$(MESON) compile -C $(BUILD) examples $(MESON_COMPILE_ARGS)

checkexamples: setup
$(MESON) compile -C $(BUILD) examples $(MESON_COMPILE_ARGS)
@for src in examples/*.c; do \
example=$$(basename "$$src" .c); \
./dev/check_examples.sh "$$example" "$(BUILD)/examples"; \
done

profile: setup
ifdef MOD
$(MESON) compile -C $(BUILD) $(MOD)-profile $(MESON_COMPILE_ARGS)
else
$(MESON) compile -C $(BUILD) profile $(MESON_COMPILE_ARGS)
endif
@python3 dev/create_build_links.py "$(BUILD)"

tune: setup
$(MESON) compile -C $(BUILD) tune $(MESON_COMPILE_ARGS)
@python3 dev/create_build_links.py "$(BUILD)"

bench: setup
$(MESON) compile -C $(BUILD) examples fmpz-profile fmpz_factor-profile fmpz_poly_factor-profile fmpz_mpoly_factor-profile nmod_mpoly_factor-profile $(MESON_COMPILE_ARGS)
@python3 dev/create_build_links.py "$(BUILD)"
@LD_LIBRARY_PATH="$(BUILD):$${LD_LIBRARY_PATH}" DYLD_LIBRARY_PATH="$(BUILD):$${DYLD_LIBRARY_PATH}" python3 dev/bench.py

coverage:
$(MESON) setup "$(BUILD)" --reconfigure -Db_coverage=true $(MESON_SETUP_ARGS); \
$(MESON) test -C $(BUILD) $(MESON_TEST_ARGS) $(MOD)
$(MESON) coverage -C $(BUILD)

coverage_html:
$(MESON) setup "$(BUILD)" --reconfigure -Db_coverage=true $(MESON_SETUP_ARGS); \
$(MESON) test -C $(BUILD) $(MESON_TEST_ARGS) $(MOD)
$(MESON) coverage -C $(BUILD) --html

install: setup
$(MESON) install -C $(BUILD) $(if $(DESTDIR),--destdir $(DESTDIR),)

uninstall:
$(MESON) compile -C $(BUILD) uninstall

clean:
@if [ -f "$(BUILD)/build.ninja" ]; then \
$(MESON) compile -C $(BUILD) --clean; \
fi

distclean:
rm -rf "$(BUILD)"

print-%:
@echo "$*=$($*)"
14 changes: 14 additions & 0 deletions capture_autotools_commands.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
#
# Run with any make arguments e.g.:
# ./capture_autotools_commands.sh -j10

set -eu

make clean
./bootstrap.sh
./configure
echo ::::::::::::::::::::
echo ::::::::::::::::::::
echo ::::::::::::::::::::
make V=1 "$@" > autotools_commands.txt
Loading
Loading