-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[WIP] Handle meson based python-wheel #6454
base: master
Are you sure you want to change the base?
Conversation
Note that this is not ready for testing yet... still early WIP, simply ported in a new PR my pending changes from my local branch. |
additional info:
|
Yup, on my radar, will add that indeed. Although I wonder if numpy 1.26.x might still work with older DSM considering the new meson I'm trying to build-up.
That should be the case from
The per depend fully-generated meson cross-file should now fix that. I had encountered that same issue with cmake long ago where the
Long story short, the meson had never received such enhancement as things we're working just fine. But that's no longer true with python wheels whereas with the python virtual environment things gets totally confused for meson. Thus the need to have a fully functional meson cross-file defining all library and include path properly. have a look at current This is now mostly working with meson, still have a few things to go through but getting there.
That's a current known issue with numpy. We need to force settin the long bit accordingly for
EDIT: with regards to cython (which I just hit) there must be an issue with the PATH although there may be a way to set them in the meson native file such as:
Anyhow, as usual thnx for your feedback, and work slowly progressing on this. EDIT2: It turns out that I have yet to empty the env now when invoking meson build, which is not the case yet. Although it does work for regular meson builds it wont for python-based meson wheel builds. next on my todo. |
@hgy59 having a proof of concept that does build sucessfully for both aarch64 and x64 using latest numpy 2.2.3. Although struggling with armv7 and evansport... I'll check if I can make 1.26.4 to work instead for the moment. |
@th0ma7, was looking at the errors which remain:
And found the following which may be useful if you've not already considered:
Hope they can assist... |
I believe I now have something functional, but unmaintainable as-is. The goodUsing normal
I can now sucesfully cross-compile for arm7, evansport and x64 for DSM-7.1 The badThere is a know bug in gcc<=10 with aarch64 that makes the compiler to segfault. I tried pretty much every possible alternatives of flags/disabling in the code but I wasn't able to workaround it. The uglyPart of my crusade at making meson-python build to work, I ended-up at one point to reproduce the normal meson+ninja build. Surprisingly, this ended-up allowing me to sucesfully build numpy for aarch64... Missing is then the (re)packaging in wheel format, which hapens to be the exact same process as "The good" as long as I re-use the exact same builddir (which I ended-up figuring out tonight). This really is ugly, but does work. This last commit a2068f5 was not tested on previously working x64, evansport and armv7. I'll let this rest for tonight. Good news is, we're probably much closer now... just need to tie-up the remaining loose-ends. |
@th0ma7 the wheels created from python/*/Makefile are not yet added to The |
Thnx for catching this up, will include this. I'm also looking at how to install numpy in the crossenv... I got an idea on how i could reuse the newly cross-compiled numpy wheel so it gets installed into the cross portion of the crossenv so it can then be made available for other wheels that depends on it. Lastly, also looking at adding flexibility to have different vendor managed meson (other than numpy use case where the source package provides its own modified meson.py) and skipping that meson+ninja part when no vendor managed meson is provided (i.e. being the default use case) All in all, taking shape but will require a few more spare cycles before reaching the finishing line... |
@th0ma7 another small issue popped up:
The original wheels in the index (pypi) are cross compiled (like |
@th0ma7 I have successfully built python311-wheels with added python/numpy and python/numpy_1.26 for aarch64-7.1 and armv7-7.1. It would be interresting to validate whether such wheels created with gcc 8.5 will run under DSM 6. I guess if the *.so files within the wheels do not reference GLBC > 2.20 functions, it might work. My background: I am trying to build a final homeassistant package with support for DSM 6. This will be homeassistant 2024.3.3 that depends on numpy 1.26.0. This version is available in the index for x86_64 and aarch64 only, and I will have to build it at least for armv7 and evansport (i686). To support armv7 in homeassistant 2025.1.4, it will be |
Maybe this is similar to msgpack where it can fit in both? |
That's a long shot! Not sure how i can help you though. I could reinstall my armv7 using a 6.2.4 image to try it out if that helps? |
I got some pretty cool code locally that allows installing cross-compiled numpy wheel into the crossenv to allow building scipy and others... But I faced one major major major problem, gcc version. For @hgy59 All in all, this would require bumping our minimal version to DSM-7.2. EDIT: I'll sleep on it... and probably upload my new code online to safeguard it just in case even though it will fail to build. |
Good news, I was able to create a workaround patch for aarch64 ... a few loose ends but looking much better now. |
@hgy59 and @mreid-tt It may look like stagnating but after spending numerous hours on this I finally made a major leap forward which now allows using default This has definitively been taking way longer than anticipated but I believe things will now start to shape nicely 🤞 |
- Use locally generated numpy.meson containing [properties] definitions, namely needs_exe_wrapper and longdouble_format - No more need to use the alternate directly called vendor meson - Ensure to package npymath and npyrandom by enabling 'devel' tag
- enable build for all archs except ppc - build with lapack (it was already built with lapack, -DNO_LAPACKE=1 does not work, add -DBUILD_WITHOUT_LAPACK=OFF to document the option - even it is default) - suppress some compiler warnings
- rename build-dir to builddir - it failed with older meson version only, but the official parameter is named 'builddir'
- add numpy_ha in preparation for home assistant 2025.1.4 depending on numpy==2.2.0
@hgy59 and @mreid-tt progress being made:
Afterwards, missing are:
Then things should be good for merging :) |
@th0ma7 another wheel that requires numpy is pandas (HA 2025.1.4 depends on pandas==2.2.3)
|
Some pending issues (maybe for another PR)
|
I tried this, and the crossenv is created as expected 🎉 - but it fails to build:
with further details in meson-log.txt:
I guess this is an known issue (numpy is lacking fortran libraries) and numpy wheels are not yet fully working. |
Description
Handle meson based python-wheel
Fixes:
Checklist
all-supported
completed successfullyType of change