Policy CMP0072 is not set
thx1111 opened this issue ยท 1 comments
thx1111 commented
CMake Warning (dev) at /usr/share/cmake/Modules/FindOpenGL.cmake:315 (message):
Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
available. Run "cmake --help-policy CMP0072" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
FindOpenGL found both a legacy GL library:
OPENGL_gl_LIBRARY: /usr/lib/libGL.so
and GLVND libraries for OpenGL and GLX:
OPENGL_opengl_LIBRARY: /usr/lib/libOpenGL.so
OPENGL_glx_LIBRARY: /usr/lib/libGLX.so
OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
compatibility with CMake 3.10 and below the legacy GL library will be used.
CMakeLists.txt
---------------------
...
SET(CMAKE_POLICY_DEFAULT_CMP0072 NEW)
...
Abdull commented
Documentation:
- https://cmake.org/cmake/help/latest/module/FindOpenGL.html
- https://cmake.org/cmake/help/latest/policy/CMP0072.html
cmake --help-policy CMP0072
I got the reported warning as well when building Cubic SDR on version https://github.com/cjcliffe/CubicSDR/tree/033330367cd179d7b04503027d41afa7514036f4
on my system, which has the following setup:
- Framework 13 AMD laptop
- Debian 12 bookworm, amd64
- maybe relevant: my system has a couple of self-built mesa3d, drm, amdgpu stuff
cmake --version
:3.25.1
Default (legacy, OLD) build - CubicSDR works
mkdir build
cd build/
cmake ..
# reported warning message appears, hence the OpenGL_GL_PREFERENCE "LEGACY" is used
make
x64/CubicSDR
# executing "../build/x64/CubicSDR" starts up CubicSDR correctly
ldd ../build/x64/CubicSDR | grep -i gl
# libwx_gtk3u_gl-3.2.so.0 => /lib/x86_64-linux-gnu/libwx_gtk3u_gl-3.2.so.0 (0x00007fd2b47e2000)
# libGL.so.1 => /usr/local/lib/x86_64-linux-gnu/libGL.so.1 (0x00007fd2b3b0f000)
# libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fd2b2492000)
# libglapi.so.0 => /usr/local/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007fd2b21db000)
# libxcb-glx.so.0 => /lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007fd2b21a8000)
# libwayland-egl.so.1 => /lib/x86_64-linux-gnu/libwayland-egl.so.1 (0x00007fd2b2006000)
"Modern" (GLVND, NEW) build - CubicSDR crashes
I was curious if using OpenGL_GL_PREFERENCE "GLVND" has any benefit. To do so,
- either add the following to
CMakeLists.txt
("method 1"):if(POLICY CMP0072) cmake_policy(SET CMP0072 NEW) endif()
- or generate with the following settings ("method 2"):
mkdir build-glvnd cd build-glvnd/ cmake -DCMAKE_POLICY_DEFAULT_CMP0072=NEW ..
Example run using method 2:
mkdir build-glvnd
cd build-glvnd/
cmake -DCMAKE_POLICY_DEFAULT_CMP0072=NEW ..
# reported warning no longer appears, because a OpenGL_GL_PREFERENCE, "GLVND", is explicitly set
make
x64/CubicSDR
# executing "../build-glvnd/x64/CubicSDR" CRASHES, see below core dump
ldd ../build-glvnd/x64/CubicSDR | grep -i gl
libwx_gtk3u_gl-3.2.so.0 => /lib/x86_64-linux-gnu/libwx_gtk3u_gl-3.2.so.0 (0x00007f2a826d1000)
libOpenGL.so.0 => /lib/x86_64-linux-gnu/libOpenGL.so.0 (0x00007f2a81a43000)
libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007f2a81a0d000)
libGL.so.1 => /usr/local/lib/x86_64-linux-gnu/libGL.so.1 (0x00007f2a80806000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f2a80320000)
libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f2a7ffe3000)
libwayland-egl.so.1 => /lib/x86_64-linux-gnu/libwayland-egl.so.1 (0x00007f2a7f984000)
libglapi.so.0 => /usr/local/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007f2a7f8db000)
libxcb-glx.so.0 => /lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007f2a7f8a8000)
GLVND build core dump (click to expand/toggle)
Jun 21 19:05:10 abdull systemd-coredump[779934]: [๐ก] Process 779922 (CubicSDR) of user 1000 dumped core.
Module libsystemd.so.0 from deb systemd-252.22-1~deb12u1.amd64
Stack trace of thread 779922:
#0 0x00007f2c3a0dde2c __pthread_kill_implementation (libc.so.6 + 0x8ae2c)
#1 0x00007f2c3a08efb2 __GI_raise (libc.so.6 + 0x3bfb2)
#2 0x00007f2c3a079472 __GI_abort (libc.so.6 + 0x26472)
#3 0x00007f2c3a079395 __assert_fail_base (libc.so.6 + 0x26395)
#4 0x00007f2c3a087eb2 __GI___assert_fail (libc.so.6 + 0x34eb2)
#5 0x00007f2c38603382 _glapi_add_dispatch (libglapi.so.0 + 0x19382)
#6 0x00007f2c260a4d51 n/a (radeonsi_dri.so + 0x2f5d51)
#7 0x00007f2c3a0e0f97 __pthread_once_slow (libc.so.6 + 0x8df97)
#8 0x00007f2c25fbd3aa n/a (radeonsi_dri.so + 0x20e3aa)
#9 0x00007f2c25f2527d n/a (radeonsi_dri.so + 0x17627d)
#10 0x00007f2c25e60c53 n/a (radeonsi_dri.so + 0xb1c53)
#11 0x00007f2c25e642fc n/a (radeonsi_dri.so + 0xb52fc)
#12 0x00007f2c34157114 n/a (libGLX_mesa.so.0 + 0x43114)
#13 0x00007f2c341418d5 n/a (libGLX_mesa.so.0 + 0x2d8d5)
#14 0x00007f2c341450e2 n/a (libGLX_mesa.so.0 + 0x310e2)
#15 0x00007f2c341454dd n/a (libGLX_mesa.so.0 + 0x314dd)
#16 0x00007f2c3a7208f3 glXCreateContext (libGLX.so.0 + 0x48f3)
#17 0x00007f2c3b3f214a _ZN11wxGLContextC1EP10wxGLCanvasPKS_PK16wxGLContextAttrs (libwx_gtk3u_gl-3.2.so.0 + 0x1214a)
#18 0x000055dbf8178939 _ZN16PrimaryGLContextC1EP10wxGLCanvasP11wxGLContextP16wxGLContextAttrs (CubicSDR + 0x192939)
#19 0x000055dbf80af00b _ZN8CubicSDR10GetContextEP10wxGLCanvas (CubicSDR + 0xc900b)
#20 0x000055dbf818de18 _ZN10GainCanvasC1EP8wxWindowRK14wxGLAttributes (CubicSDR + 0x1a7e18)
#21 0x000055dbf80cecd4 _ZN8AppFrameC2Ev (CubicSDR + 0xe8cd4)
#22 0x000055dbf80b44da _ZN8CubicSDR6OnInitEv (CubicSDR + 0xce4da)
#23 0x00007f2c3a89ceea _Z7wxEntryRiPPw (libwx_baseu-3.2.so.0 + 0x11feea)
#24 0x000055dbf809fc18 main (CubicSDR + 0xb9c18)
#25 0x00007f2c3a07a24a __libc_start_call_main (libc.so.6 + 0x2724a)
#26 0x00007f2c3a07a305 __libc_start_main_impl (libc.so.6 + 0x27305)
#27 0x000055dbf80a35a1 _start (CubicSDR + 0xbd5a1)
Stack trace of thread 779925:
#0 0x00007f2c3a0d8e96 __futex_abstimed_wait_common64 (libc.so.6 + 0x85e96)
#1 0x00007f2c3a0dbb2f __pthread_cond_wait_common (libc.so.6 + 0x88b2f)
#2 0x000055dbf810d18b _ZN13SDRPostThread3runEv (CubicSDR + 0x12718b)
#3 0x000055dbf80eb63a _ZN8IOThread10threadMainEv (CubicSDR + 0x10563a)
#4 0x00007f2c3a4094a3 execute_native_thread_routine (libstdc++.so.6 + 0xd44a3)
#5 0x00007f2c3a0dc134 start_thread (libc.so.6 + 0x89134)
#6 0x00007f2c3a15c7dc __clone3 (libc.so.6 + 0x1097dc)
Stack trace of thread 779924:
#0 0x00007f2c3a122485 __GI___clock_nanosleep (libc.so.6 + 0xcf485)
#1 0x00007f2c3a126d93 __GI___nanosleep (libc.so.6 + 0xd3d93)
#2 0x000055dbf81a2244 _ZN24SpectrumVisualDataThread3runEv (CubicSDR + 0x1bc244)
#3 0x000055dbf80eb63a _ZN8IOThread10threadMainEv (CubicSDR + 0x10563a)
#4 0x00007f2c3a4094a3 execute_native_thread_routine (libstdc++.so.6 + 0xd44a3)
#5 0x00007f2c3a0dc134 start_thread (libc.so.6 + 0x89134)
#6 0x00007f2c3a15c7dc __clone3 (libc.so.6 + 0x1097dc)
Stack trace of thread 779926:
#0 0x00007f2c3a14f15f __GI___poll (libc.so.6 + 0xfc15f)
#1 0x00007f2c390839ae g_main_context_poll (libglib-2.0.so.0 + 0x549ae)
#2 0x00007f2c39083acc g_main_context_iteration (libglib-2.0.so.0 + 0x54acc)
#3 0x00007f2c39083b11 glib_worker_main (libglib-2.0.so.0 + 0x54b11)
#4 0x00007f2c390adcfd g_thread_proxy (libglib-2.0.so.0 + 0x7ecfd)
#5 0x00007f2c3a0dc134 start_thread (libc.so.6 + 0x89134)
#6 0x00007f2c3a15c7dc __clone3 (libc.so.6 + 0x1097dc)
Stack trace of thread 779929:
#0 0x00007f2c3a0d8e96 __futex_abstimed_wait_common64 (libc.so.6 + 0x85e96)
#1 0x00007f2c3a0db558 __pthread_cond_wait_common (libc.so.6 + 0x88558)
#2 0x00007f2c25ebb059 n/a (radeonsi_dri.so + 0x10c059)
#3 0x00007f2c25e6d17b n/a (radeonsi_dri.so + 0xbe17b)
#4 0x00007f2c25ebaf97 n/a (radeonsi_dri.so + 0x10bf97)
#5 0x00007f2c3a0dc134 start_thread (libc.so.6 + 0x89134)
#6 0x00007f2c3a15c7dc __clone3 (libc.so.6 + 0x1097dc)
Stack trace of thread 779927:
#0 0x00007f2c3a14f15f __GI___poll (libc.so.6 + 0xfc15f)
#1 0x00007f2c390839ae g_main_context_poll (libglib-2.0.so.0 + 0x549ae)
#2 0x00007f2c39083cef g_main_loop_run (libglib-2.0.so.0 + 0x54cef)
#3 0x00007f2c392807b6 gdbus_shared_thread_func (libgio-2.0.so.0 + 0x1197b6)
#4 0x00007f2c390adcfd g_thread_proxy (libglib-2.0.so.0 + 0x7ecfd)
#5 0x00007f2c3a0dc134 start_thread (libc.so.6 + 0x89134)
#6 0x00007f2c3a15c7dc __clone3 (libc.so.6 + 0x1097dc)
Stack trace of thread 779930:
#0 0x00007f2c3a0d8e96 __futex_abstimed_wait_common64 (libc.so.6 + 0x85e96)
#1 0x00007f2c3a0db558 __pthread_cond_wait_common (libc.so.6 + 0x88558)
#2 0x00007f2c25ebb059 n/a (radeonsi_dri.so + 0x10c059)
#3 0x00007f2c25e6d17b n/a (radeonsi_dri.so + 0xbe17b)
#4 0x00007f2c25ebaf97 n/a (radeonsi_dri.so + 0x10bf97)
#5 0x00007f2c3a0dc134 start_thread (libc.so.6 + 0x89134)
#6 0x00007f2c3a15c7dc __clone3 (libc.so.6 + 0x1097dc)
Stack trace of thread 779931:
#0 0x00007f2c3a0d8e96 __futex_abstimed_wait_common64 (libc.so.6 + 0x85e96)
#1 0x00007f2c3a0db558 __pthread_cond_wait_common (libc.so.6 + 0x88558)
#2 0x00007f2c25ebb059 n/a (radeonsi_dri.so + 0x10c059)
#3 0x00007f2c25e6d17b n/a (radeonsi_dri.so + 0xbe17b)
#4 0x00007f2c25ebaf97 n/a (radeonsi_dri.so + 0x10bf97)
#5 0x00007f2c3a0dc134 start_thread (libc.so.6 + 0x89134)
#6 0x00007f2c3a15c7dc __clone3 (libc.so.6 + 0x1097dc)
Stack trace of thread 779932:
#0 0x00007f2c3a0d8e96 __futex_abstimed_wait_common64 (libc.so.6 + 0x85e96)
#1 0x00007f2c3a0db558 __pthread_cond_wait_common (libc.so.6 + 0x88558)
#2 0x00007f2c25ebb059 n/a (radeonsi_dri.so + 0x10c059)
#3 0x00007f2c25e6d17b n/a (radeonsi_dri.so + 0xbe17b)
#4 0x00007f2c25ebaf97 n/a (radeonsi_dri.so + 0x10bf97)
#5 0x00007f2c3a0dc134 start_thread (libc.so.6 + 0x89134)
#6 0x00007f2c3a15c7dc __clone3 (libc.so.6 + 0x1097dc)
Stack trace of thread 779923:
#0 0x00007f2c3a122485 __GI___clock_nanosleep (libc.so.6 + 0xcf485)
#1 0x00007f2c3a126d93 __GI___nanosleep (libc.so.6 + 0xd3d93)
#2 0x000055dbf81a2244 _ZN24SpectrumVisualDataThread3runEv (CubicSDR + 0x1bc244)
#3 0x000055dbf80eb63a _ZN8IOThread10threadMainEv (CubicSDR + 0x10563a)
#4 0x00007f2c3a4094a3 execute_native_thread_routine (libstdc++.so.6 + 0xd44a3)
#5 0x00007f2c3a0dc134 start_thread (libc.so.6 + 0x89134)
#6 0x00007f2c3a15c7dc __clone3 (libc.so.6 + 0x1097dc)
ELF object binary architecture: AMD x86-64
โโ Subject: Process 779922 (CubicSDR) dumped core
โโ Defined-By: systemd
โโ Support: https://www.debian.org/support
โโ Documentation: man:core(5)
โโ
โโ Process 779922 (CubicSDR) crashed and dumped core.
โโ
โโ This usually indicates a programming error in the crashing program and
โโ should be reported to its vendor as a bug.