On Tue, 6 Apr 2021 at 11:06, 'Bill Hart' via flint-devel
<
flint...@googlegroups.com> wrote:
>
> I believe Python will want shared libraries.
>
> I don't know much about Python extension libraries, so can't answer
> your other questions. However, I think it probably boils down to the
> behaviour of the linker. Unfortunately I am not sure if Python manages
> this themselves or relies on the standard behaviour of the system
> linker.
Python wants the main importable module to be a shared library. In
this case that means that I need to produce a _flint module that can
be loaded as a shared library. The question is more about the way that
module accesses its dependencies i.e. GMP, FMPR, Flint and Arb. I
think those could be statically linked into the main .so file. In any
case I have this working without static linking right now so this is
not a priority.
I have this partially sorted now in the sense that I can make sure
that wheels get built for OSX and Linux for PYthon 3.7 and 3.8. The
built wheels are in the artifact zip here:
https://github.com/oscarbenjamin/python-flint/actions/runs/727631490
I've sent that as a PR to python-flint:
https://github.com/fredrik-johansson/python-flint/pull/16
There are some issues to iron out such as newer Cython versions and
also making wheels for newer Python versions (these are related). The
big elephant in the room though is Windows. I don't have easy access
to a Windows machine and I see a bunch of problems with Windows:
1) I think that recent Python versions are compiled with MSVC in such
a way that extension modules also need to be compiled with MSVC in
order to link reliably (I'm not sure how contagious this effect is,
like do I need to use MSVC for *everything*?).
2) It doesn't look like GMP can be compiled with MSVC without patches.
3) It doesn't seem straight-forward to compile MPIR with MSVC either.
If anyone has any advice/experience with getting this sort of thing
set up on Windows then that would be great. I have looked at related
projects like gmpy but I don't see anything that fully automates
compiling these kinds of libraries in CI (for Windows). If anyone
wants to help with this then that would be fantastic.
Oscar