mcfletch / pyopengl

Repository for the PyOpenGL Project
Other
314 stars 97 forks source link

Update accelerate generate C with Cython v3 #87

Open EpicWink opened 1 year ago

EpicWink commented 1 year ago

An error occurs during the building of accelerate on Python 3.11 with Cython 0.29. Works fine with Cython 3.0a11. Re-generating source should work for Python 3.6+

Failing

docker run --rm -it python:3.11-rc bash
pip install git+https://github.com/mcfletch/pyopengl.git@227f9c6#subdirectory=accelerate

Output

building 'OpenGL_accelerate.wrapper' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/src
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-req-build-gz8ht9om/accelerate/.. -I/tmp/pip-req-build-gz8ht9om/accelerate/src -I/tmp/pip-req-build-gz8ht9om/accelerate -I/usr/local/include/python3.11 -c src/wrapper.c -o build/temp.linux-x86_64-cpython-311/src/wrapper.o
      src/wrapper.c: In function ‘__Pyx_AddTraceback’:
      src/wrapper.c:438:62: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
        438 |   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
            |                                                              ^~
      src/wrapper.c:28232:5: note: in expansion of macro ‘__Pyx_PyFrame_SetLineNumber’
      28232 |     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
            |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1

Environment

Succeeding

docker run --rm -it python:3.11-rc bash
pip install 'cython >= 3.0a11'
pip install pyopengl-accelerate
mcfletch commented 1 year ago

Wrappers generated with Cython v3 are checked in on develop, should be in next release.

EpicWink commented 2 months ago

Works in release-3.1.8 tag for Python 3.11, 3.12, and 3.13b:

docker run --rm -it python:3.13-rc bash
pip install git+https://github.com/mcfletch/pyopengl.git@release-3.1.8#subdirectory=accelerate

Note that for Python 3.13b, this builds NumPy from sdist