mcfletch / pyopengl

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

Unable to build accelerate in Python 3.10 #74

Closed EpicWink closed 2 years ago

EpicWink commented 2 years ago

I'm trying to build pyopengl-accelerate from source with Python 3.10, but it fails

Reproduction

In the python:3.10-slim Docker image

apt-get update
apt-get install --no-install-recommends --yes gcc libc-dev
CFLAGS='-w' pip install pyopengl-accelerate

Output

...
  building 'OpenGL_accelerate.vbo' extension
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tmp/pip-install-3kj0w2ta/pyopengl-accelerate_e7c1731c504840c7946394c691718911/.. -I/tmp/pip-install-3kj0w2ta/pyopengl-accelerate_e7c1731c504840c7946394c691718911/src -I/tmp/pip-install-3kj0w2ta/pyopengl-accelerate_e7c1731c504840c7946394c691718911 -I/usr/local/include/python3.10 -c src/vbo.c -o build/temp.linux-x86_64-3.10/src/vbo.o
  src/vbo.c: In function ‘__pyx_tp_dealloc_17OpenGL_accelerate_3vbo_VBO’:
  src/vbo.c:11131:5: error: lvalue required as increment operand
  11131 |     ++Py_REFCNT(o);
        |     ^~
  src/vbo.c:11133:5: error: lvalue required as decrement operand
  11133 |     --Py_REFCNT(o);
        |     ^~
  src/vbo.c: In function ‘__pyx_tp_dealloc_17OpenGL_accelerate_3vbo_VBOOffset’:
  src/vbo.c:11619:5: error: lvalue required as increment operand
  11619 |     ++Py_REFCNT(o);
        |     ^~
  src/vbo.c:11621:5: error: lvalue required as decrement operand
  11621 |     --Py_REFCNT(o);
        |     ^~
  error: command '/usr/bin/gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for pyopengl-accelerate

Environment

In Docker image python:3.10-slim

EpicWink commented 2 years ago

Similar issues:

It seems all of these suggest regenerating the C code with a newer version of Cython (v0.29.20 or newer)

EpicWink commented 2 years ago

Fixed with cee65343744e9f369fcef3d51e19697a92b4d1c6 and b485ddedd01ca8a83f17187f9e7343409985a10f, released in v3.1.6

cv3d commented 2 years ago

Hi guys, seems only Windows got v3.1.6 on the pip repository, but what about Linux users? Thanks~

$ lsb_release -d
Description:    Ubuntu 22.04.1 LTS
$ python3 --version
Python 3.10.4
$ sudo pip3 install PyOpenGL-accelerate==3.1.6
ERROR: Could not find a version that satisfies the requirement PyOpenGL-accelerate===3.1.6 (from versions: 3.0.1b1, 3.0.1b2, 3.0.1, 3.0.2a1, 3.0.2b2, 3.0.2, 3.1.0a1, 3.1.0a3, 3.1.0b1, 3.1.0b2, 3.1.0b3, 3.1.0, 3.1.1a1, 3.1.3b1, 3.1.3rc1, 3.1.4, 3.1.5)
ERROR: No matching distribution found for PyOpenGL-accelerate==3.1.6

For now, seems installing from git is the only way for Linux users.

sudo pip3 install git+https://github.com/mcfletch/pyopengl.git@227f9c66976d9f5dadf62b9a97e6beaec84831ca#subdirectory=accelerate
EpicWink commented 2 years ago

Hi guys, seems only Windows got v3.1.6 on the pip repository, but what about Linux users? Thanks~

@cv3d See #78, and could be fixed by #84 or #85