Skip to content

Commit bdcad6c

Browse files
Merge pull request #380 from oscarbenjamin/pr_bump_flint_34
Bump FLINT to 3.4.0
2 parents 63a3480 + 69a626e commit bdcad6c

38 files changed

Lines changed: 318 additions & 63 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Compatible versions:
144144

145145
| python-flint | Release date | CPython | FLINT | Cython |
146146
|--------------|---------------|-------------|------------|------------------|
147-
| `0.9.0` | ??? | `3.11-3.14` | `3.0-3.3` | `3.1-3.2?` |
147+
| `0.9.0` | ??? | `3.11-3.14` | `3.0-3.4` | `3.1-3.2?` |
148148
| `0.8.0` | 29th Aug 2025 | `3.11-3.14` | `3.0-3.3` | `3.1` only |
149149
| `0.7.0` | 16th Mar 2025 | `3.11-3.13` | `3.0-3.2` | `3.0.11-3.1.0a1` |
150150
| `0.6.0` | 1st Feb 2024 | `3.9-3.12` | `3.0` only | `3.0` only |

bin/build_dependencies_unix.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ cd flint-$FLINTVER
341341
echo --------------------------------------------
342342
echo " patching FLINT"
343343
echo --------------------------------------------
344-
patch -N -Z -p1 < ../../../bin/patch-flint-windows-arm64-link.diff
344+
patch -N -Z -p1 < ../../../bin/patch-flint-windows-arm64-link-$FLINTVER.diff
345345
fi
346346
if [ "$PATCH_IMMINTRIN" = "yes" ]; then
347347
echo

bin/build_variables.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ MPIRVER=3.0.0 # MPIR build no longer works (not clear where to download from)
2121
# These are the actual dependencies used (at least by default):
2222
GMPVER=6.3.0
2323
MPFRVER=4.2.2
24-
FLINTVER='3.3.1'
24+
FLINTVER=3.4.0
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
From e83a896d212e2ec41407b20ef0f011851eb1c525 Mon Sep 17 00:00:00 2001
2+
From: Mate Soos <soos.mate@gmail.com>
3+
Date: Fri, 6 Mar 2026 20:32:25 +0100
4+
Subject: [PATCH] Fix compilation
5+
6+
---
7+
src/profiler.h | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+
diff --git a/src/profiler.h b/src/profiler.h
11+
index d5be9b9573..007710f82e 100644
12+
--- a/src/profiler.h
13+
+++ b/src/profiler.h
14+
@@ -27,7 +27,7 @@
15+
#if defined(_MSC_VER) || defined(__x86_64__) || defined(__aarch64__)
16+
# define FLINT_HAVE_get_cycle_counter 1
17+
#endif
18+
-#if (defined(__unix__) && !defined(__CYGWIN__)) || defined(__APPLE__)
19+
+#if (defined(__unix__) && !defined(__CYGWIN__) && !defined(__EMSCRIPTEN__)) || defined(__APPLE__)
20+
# define FLINT_HAVE_getrusage 1
21+
#endif
22+
File renamed without changes.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
diff --git a/Makefile.in b/Makefile.in
2+
index 8185fa609..a3822f53b 100644
3+
--- a/Makefile.in
4+
+++ b/Makefile.in
5+
@@ -424,22 +424,16 @@ endif
6+
7+
ifneq ($(SHARED), 0)
8+
shared: $(FLINT_DIR)/$(FLINT_LIB_FULL)
9+
-# The following is to avoid reaching the maximum length of command line
10+
-# arguments, mainly present on MinGW.
11+
-define xxx_merged_lobj_rule
12+
-$(BUILD_DIR)/$(1)_merged.lo: $($(1)_LOBJS) | $(BUILD_DIR)
13+
- @$(LD) -r $($(1)_LOBJS) -o $(BUILD_DIR)/$(1)_merged.lo
14+
-endef
15+
-$(foreach dir, $(DIRS), $(eval $(call xxx_merged_lobj_rule,$(dir))))
16+
-MERGED_LOBJS:=$(foreach dir, $(DIRS),$(BUILD_DIR)/$(dir)_merged.lo)
17+
ifeq ($(WANT_LTO),1)
18+
SHARED_LIB_DEPS:=$(LOBJS)
19+
else
20+
-SHARED_LIB_DEPS:=$(MERGED_LOBJS)
21+
+SHARED_LINK_RSP := $(BUILD_DIR)/libflint-shared.rsp
22+
+SHARED_LIB_DEPS:=$(LOBJS)
23+
endif
24+
-$(FLINT_DIR)/$(FLINT_LIB_FULL): $(SHARED_LIB_DEPS)
25+
+$(FLINT_DIR)/$(FLINT_LIB_FULL): $(SHARED_LIB_DEPS) | $(BUILD_DIR)
26+
@echo "Building $(FLINT_LIB_FULL)"
27+
- $(CMD) $(CC) $(CFLAGS) -shared $(EXTRA_SHARED_FLAGS) $(SHARED_LIB_DEPS) -o $(FLINT_LIB_FULL) $(LDFLAGS) $(LIBS)
28+
+ @: $(file >$(SHARED_LINK_RSP))$(foreach obj,$(LOBJS),$(file >>$(SHARED_LINK_RSP),$(obj)))
29+
+ $(CMD) $(CC) $(CFLAGS) -shared $(EXTRA_SHARED_FLAGS) @$(SHARED_LINK_RSP) -o $(FLINT_LIB_FULL) $(LDFLAGS) $(LIBS)
30+
@$(RM_F) $(FLINT_LIB)
31+
@$(RM_F) $(FLINT_LIB_MAJOR)
32+
@$(LN_S) $(FLINT_LIB_FULL) $(FLINT_LIB)

