I am compiling KiCad from source and it seems to compile correctly, but then KiCad cannot find OpenGL during runtime so the 3D Viewer and hardware rendering do not work.
I assume the problem is with my environment or operating system and not with KiCad itself, but KiCad version 7 works correctly and not version 8 (I have tried 8.0.1-8.0.4).
Did something change with the way that KiCad locates OpenGL during runtime between version 7 and 8?
I read in another post that the KiCad help version information lists OpenGL since version 8.0.3, but I do not see OpenGL anywhere in the version information. I assume that means it cannot find it at all. cmake finds OpenGL in order to compile the source so I am just wondering if anyone has any ideas about how I can get the runtime executable to find OpenGL too. Thanks!
Application: KiCad 3D Viewer x86_64 on x86_64
Version: 8.0.4, release build
Libraries:
wxWidgets 3.2.5
FreeType 2.13.0
HarfBuzz 8.3.0
FontConfig 2.14.0
libcurl/8.5.0 GnuTLS/3.8.3 zlib/1.2.13 libidn2/2.3.4 nghttp2/1.58.0
Platform: Debian GNU/Linux 12 (bookworm), 64 bit, Little endian, wxGTK, X11, xfce, x11
Build Info:
Date: Jan 1 1970 00:00:01
wxWidgets: 3.2.5 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.80.0
OCC: 7.6.2
Curl: 8.5.0
ngspice: 43
Compiler: GCC 11.3.0 with C++ ABI 1016
Build settings:
KICAD_USE_EGL=ON
So, assuming you are using the system’s package and not your own, you should not have wx compiled with egl.
If you are using your own compiled wx, then you might need to search for the right incantation.
In general, EGL is really only used for Wayland systems. Wayland is insanely broken by design for many userspace applications including KiCad. If you’d like to test it and submit patches to make KiCad work with it, that would be great. But if you just want to use KiCad, then stay far away from Wayland
Yes I am not using Wayland, but I am using a compiled wxwidgets separate from the system’s package.
I am using wxwidgets version 3.2.5 with the configure flags:
“–with-libmspack”
“–with-regex”
“–with-sdl”
“–enable-debug_info”
“–enable-gui”
“–enable-mediactrl”
“–enable-webview”
I do not see anything in the wxwidgets configuration about EGL, but maybe it is buried in there somewhere.
It looks like the compilation errors are about the KiCad file “opengl_gal”, with erros like “‘glewInit’ was not declared in this scope”.
So do you think this is an issue with my OpenGL or wxWidgets or EGL or am I just missing some other dependency?
Maybe this is outside the scope of a KiCad problem, if so I apologize, I am just excited about finally switching to KiCad 8 with my non-typical system and am searching for any clues on how to get it to compile and run correctly.
I recompiled wxwidgets as you suggested and your guess was correct, that did fix the compilation errors!
My original problem still exists however, the KiCad runtime does not seem to be able to find OpenGL, so it falls back to software rendering and the 3D Viewer does not work.
So I am still wondering if something changed between KiCad 7 and 8 that would cause the runtime trouble in finding OpenGL. Is there another environment variable that needs to be set to specify the OpenGL path? Is that search path hardcoded into the KiCad source or is it set by cmake during compilation somehow?
My new KiCad version information if it helps anything:
We do adjust things between versions. Some of this is hacking to try and get displays working on Wayland, some is bug fixes and performance enhancements.
I would recommend installing the standard KiCad from the debian backports repo and see if that finds your OpenGL stack. if it does, then you know the issue is in your compiling setup somewhere.
Since you are compiling yourself, you can compile a debug version and set some breakpoints to test what is failing. The OpenGL failures are throws, so you should be able to catch them in gdb and find the error message. That might give you hints.