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

GPy will not install against Numpy 2.0 #1076

Closed
edbennett opened this issue Jun 17, 2024 · 1 comment · Fixed by #1081
Closed

GPy will not install against Numpy 2.0 #1076

edbennett opened this issue Jun 17, 2024 · 1 comment · Fixed by #1081
Assignees

Comments

@edbennett
Copy link

Trying to build against Numpy 2.0 (released yesterday) gives the error:

0.606 aarch64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -Werror=implicit-function-declaration -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -mbranch-protection=standard -fPIC -I/venv/lib/python3.11/site-packages/numpy/_core/include -I. -I/venv/include -I/usr/include/python3.11 -c GPy/kern/src/stationary_cython.c -o build/temp.linux-aarch64-cpython-311/GPy/kern/src/stationary_cython.o -fopenmp -O3
0.668 In file included from /venv/lib/python3.11/site-packages/numpy/_core/include/numpy/ndarraytypes.h:1909,
0.668                  from /venv/lib/python3.11/site-packages/numpy/_core/include/numpy/ndarrayobject.h:12,
0.668                  from /venv/lib/python3.11/site-packages/numpy/_core/include/numpy/arrayobject.h:5,
0.668                  from GPy/kern/src/stationary_cython.c:750:
0.668 /venv/lib/python3.11/site-packages/numpy/_core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
0.668    17 | #warning "Using deprecated NumPy API, disable it with " \
0.668       |  ^~~~~~~
0.679 In file included from /usr/include/python3.11/Python.h:38,
0.679                  from GPy/kern/src/stationary_cython.c:6:
0.679 GPy/kern/src/stationary_cython.c: In function ‘__pyx_f_5numpy_PyDataType_SHAPE’:
0.682 GPy/kern/src/stationary_cython.c:4159:39: error: ‘PyArray_Descr’ {aka ‘struct _PyArray_Descr’} has no member named ‘subarray’
0.682  4159 |     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
0.682       |                                       ^~
0.682 /usr/include/python3.11/pyport.h:24:38: note: in definition of macro ‘_Py_CAST’
0.682    24 | #define _Py_CAST(type, expr) ((type)(expr))
0.682       |                                      ^~~~
0.682 /usr/include/python3.11/object.h:506:35: note: in expansion of macro ‘_PyObject_CAST’
0.682   506 | #  define Py_INCREF(op) Py_INCREF(_PyObject_CAST(op))
0.682       |                                   ^~~~~~~~~~~~~~
0.682 GPy/kern/src/stationary_cython.c:1536:27: note: in expansion of macro ‘Py_INCREF’
0.682  1536 |   #define __Pyx_INCREF(r) Py_INCREF(r)
0.682       |                           ^~~~~~~~~
0.682 GPy/kern/src/stationary_cython.c:4159:5: note: in expansion of macro ‘__Pyx_INCREF’
0.682  4159 |     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
0.682       |     ^~~~~~~~~~~~
0.682 GPy/kern/src/stationary_cython.c:4160:36: error: ‘PyArray_Descr’ {aka ‘struct _PyArray_Descr’} has no member named ‘subarray’
0.682  4160 |     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
0.682       |                                    ^~
1.052 error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1

I'm surprised that the "deprecated" API seems to have changed but not entirely disappeared. I imagine that for the time being, a quick fix would be to require numpy < 2.0.

@MartinBubel
Copy link
Contributor

Hi @edbennett
thanks for reporting this one.

Sure, limiting numpy to < 2 would be an easy fix. Feel free to make a PR if you can find the time. I can also do it but it may take a while.

Best, Martin

@MartinBubel MartinBubel self-assigned this Jul 20, 2024
@MartinBubel MartinBubel linked a pull request Jul 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants