-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
numpy incompatibility when using system python and numpy 1.22 is installed in the system #33473
Comments
comment:1
It seems scipy may also be affected by this:
Indeed
we see that scipy also uses some incorrect headers (the warning is unrelated). |
comment:2
For sagelib, the includes are determined by
I think modifying this function so that the numpy include location comes before the system python include location should fix the issue. As for scipy, it seems the issue happens in module
|
comment:3
What does |
comment:4
Replying to @tornaria:
Yes, this sounds like a good fix |
comment:5
Here's an attempt to a solution. I based it on 9.5 and I wonder if this justifies an eventual 9.5.1. New commits:
|
Commit: |
Branch: u/tornaria/33473-numpy-includes |
Author: Gonzalo Tornaría |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:10
I've updated the description - Sage uses numpy 1.21, not 1.19 |
Reviewer: Matthias Koeppe |
Replying to @tornaria:
Arguably, this is a distribution bug. But we definitely have to work around it, given that it is widespread in Debian. Right now it is not acute because no released version of Debian/Ubuntu ships numpy 1.22.x. But it will become a bigger problem when we upgrade to numpy 1.22 and then we face the issue on all versions of Debian/Ubuntu. |
comment:13
Replying to @tornaria:
I don't think anyone is in the mood for making bugfix releases. But it looks like we might be ready for 9.6 |
comment:15
Thanks. I've reported this as a possible bug in the We could try to get the scipy patch upstreamed. BTW, I think eventually |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:16
I reverted the description by accident. Indeed sage 9.5 uses numpy 1.21 and the binary incompatibility arises in the upgrade to 1.22. |
comment:17
Replying to @tornaria:
+1 |
comment:18
Replying to @tornaria:
Is it even needed or does |
comment:19
Replying to @mkoeppe:
No idea. If so, then why is Can we just
? |
comment:20
worth a try |
Changed branch from u/tornaria/33473-numpy-includes to |
Changed commit from |
comment:22
For the record:
|
comment:23
This now fails on the github action:
|
comment:24
Already fixed in #33532 |
comment:26
Replying to @tornaria:
Let's do this in #33137 |
This retroactively affects sage-9.5, meaning sage-9.5 used to build ok in my system but now that system numpy has been upgraded to 1.22 it breaks. This is using the standard tarball, unpatched, as long as system python is used and numpy 1.22 happens to be installed in the system when sage is build.
NOTE: this is NOT trying to use system numpy. Sage builds and installs its own numpy (1.21) but headers for the system numpy (1.22) get incorrectly mixed up when building sagelib.
The symptom is that any sage module that uses
cimport numpy
will fail to load, making sage almost unusable, e.g.:Background:
/usr/include/python3.10
/home/tornaria/src/sage/sage-9.5/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/numpy/core/include
/usr/lib/python3.10/site-packages/numpy/core/include
but there's also a symlink/usr/include/python3.10/numpy -> ../../lib/python3.10/site-packages/numpy/core/include/numpy
.NOTE: the symlink
/usr/include/python3.10/numpy
is not shipped by numpy itself, but it seems some distros add it. I'm using void linux, which has it, but at least debian also has it (see https://packages.debian.org/bullseye/amd64/python3-numpy/filelist)The solution should be changing the order of the include locations so that the numpy location comes before the python location.
CC: @vbraun
Component: build
Author: Gonzalo Tornaría
Branch:
f50e4cb
Reviewer: Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/33473
The text was updated successfully, but these errors were encountered: