Skip to content

Conversation

@oscarbenjamin
Copy link
Collaborator

Cython 3.1 makes it possible to build with the limited API. This adds the necessary build configuration so that python-flint can be built with the limited API which in principle makes it possible to have abi3 wheels that can work with a range of CPython versions.

Although this builds the tests crash pretty quickly in a segfault so more work would be needed to make these builds useful. For now we just enable this as an experimental build mode. When it is working it would be worth running some timings to see if it is slower than a normal build.

Cython 3.1 makes it possible to build with the limited API. This adds
the necessary build configuration so that python-flint can be built with
the limited API which in principle makes it possible to have abi3 wheels
that can work with a range of CPython versions.

Although this builds the tests crash pretty quickly in a segfault so
more work would be needed to make these builds useful. For now we just
enable this as an experimental build mode. When it is working it would
be worth running some timings to see if it is slower than a normal
build.
@oscarbenjamin
Copy link
Collaborator Author

The limited API build does not work right now:

$ rm -r build build-install/
$ meson setup build -Dpython.allow_limited_api=true
$ spin test
...
build-install/usr/local/lib/python3.13/site-packages/flint/test/test_all.py Fatal Python error: Segmentation fault
$ spin run python -m flint.test
...
Running tests...
test_pyflint...
(segfault)

The segfault is pretty immediate:

In [1]: import flint

In [2]: flint.fmpz() == flint.fmpz(0)
Segmentation fault (core dumped)

I'm not sure if that is something that can be fixed in python-flint or just a bug in Cython though.

For now we can merge the build option for further testing though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant