Skip to content

numpy build fails for lack of numpy.math #3150

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

Open
clayote opened this issue May 10, 2025 · 7 comments
Open

numpy build fails for lack of numpy.math #3150

clayote opened this issue May 10, 2025 · 7 comments
Labels

Comments

@clayote
Copy link
Contributor

clayote commented May 10, 2025

buildozer debug seemed to work fine yesterday, but then I added armeabi-v7a to its archs and now this is happening:

cython -M --fast-fail -3 /home/sanotehu/src/lisien/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/numpy/armeabi-v7a__ndk_target_24/numpy/numpy/random/_common.pyx -o numpy/random/_common.cpython-311-x86_64-linux-gnu.so.p/numpy/random/_common.pyx.c
Ignoring "sys._home = value" override

Error compiling Cython file:
------------------------------------------------------------
...
from collections import namedtuple
from cpython cimport PyFloat_AsDouble
import sys
import numpy as np
cimport numpy as np
cimport numpy.math as npmath
        ^
------------------------------------------------------------

/home/sanotehu/src/lisien/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/numpy/armeabi-v7a__ndk_target_24/numpy/numpy/random/_common.pyx:8:8: 'numpy/math.pxd' not found

Full log, as well as my buildozer.spec, are at this gist.

@clayote clayote added the recipe label May 10, 2025
@T-Dynamos
Copy link
Contributor

Do try building on this branch #3136

@clayote clayote changed the title numpy build does not create math.pxd numpy build does not create math.pxd when compiling for armeabi-v7a May 10, 2025
@clayote clayote changed the title numpy build does not create math.pxd when compiling for armeabi-v7a numpy build does not create math.pxd May 10, 2025
@clayote
Copy link
Contributor Author

clayote commented May 10, 2025

Do try building on this branch #3136

I have now tried this, and it doesn't seem to make much difference. Similar log files and buildozer.spec here.

@clayote clayote changed the title numpy build does not create math.pxd numpy build fails for lack of numpy.math May 10, 2025
@clayote
Copy link
Contributor Author

clayote commented May 10, 2025

I gather math.pxd is not part of numpy, exactly, but of Cython. Here's the file on the Cython source tree.

@clayote
Copy link
Contributor Author

clayote commented May 10, 2025

I tried modifying the numpy recipe slightly, to point it at a release tarball of numpy, rather than its git repository; this somehow caused an error even finding meson. I think maybe this points to some deeper issue with MesonRecipe?

@mre2m2
Copy link

mre2m2 commented May 10, 2025

I'm encountering the same error: 'numpy/math.pxd' not found.
The build had been working consistently before, and the last successful build was just 3 days ago, without any code changes since.

It seems that P4A creates an isolated environment and ignores specified version of Cython (==0.29.33) and there is a compatibility issue between newer Cython versions and older Numpy versions.

attached is my full log, thanks a lot for your help

0_build.txt

@T-Dynamos
Copy link
Contributor

Maybe try pining cython version as:

hostpython_prerequisites = ["Cython==3.0.6"]  # meson does not detects venv's cython

(in numpy recipe)

@clayote
Copy link
Contributor Author

clayote commented May 10, 2025

That seemed to work, thanks @T-Dynamos!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants