haasn / libplacebo

Official mirror of libplacebo
http://libplacebo.org/
GNU Lesser General Public License v2.1
547 stars 69 forks source link

Build failing with OpenGL #246

Closed brad0 closed 6 months ago

brad0 commented 7 months ago

This is on OpenBSD.

I think src/opengl/meson.build should be able to detect the gl.pc pkg-config file and find the header path it should be pulling in which is /usr/X11R6/include.

FAILED: src/libplacebo.so.8.0.p/opengl_context.c.o
cc -Isrc/libplacebo.so.8.0.p -Isrc -I../libplacebo-6.338.2/src -Isrc/include -I../libplacebo-6.338.2/src/include -Isrc/opengl/include -I../libplacebo-6.338.2/src/opengl/include -Isrc/shaders -Isrc/vulkan -Isrc/opengl/include/glad -I/usr/local/include -fvisibility=hidden -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c11 -Wundef -Wshadow -Wparentheses -Wpointer-arith -fno-math-errno -D_ISOC99_SOURCE -D_ISOC11_SOURCE -D_GNU_SOURCE -U__STRICT_ANSI__ -Wmissing-prototypes -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers -Wno-type-limits -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Wno-missing-braces -Wundef -Wshadow -Wparentheses -Wpointer-arith -fno-math-errno -O2 -pipe -fPIC -pthread -DPL_HAVE_PTHREAD -DPTHREAD_HAS_SETCLOCK -DPL_EXPORT -MD -MQ src/libplacebo.so.8.0.p/opengl_context.c.o -MF src/libplacebo.so.8.0.p/opengl_context.c.o.d -o src/libplacebo.so.8.0.p/opengl_context.c.o -c ../libplacebo-6.338.2/src/opengl/context.c
In file included from ../libplacebo-6.338.2/src/opengl/context.c:20:
In file included from ../libplacebo-6.338.2/src/opengl/common.h:33:
src/opengl/include/glad/egl.h:700:10: fatal error: 'KHR/khrplatform.h' file not found
#include <KHR/khrplatform.h>
         ^~~~~~~~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
bl4ckb0ne commented 6 months ago

Can confirm the issue on alpinelinux. It's coming from glad, 2.0.4 works file (the one in the submodule) but 2.0.5 (the one from the alpine packages) fails.

I haven't seen the issue reported on glad, not sure if it should be fixed here or there.

brad0 commented 6 months ago

Ping.

haasn commented 6 months ago

I can't reproduce this even with v2.0.5. You mention gl.pc, but on my system this is listed as "Legacy OpenGL and GLX library and headers", and also pulls in -lGL (which we definitely don't want/need).

Not sure how to proceed from here. Maybe try a glad issue? Edit: https://github.com/Dav1dde/glad/issues/459

brad0 commented 6 months ago

Anyway, we'll see what upstream says.

deus0ww commented 6 months ago

This is failing on macOS (10.14.6 and 14.3.1.), too.

brad0 commented 6 months ago

Updating to glad 2.0.6 and this appears to be resolved. Thanks.

brad0 commented 6 months ago

@bl4ckb0ne @deus0ww

bl4ckb0ne commented 6 months ago

Worked as well on alpine