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

Numpy will need updating #23

Closed
smontanaro opened this issue Oct 22, 2021 · 4 comments
Closed

Numpy will need updating #23

smontanaro opened this issue Oct 22, 2021 · 4 comments

Comments

@smontanaro
Copy link

Numpy references the ob_refcnt field. Will need some tweaks to compile. script(1) session attached. Relevant error message:

  gcc: numpy/core/src/multiarray/multiarraymodule.c
  In file included from numpy/core/include/numpy/arrayobject.h:4,
                   from numpy/core/src/multiarray/shape.c:7:
  numpy/core/src/multiarray/shape.c: In function ‘PyArray_Resize’:
  numpy/core/include/numpy/ndarrayobject.h:102:51: error: ‘PyObject’ {aka ‘struct _object’} has no member named ‘ob_refcnt’
    102 | #define PyArray_REFCOUNT(obj) (((PyObject *)(obj))->ob_refcnt)
        |                                                   ^~
  numpy/core/src/multiarray/shape.c:107:22: note: in expansion of macro ‘PyArray_REFCOUNT’
    107 |             refcnt = PyArray_REFCOUNT(self);
        |                      ^~~~~~~~~~~~~~~~

typescript.txt

@smontanaro
Copy link
Author

I'll take this one for the moment and see if I can easily fix the problem. I'm guessing Sam will probably have to assign it to me, as I can't seem to "take" it.

@colesbury
Copy link
Owner

Hi Skip -- I have patches for NumPy in https://github.com/colesbury/numpy/tree/v1.19.3-nogil

The "nogil" branch pulls the patched NumPy wheel (it contains a modified "pip" that pulls from https://d1yxz45j0ypngg.cloudfront.net/). The "nogil-3.9" branch is still a work-in-progress of the rebase and doesn't contain the modified pip.

@smontanaro
Copy link
Author

Okay... A few quick points.

  1. Is there a canonical way to detect a no-gil build at runtime? (I used #ifdef _Py_TRY_INCREF)
  2. Seems to be a missing cast of the PyMem_RawCalloc() return value in Include/lock.h:_PyEventRc_New.
  3. Should I be messing around with the nogil or nogil-3.9 branch?

@colesbury
Copy link
Owner

  1. #ifdef Py_NOGIL
  2. Thanks, for catching this!
  3. Stick with the "nogil" branch. That's what I'm using for compatibility testing.

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

2 participants