Skip to content
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

Install Python package from source fails on Ubuntu 20.04 #48

Open
rbrtmch opened this issue Feb 9, 2022 · 4 comments
Open

Install Python package from source fails on Ubuntu 20.04 #48

rbrtmch opened this issue Feb 9, 2022 · 4 comments

Comments

@rbrtmch
Copy link

rbrtmch commented Feb 9, 2022

I get an error building from source on Ubuntu 20.04. Fortran build works without issue, only the python package build fails. I tried the build with --no-build-isolation and got the same error. Attached is a screen dump of the build. The following versions were used.
Python 3.8.10
numpy 1.22.2
wheel 0.37.1
setuptools 60.8.1
scikit-build 0.13.1
cmake 3.22.2
ninja 1.10.2.3

build_screen_dump.txt

@benbovy
Copy link
Member

benbovy commented Mar 2, 2022

Thanks for the report @rbrtmch, and sorry for the wait. I could reproduce this. The recursion error is likely due to a bug or incompatibility with the last version(s) of numpy (f2py). I need to investigate this more, but in the meantime it should work with numpy 1.20.x (maybe 1.21.x).

@tth030
Copy link

tth030 commented Apr 5, 2022

Hi Robert @rbrtmch , Benoit @benbovy ,
Did you by chance fix this issue? I have a similar issue (on mac M1 2021) and would be happy to follow up on the solution.

@benbovy
Copy link
Member

benbovy commented Jun 30, 2022

I've tracked down the issue, which happens between numpy version 1.22.0 and 1.22.1.

It looks like F2PY generates incorrect signature file for a reason that I currently ignore. With 1.22.1 or later there are problematic entries where nx and ny are swaped, e.g.,

integer, optional,check(shape(stack, 0) == nx * ny),depend(ny,stack) :: nx=shape(stack, 0) / ny
integer, optional,check(shape(stack, 0) == nx * ny),depend(nx,stack) :: ny=shape(stack, 0) / nx

Whereas it should be

integer, optional,check(shape(stack, 0) == nx * ny),depend(ny,stack) :: nx=shape(stack, 0) / nx
integer, optional,check(shape(stack, 0) == nx * ny),depend(nx,stack) :: ny=shape(stack, 0) / ny

Maybe related to numpy/numpy#20721 as it is the only change in the related f2py source between the two versions.

Note that the conda-forge python packages (fastscapelib-f2py) are built with a numpy version <1.22.1 and they are working with the last numpy versions. If you use the stable version I'd recommend it over building from source.

@benbovy
Copy link
Member

benbovy commented Jun 30, 2022

ref numpy/numpy#21893

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

No branches or pull requests

3 participants