bin/pyodide_build_dependencies.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ else
104104
cd flint
105105
fi
106106

107+
# Patch needed for FLINT == 3.4.0
108+
# This is https://github.com/flintlib/flint/pull/2594
109+
patch -N -Z -p1 < ../bin/patch-flint-emscripten-profiler.diff
110+
107111
./bootstrap.sh
108112

109113
emconfigure ./configure \

bin/rst_to_pxd.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@
5454
import_dict = {}
5555
# gr_domains.rst lists functions that are in gr.h
5656
doc_to_header = {'flint/gr_domains': 'flint/gr'}
57+
void_parameter_list = re.compile(r"\(\s*void\s*\)$")
58+
macro_declarations = {
59+
'flint/arf': {
60+
'ARF_PREC_EXACT': 'cdef const slong ARF_PREC_EXACT',
61+
},
62+
}
5763

5864

5965

@@ -115,6 +121,8 @@ def clean_types(function):
115121
ret = function.strip()
116122
for old, new in rename_types:
117123
ret = re.sub(old, new, ret)
124+
# Cython expects zero-argument functions to use () rather than (void).
125+
ret = re.sub(void_parameter_list, "()", ret)
118126
return ret
119127

120128

@@ -197,6 +205,12 @@ def generate_pxd_file(h_name, opts):
197205
with open(os.path.join(docdir, name + ".rst")) as f:
198206
l, macros = get_functions(f)
199207
unknown_types = gen_imports(l)
208+
macro_defs = []
209+
declared_macros = macro_declarations.get(h_name, {})
210+
for macro in macros:
211+
macro_name = macro.split("::", 1)[1].strip()
212+
if macro_name in declared_macros:
213+
macro_defs.append(declared_macros[macro_name])
200214
print()
201215
for t in unknown_types:
202216
print("# unknown type " + t)
@@ -205,6 +219,8 @@ def generate_pxd_file(h_name, opts):
205219
print("# " + m)
206220
print()
207221
print(r'cdef extern from "' + h_name + r'.h":')
222+
for declaration in macro_defs:
223+
print(" " + declaration)
208224
for f in l:
209225
if has_types(f, unknown_types):
210226
print(" # " + f)

doc/source/build.rst

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Python versions as described in `SPEC 0
7474
the minimum supported FLINT version is ``3.0`` and each release of python-flint
7575
supports all versions of ``FLINT >= 3.0`` available at the time of release.
7676

77-
Compatible versions (note that 0.7.0 is not yet released):
77+
Compatible versions:
7878

7979
.. list-table:: python-flint compatibility
8080
:header-rows: 1
@@ -84,11 +84,21 @@ Compatible versions (note that 0.7.0 is not yet released):
8484
- CPython
8585
- FLINT
8686
- Cython
87-
* - 0.7.0
87+
* - 0.9.0
8888
- Not yet
89-
- 3.10-3.13
90-
- 3.0-3.2?
91-
- 3.0-3.1?
89+
- 3.11-3.14
90+
- 3.0-3.4
91+
- 3.1-3.2?
92+
* - 0.8.0
93+
- 29th Aug 2025
94+
- 3.11-3.14
95+
- 3.0-3.3
96+
- 3.1 only
97+
* - 0.7.0
98+
- 16th Mar 2025
99+
- 3.11-3.13
100+
- 3.0-3.2
101+
- 3.0.11-3.1.0a1
92102
* - 0.6.0
93103
- 1st Feb 2024
94104
- 3.9-3.12
@@ -130,6 +140,7 @@ of ``python-flint`` existing at the time:
130140
- Flint 3.0 (Arb and Flint merged, lots of changes)
131141
- Flint 3.1 (Function signature for ``fmpz_mod_mat`` changed)
132142
- Flint 3.2 (``flint_randinit`` function name changed)
143+
- Flint 3.4 (generic series API moved to ``gr_series.h``)
133144
- Cython 3.0 (Handling of dunders changed)
134145
- Cython 3.1 (Removal of ``PyInt_*`` functions)
135146
- CPython 3.12 (Removal of distutils)
@@ -282,7 +293,7 @@ to be installed before building ``python-flint`` is ``FLINT``.
282293

283294
At the time of writing, few Linux distributions provide ``FLINT >= 3.0`` in
284295
their package repositories but for example on ``Ubuntu 24.04`` (but not any
285-
earlier Ubuntu versions) you can install ``FLINT 3.0.1`` with::
296+
earlier Ubuntu versions) you can install a sufficiently recent ``FLINT`` with::
286297

287298
sudo apt-get install libflint-dev
288299

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ project(
1616
# then we can consider not using a speculative upper version cap here.
1717
#
1818
flint_lower = '>=3.0'
19-
flint_upper = '<3.4'
19+
flint_upper = '<3.5'
2020
cython_lower = '>=3.0.11'
2121
cython_upper = '<3.3'
2222

0 commit comments

Comments
 (0)