Skip to content

Install Cython .pxd files for third-party acb_t cimport - #428

Open
djoubertthot wants to merge 1 commit into
flintlib:mainfrom
djoubertthot:install-cython-pxd
Open

Install Cython .pxd files for third-party acb_t cimport#428
djoubertthot wants to merge 1 commit into
flintlib:mainfrom
djoubertthot:install-cython-pxd

Conversation

@djoubertthot

Copy link
Copy Markdown

Why

The published wheels ship .py / .pyi / extension modules but not the Cython .pxd files. A third-party Cython extension therefore cannot

from flint.types.acb cimport acb
from flint.flintlib.functions.acb cimport acb_exp
acb_exp(out.val, z.val, getprec())

acb.val is the underlying acb_t. That is the supported way to call libflint in a tight loop without going through Python method dispatch.

This showed up when building a Booker Lambda_theta trapezoid against python-flint 0.9.0 on Windows: the wheel has libflint, the site-package has no acb.pxd.

What

  • Install pyflint.pxd, flint_base/*.pxd, types/*.pxd, utils/*.pxd.
  • Install flintlib (hand-written types + generated function declarations) so cimport flint.flintlib.functions.acb works after pip install.
  • Test that those files exist next to flint.__file__.
  • Document that compiling still needs the FLINT C headers (the Windows PyPI wheel does not ship flint/acb.h).

Compiling an extension that uses these pxd files still requires a FLINT development install (headers + import library), matching the python-flint FLINT version.

The wheels currently ship only .py/.pyi/.pyd, so another Cython extension
cannot cimport flint.types.acb and call libflint on acb.val. Install the
declaration files next to the extensions, including flintlib.

Compiling still needs the FLINT C headers; the Windows PyPI wheel ships
libflint without them.
@oscarbenjamin

Copy link
Copy Markdown
Collaborator

See prior discussion in gh-420

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.

3 participants