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

[BUG] invalid conversion from ‘void*’ to ‘_PyCodeArray*’ found in internal headers when compiling scipy with Python 3.14t #6526

Open
clin1234 opened this issue Nov 29, 2024 · 0 comments

Comments

@clin1234
Copy link

Describe the bug

From scipy/scipy#21970, got the following error when compiling scipy from source:

[65/1464] Compiling C++ object scipy/special/_specfun.cpython-314t-x86_64-linux-gnu.so.p/meson-generated__specfun.cpp.o
      FAILED: scipy/special/_specfun.cpython-314t-x86_64-linux-gnu.so.p/meson-generated__specfun.cpp.o
      c++ -Iscipy/special/_specfun.cpython-314t-x86_64-linux-gnu.so.p -Iscipy/special -I../scipy/special -I../../../workspaces/venv/lib/python3.14t/site-packages/numpy/_core/include -I/usr/include/python3.14t -fvisibility=hidden -fvisibility-inlines-hidden -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++17 -O3 -fPIC -DNPY_NO_DEPRECATED_API=NPY_1_9_API_VERSION -MD -MQ scipy/special/_specfun.cpython-314t-x86_64-linux-gnu.so.p/meson-generated__specfun.cpp.o -MF scipy/special/_specfun.cpython-314t-x86_64-linux-gnu.so.p/meson-generated__specfun.cpp.o.d -o scipy/special/_specfun.cpython-314t-x86_64-linux-gnu.so.p/meson-generated__specfun.cpp.o -c scipy/special/_specfun.cpython-314t-x86_64-linux-gnu.so.p/_specfun.cpp
      In file included from /usr/include/python3.14t/internal/pycore_frame.h:13,
                       from scipy/special/_specfun.cpython-314t-x86_64-linux-gnu.so.p/_specfun.cpp:12385:
      /usr/include/python3.14t/internal/pycore_code.h: In function ‘_Py_CODEUNIT* _PyCode_GetTLBCFast(PyThreadState*, PyCodeObject*)’:
      /usr/include/python3.14t/internal/pycore_code.h:617:53: error: invalid conversion from ‘void*’ to ‘_PyCodeArray*’ [-fpermissive]
        617 |     _PyCodeArray *code = _Py_atomic_load_ptr_acquire(&co->co_tlbc);
            |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
            |                                                     |
            |                                                     void*
      In file included from scipy/special/_specfun.cpython-314t-x86_64-linux-gnu.so.p/_specfun.cpp:12385:
      /usr/include/python3.14t/internal/pycore_frame.h: In function ‘_Py_CODEUNIT* _PyFrame_GetBytecode(_PyInterpreterFrame*)’:
      /usr/include/python3.14t/internal/pycore_frame.h:96:53: error: invalid conversion from ‘void*’ to ‘_PyCodeArray*’ [-fpermissive]
         96 |     _PyCodeArray *tlbc = _Py_atomic_load_ptr_acquire(&co->co_tlbc);
            |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
            |                                                     |
            |                                                     void*
      [66/1464] Compiling C++ object scipy/special/_gufuncs.cpython-314t-x86_64-linux-gnu.so.p/_gufuncs.cpp.o
      [67/1464] Compiling C++ object scipy/special/_special_ufuncs.cpython-314t-x86_64-linux-gnu.so.p/_special_ufuncs.cpp.o
      ninja: build stopped: subcommand failed.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Code to reproduce the behaviour:

Encountered when https://github.com/scipy/scipy/blob/main/scipy/special/_specfun.pyx is converted to C++ code, then compiled.

Expected behaviour

Successful compilation

OS

Linux

Python version

3.14 Free-threading

Cython version

3.1.0a1

Additional context

Command line: venv/bin/pip install -U --pre --no-build-isolation git+https://github.com/scipy/scipy

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

1 participant