GeoscienceAustralia / PyRate

A Python tool for estimating velocity and time-series from Interferometric Synthetic Aperture Radar (InSAR) data.
https://geoscienceaustralia.github.io/PyRate/
Apache License 2.0
203 stars 71 forks source link

Build error with Numpy (Python 3.10) #390

Open meerfrau opened 11 months ago

meerfrau commented 11 months ago

Python 3.10 Cython 3.0.5 numpy 1.26.1

      numpy/core/src/multiarray/scalartypes.c.src: In function 'float_arrtype_hash':
      numpy/core/src/multiarray/scalartypes.c.src:2967:27: error: incompatible type for argument 1 of '_Py_HashDouble'
       2967 |     return _Py_HashDouble((double) PyArrayScalar_VAL(obj, @name@));
      In file included from /usr/include/python3.10/Python.h:77,
                       from numpy/core/src/multiarray/scalartypes.c.src:3:
      /usr/include/python3.10/pyhash.h:10:38: note: expected 'PyObject *' {aka 'struct _object *'} but argument is of type 'double'
         10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
            |                                      ^~~~~~~~~~
      numpy/core/src/multiarray/scalartypes.c.src:2967:12: error: too few arguments to function '_Py_HashDouble'
       2967 |     return _Py_HashDouble((double) PyArrayScalar_VAL(obj, @name@));
            |            ^~~~~~~~~~~~~~
      /usr/include/python3.10/pyhash.h:10:23: note: declared here
         10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
            |                       ^~~~~~~~~~~~~~
      numpy/core/src/multiarray/scalartypes.c.src: In function 'cfloat_arrtype_hash':
      numpy/core/src/multiarray/scalartypes.c.src:2975:31: error: incompatible type for argument 1 of '_Py_HashDouble'
       2975 |     hashreal = _Py_HashDouble((double)
            |                               ^~~~~~~~
            |                               |
            |                               double
       2976 |             PyArrayScalar_VAL(obj, C@name@).real);
            |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /usr/include/python3.10/pyhash.h:10:38: note: expected 'PyObject *' {aka 'struct _object *'} but argument is of type 'double'
         10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
            |                                      ^~~~~~~~~~
      numpy/core/src/multiarray/scalartypes.c.src:2975:16: error: too few arguments to function '_Py_HashDouble'
       2975 |     hashreal = _Py_HashDouble((double)
            |                ^~~~~~~~~~~~~~
      /usr/include/python3.10/pyhash.h:10:23: note: declared here
         10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
            |                       ^~~~~~~~~~~~~~
      numpy/core/src/multiarray/scalartypes.c.src:2981:31: error: incompatible type for argument 1 of '_Py_HashDouble'
       2981 |     hashimag = _Py_HashDouble((double)
            |                               ^~~~~~~~
            |                               |
            |                               double
       2982 |             PyArrayScalar_VAL(obj, C@name@).imag);
            |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /usr/include/python3.10/pyhash.h:10:38: note: expected 'PyObject *' {aka 'struct _object *'} but argument is of type 'double'
         10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
            |                                      ^~~~~~~~~~
      numpy/core/src/multiarray/scalartypes.c.src:2981:16: error: too few arguments to function '_Py_HashDouble'
       2981 |     hashimag = _Py_HashDouble((double)
            |                ^~~~~~~~~~~~~~
      /usr/include/python3.10/pyhash.h:10:23: note: declared here
         10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
            |                       ^~~~~~~~~~~~~~
      numpy/core/src/multiarray/scalartypes.c.src: In function 'longdouble_arrtype_hash':
      numpy/core/src/multiarray/scalartypes.c.src:2967:27: error: incompatible type for argument 1 of '_Py_HashDouble'
       2967 |     return _Py_HashDouble((double) PyArrayScalar_VAL(obj, @name@));
      /usr/include/python3.10/pyhash.h:10:38: note: expected 'PyObject *' {aka 'struct _object *'} but argument is of type 'double'
         10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
            |                                      ^~~~~~~~~~
      numpy/core/src/multiarray/scalartypes.c.src:2967:12: error: too few arguments to function '_Py_HashDouble'
       2967 |     return _Py_HashDouble((double) PyArrayScalar_VAL(obj, @name@));
            |            ^~~~~~~~~~~~~~
      /usr/include/python3.10/pyhash.h:10:23: note: declared here
         10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
            |                       ^~~~~~~~~~~~~~
      numpy/core/src/multiarray/scalartypes.c.src: In function 'clongdouble_arrtype_hash':
      numpy/core/src/multiarray/scalartypes.c.src:2975:31: error: incompatible type for argument 1 of '_Py_HashDouble'
       2975 |     hashreal = _Py_HashDouble((double)
            |                               ^~~~~~~~
            |                               |
            |                               double
       2976 |             PyArrayScalar_VAL(obj, C@name@).real);
            |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /usr/include/python3.10/pyhash.h:10:38: note: expected 'PyObject *' {aka 'struct _object *'} but argument is of type 'double'
         10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
            |                                      ^~~~~~~~~~
      numpy/core/src/multiarray/scalartypes.c.src:2975:16: error: too few arguments to function '_Py_HashDouble'
       2975 |     hashreal = _Py_HashDouble((double)
            |                ^~~~~~~~~~~~~~
      /usr/include/python3.10/pyhash.h:10:23: note: declared here
         10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
            |                       ^~~~~~~~~~~~~~
      numpy/core/src/multiarray/scalartypes.c.src:2981:31: error: incompatible type for argument 1 of '_Py_HashDouble'
       2981 |     hashimag = _Py_HashDouble((double)
            |                               ^~~~~~~~
            |                               |
            |                               double
       2982 |             PyArrayScalar_VAL(obj, C@name@).imag);
            |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /usr/include/python3.10/pyhash.h:10:38: note: expected 'PyObject *' {aka 'struct _object *'} but argument is of type 'double'
         10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
            |                                      ^~~~~~~~~~
      numpy/core/src/multiarray/scalartypes.c.src:2981:16: error: too few arguments to function '_Py_HashDouble'
       2981 |     hashimag = _Py_HashDouble((double)
            |                ^~~~~~~~~~~~~~
      /usr/include/python3.10/pyhash.h:10:23: note: declared here
         10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
            |                       ^~~~~~~~~~~~~~
      numpy/core/src/multiarray/scalartypes.c.src: In function 'half_arrtype_hash':
      numpy/core/src/multiarray/scalartypes.c.src:2997:27: error: incompatible type for argument 1 of '_Py_HashDouble'
       2997 |     return _Py_HashDouble(npy_half_to_double(PyArrayScalar_VAL(obj, Half)));
            |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            |                           |
            |                           double
      /usr/include/python3.10/pyhash.h:10:38: note: expected 'PyObject *' {aka 'struct _object *'} but argument is of type 'double'
         10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
            |                                      ^~~~~~~~~~
      numpy/core/src/multiarray/scalartypes.c.src:2997:12: error: too few arguments to function '_Py_HashDouble'
       2997 |     return _Py_HashDouble(npy_half_to_double(PyArrayScalar_VAL(obj, Half)));
            |            ^~~~~~~~~~~~~~
      /usr/include/python3.10/pyhash.h:10:23: note: declared here
         10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
            |                       ^~~~~~~~~~~~~~

This is the very same error as https://github.com/numpy/numpy/issues/19033

My local numpy is not used, instead PyRate does dist.fetch_build_eggs(dist.setup_requires)

_numpy-1.16.4-py3.7-linux-x8664.egg seems very old. How do I override this behaviour?