pyopengl icon indicating copy to clipboard operation
pyopengl copied to clipboard

cannot build pyopengl-accelerate with clang 15

Open davidjmeyer opened this issue 2 years ago • 10 comments

Clang 15 has upgraded -Wint-conversion from a warning to a default error, and this means we cannot build pyopengl-accelerate

I get the following error:

 src/numpy_formathandler.c:9802:3: error: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int' [-Wint-conversion]

See release notes: https://releases.llvm.org/15.0.0/tools/clang/docs/ReleaseNotes.html

The -Wint-conversion warning diagnostic for implicit int <-> pointer conversions now defaults to an error in all C language modes. It may be downgraded to a warning with -Wno-error=int-conversion, or disabled entirely with -Wno-int-conversion.

davidjmeyer avatar Nov 17 '23 05:11 davidjmeyer

Seems pretty major. Can anyone merge the PR, or find a workaround?

0xorial avatar May 03 '24 13:05 0xorial

I was able to work around this by using the downgrade mentioned in the top comment via CFLAGS. Specifically, I ran

export CFLAGS="-Wno-error=int-conversion"

before running

python3 -m pip install -r requirements.txt

Since I was also running into #118, my requirements.txt contained the following:

PyOpenGL @ git+https://github.com/mcfletch/[email protected]#egg=PyOpenGL
PyOpenGL_accelerate @ git+https://github.com/mcfletch/[email protected]#egg=PyOpenGL_accelerate&subdirectory=accelerate

(copied from a comment on that issue).

I also tried to get -Wno-error=int-conversion to work through requirements.txt via --config-settings - i.e., without using CFLAGS, but I was unsuccessful.

adamsmatthew avatar Sep 17 '24 05:09 adamsmatthew