-
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
Document procedure for building Cython extension on Windows. #320
Comments
Sorry. I can't get it to work |
Nevermind. I just got a linux VM and it works... Sorry for the trouble.... |
First, thanks a lot for this input which gave me the energy to give a try myself. I have been able to build a Cython extension with MS Visual studio linked to the GMP, MPFR, and MPC dlls included with the last gmpy2 binary and also numpy libraries. The cython extension code : The key parts
I think including the headers and .lib files as data files within gmpy2 windows distribution would ease a lot the process, that could be run with a standard python setup. The final content of gmpy2 install folder before running the build is
The windows test suite still have unrelated fails, however the keys tests that call this library passed. |
Thank you! You gave me a nudge in the right direction. I'll try to look at it this weekend. BTW, fractalshades looks cool. casevh |
Thanks for the feedback on fractalshades! This is a "home-entertainment" application of gmpy, in a way ;) |
Just a quick update : I pushed the Windows binary wheels for this project to pypi, and can confirm a "pip install" just works - gmpy2 is specified as an install dependency for the package. |
This issue is occurring again as of Python 3.12 ( I assume because there's no pre-built wheel for Windows for 3.12 ) , I have Visual Studio 22 installed but pip can't find the gmp.h file to build |
Can you try compiling gmpy2 from source? After cloning the source, run the
following command(s) using the "x64 Native Tools Command Prompt".
py -3.12 setup.py build_ext --force bdist_wheel
or
py -3.12 -m pip install build
py -3.12 -m build --wheel
Both commands should result in a binary wheel.
Please let me know if this doesn't work.
casevh
…On Mon, Oct 23, 2023 at 9:51 PM Kalanyr ***@***.***> wrote:
This issue is occurring again as of Python 3.12 ( I assume because there's
no pre-built wheel for Windows for 3.12 ) , I have Visual Studio 22
installed but pip can't find the gmp.h file to build
—
Reply to this email directly, view it on GitHub
<#320 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMR23ZQP5WUTOTQWRTMABDYA5CMVAVCNFSM5KPKKEX2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZXGY2TGNJTGM4A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
It is possible to build a Cython extension on Windows using the GMP, MPFR, and MPC DLLs included with the gmpy2 binary wheel.
Here is the rough outline:
https://github.com/brechtsanders/winlibs_mingw/releases/download/10.3.0-12.0.0-9.0.0-r2/winlibs-x86_64-posix-seh-gcc-10.3.0-llvm-12.0.0-mingw-w64-9.0.0-r2.zip
py39 setup_cython.py build_ext -cmingw32 -I..\mingw64\shared\include -L..\mingw64\shared\lib --inplace
The text was updated successfully, but these errors were encountered: