Skip to content

Fix import error on aarch64: define 'long' using ctypes.c_long #146

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vsevolod-misiul
Copy link

@vsevolod-misiul vsevolod-misiul commented May 19, 2025

Summary

On Linux ARM64 (aarch64) platforms, installing PyOpenGL_accelerate fails with the following error:

Error compiling Cython file:
...
    self.buffer = long( buffers )
                          ^
src/vbo.pyx:191:26: undeclared name not builtin: long

This happens because the built-in long type is not defined in Python 3 on ARM64 platforms, unlike some legacy Python 2 or x86-based assumptions. This breaks Cython compilation when trying to cast buffer identifiers.

This patch imports long from ctypes.c_long, which resolves the issue on these platforms.

Changes

  • Added from ctypes import c_long as long to handle missing long type on aarch64.

Platform tested

  • Linux on ARM64 (Ubuntu 22.04, aarch64)

cedrik-fuoco-adsk added a commit to AcademySoftwareFoundation/OpenRV that referenced this pull request May 23, 2025
### Fix issue with PyOpenGL-accelerate on MacOS x86_64

### Linked issues
n/a

### Summarize your change.

This PR adds a temporary changes to build PyOpenGL-accelerate from
source on MacOS x86_64. The source is patched with the changes from a
pending [PR](mcfletch/pyopengl#146) in the
PyOpenGL repository.

### Describe the reason for the change.

Cython was updated to version 3.1.0+ on May 8, causing compatibility
issues with PyOpenGL-accelerate on macOS x86_64. Until a pending
[PR](mcfletch/pyopengl#146) is merged in the
official PyOpenGL repository, PyOpenGL-accelerate will be built from
source on macOS x86_64.

### Describe what you have tested and on which operating system.

### Add a list of changes, and note any that might need special
attention during the review.

### If possible, provide screenshots.

Signed-off-by: Cédrik Fuoco <[email protected]>
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

Successfully merging this pull request may close these issues.

1 participant