-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows build comments #478
Comments
To me it sounds as if the strategy can work although I am unsure and I think it is discouraged by other packaging people. What I am not sure about is how to make the linking work on linux/macos. I have seen a claim that it is impossible to make this work on macos without using a "capsule" like numpy does for its C API: Here are other longer threads that touched on this approach (with explicit mentions of gmpy2 and python-flint in both): I think that it is something that would be potentially worth bringing up as a packaging discussion in its own right because there is not a recommended way to make this work but other projects want this sort of thing as well. |
Regarding directory layout, I don't think it's a big deal. We could offer scipy-openblas64-like interface to get right directories and library names: >>> import scipy_openblas64
>>> scipy_openblas64.get_include_dir()
'/home/sk/src/gmpy/tmp-3.12/lib/python3.12/site-packages/scipy_openblas64/include'
>>> scipy_openblas64.get_lib_dir()
'/home/sk/src/gmpy/tmp-3.12/lib/python3.12/site-packages/scipy_openblas64/lib'
>>> scipy_openblas64.get_library()
'scipy_openblas64_' That will be enough to fill Extension() arguments. I'm not sure how we should declare dependency on the gmpy2libs's package (or 3, for GMP, MPFR and MPC?). This looks like an optional dependency, but rather for the build backend. I doubt such is supported. |
@skirpichev @oscarbenjamin
Some comments on separating GMP, MPFR, and MPC files from gmpy2. This is based on the current code and has only been tested on Windows.
Current state has the [gmp,mpfr,mpc] .h and .lib files installed in gmpy2/gmpy2 and the DLLs are installed in gmpy2.libs. I tried to create a new gmpy2*.pyd file using those installed libraries. It is much easier if the .h and .lib files are installed in gmpy2.libs.
I moved the .h and .lib files on an installed installation and I copied the src/* to a different location in the filesystem. The setup file below is sufficient to compile a new gmpy2*.pyd file. Since my immediate need is to quickly compile and test, I just replaced the previously installed gmpy2*.pyd file with the new one and it worked.
Here is the modified setup.py file. I cut it down to the bare minimum.
And the contents of gmpy2.libs are:
Would the following strategy work for bundling the GMP, MPFR, MPC libraries? Names can easily changed.
I don't understand Python packaging requirements to know if this would work or not.
The text was updated successfully, but these errors were encountered: