Open T-X opened 2 years ago
For the libglew issue I seem to be able to fix it with the following change:
$ git diff
diff --git a/app/gui/imgui/CMakeLists.txt b/app/gui/imgui/CMakeLists.txt
index 0cc68866d556..609b6928f70a 100644
--- a/app/gui/imgui/CMakeLists.txt
+++ b/app/gui/imgui/CMakeLists.txt
@@ -15,6 +15,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/cmake/demo_common.cmake)
find_package(gl3w CONFIG REQUIRED)
find_package(SDL2 CONFIG REQUIRED)
find_package(fmt CONFIG REQUIRED)
+find_package(GLEW REQUIRED)
if (USE_SYSTEM_LIBS)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
@@ -99,6 +100,7 @@ target_link_libraries (${APP_NAME}
PRIVATE
SonicPi::API
fmt::fmt
+ GLEW::GLEW
)
if (USE_SYSTEM_LIBS)
However I'm still getting linker errors for SDL_waylandvideo.c due to various "undefined reference to libdecor[...]":
$ ./linux-build-all.sh
[...]
Consolidate compiler generated dependencies of target sonic-pi
[ 75%] Building CXX object gui/qt/CMakeFiles/sonic-pi.dir/mainwindow.cpp.o
[ 75%] Building CXX object gui/qt/CMakeFiles/sonic-pi.dir/utils/sonicpi_i18n.cpp.o
[ 75%] Building CXX object gui/qt/CMakeFiles/sonic-pi.dir/sonic-pi_autogen/EWIEGA46WW/qrc_help_files.cpp.o
[ 76%] Building CXX object gui/qt/CMakeFiles/sonic-pi.dir/sonic-pi_autogen/EWIEGA46WW/qrc_info_files.cpp.o
[ 76%] Linking CXX executable sonic-pi
[ 95%] Built target sonic-pi
Consolidate compiler generated dependencies of target sonic-pi-imgui
[ 96%] Linking CXX executable sonic-pi-imgui
/usr/bin/ld: /home/linus/dev-priv/sonic-pi/app/vcpkg/installed/x64-linux/debug/lib/libSDL2d.a(SDL_waylandvideo.c.o): in function `Wayland_LoadLibdecor':
/home/linus/dev-priv/sonic-pi/app/vcpkg/buildtrees/sdl2/src/bfc793b2ac-a3edea5847.clean/src/video/wayland/SDL_waylandvideo.c:948: undefined reference to `libdecor_new'
/usr/bin/ld: /home/linus/dev-priv/sonic-pi/app/vcpkg/installed/x64-linux/debug/lib/libSDL2d.a(SDL_waylandvideo.c.o): in function `Wayland_VideoQuit':
/home/linus/dev-priv/sonic-pi/app/vcpkg/buildtrees/sdl2/src/bfc793b2ac-a3edea5847.clean/src/video/wayland/SDL_waylandvideo.c:1098: undefined reference to `libdecor_unref'
/usr/bin/ld: /home/linus/dev-priv/sonic-pi/app/vcpkg/installed/x64-linux/debug/lib/libSDL2d.a(SDL_waylandwindow.c.o): in function `SetMinMaxDimensions':
/home/linus/dev-priv/sonic-pi/app/vcpkg/buildtrees/sdl2/src/bfc793b2ac-a3edea5847.clean/src/video/wayland/SDL_waylandwindow.c:349: undefined reference to `libdecor_frame_set_min_content_size'
/usr/bin/ld: /home/linus/dev-priv/sonic-pi/app/vcpkg/buildtrees/sdl2/src/bfc793b2ac-a3edea5847.clean/src/video/wayland/SDL_waylandwindow.c:352: undefined reference to `libdecor_frame_set_max_content_size'
/usr/bin/ld: /home/linus/dev-priv/sonic-pi/app/vcpkg/buildtrees/sdl2/src/bfc793b2ac-a3edea5847.clean/src/video/wayland/SDL_waylandwindow.c:357: undefined reference to `libdecor_state_new'
/usr/bin/ld: /home/linus/dev-priv/sonic-pi/app/vcpkg/buildtrees/sdl2/src/bfc793b2ac-a3edea5847.clean/src/video/wayland/SDL_waylandwindow.c:358: undefined reference to `libdecor_frame_commit'
/usr/bin/ld: /home/linus/dev-priv/sonic-pi/app/vcpkg/buildtrees/sdl2/src/bfc793b2ac-a3edea5847.clean/src/video/wayland/SDL_waylandwindow.c:359: undefined reference to `libdecor_state_free'
[...]
See previously uploaded/linked, full sonic-pi-buildlog.txt.
You may well need a more unto date elixir and Erlang. I'd try installing using the pi-install-elixir.sh script in app. Then restart your terminal and check that elixir loads from the .asdf folder in your user home folder. Also, you don't really need the imgui interface. I'd run the build-all script with parameter -n which prevents it from trying to build. EDIT I also usually install the latest cmake from snap. Some early versions can cause problems.
@rbnpi thanks for your help, building and running sonic-pi with "./linux-build-all.sh -n" worked indeed!
I would love to further help debugging the issue, but I'm a bit hesitant with updating tools user or even system wide. I was hoping that things on Debian Sid aka "unstable" would be new enough. (cmake: 3.24.2-2, elixir: 1.14.0.dfsg-2, erlang: 1:24.3.4.5+dfsg-1)
Btw. using "./linux-build-all.sh --system-libs -n" does not work for me (but I should probably file a new issue for that).
For the libglew issue I seem to be able to fix it with the following change:
$ git diff diff --git a/app/gui/imgui/CMakeLists.txt b/app/gui/imgui/CMakeLists.txt index 0cc68866d556..609b6928f70a 100644 --- a/app/gui/imgui/CMakeLists.txt +++ b/app/gui/imgui/CMakeLists.txt @@ -15,6 +15,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/cmake/demo_common.cmake) find_package(gl3w CONFIG REQUIRED) find_package(SDL2 CONFIG REQUIRED) find_package(fmt CONFIG REQUIRED) +find_package(GLEW REQUIRED) if (USE_SYSTEM_LIBS) set(CMAKE_THREAD_PREFER_PTHREAD TRUE) @@ -99,6 +100,7 @@ target_link_libraries (${APP_NAME} PRIVATE SonicPi::API fmt::fmt + GLEW::GLEW ) if (USE_SYSTEM_LIBS)
However I'm still getting linker errors for SDL_waylandvideo.c due to various "undefined reference to libdecor[...]":
$ ./linux-build-all.sh [...] Consolidate compiler generated dependencies of target sonic-pi [ 75%] Building CXX object gui/qt/CMakeFiles/sonic-pi.dir/mainwindow.cpp.o [ 75%] Building CXX object gui/qt/CMakeFiles/sonic-pi.dir/utils/sonicpi_i18n.cpp.o [ 75%] Building CXX object gui/qt/CMakeFiles/sonic-pi.dir/sonic-pi_autogen/EWIEGA46WW/qrc_help_files.cpp.o [ 76%] Building CXX object gui/qt/CMakeFiles/sonic-pi.dir/sonic-pi_autogen/EWIEGA46WW/qrc_info_files.cpp.o [ 76%] Linking CXX executable sonic-pi [ 95%] Built target sonic-pi Consolidate compiler generated dependencies of target sonic-pi-imgui [ 96%] Linking CXX executable sonic-pi-imgui /usr/bin/ld: /home/linus/dev-priv/sonic-pi/app/vcpkg/installed/x64-linux/debug/lib/libSDL2d.a(SDL_waylandvideo.c.o): in function `Wayland_LoadLibdecor': /home/linus/dev-priv/sonic-pi/app/vcpkg/buildtrees/sdl2/src/bfc793b2ac-a3edea5847.clean/src/video/wayland/SDL_waylandvideo.c:948: undefined reference to `libdecor_new' /usr/bin/ld: /home/linus/dev-priv/sonic-pi/app/vcpkg/installed/x64-linux/debug/lib/libSDL2d.a(SDL_waylandvideo.c.o): in function `Wayland_VideoQuit': /home/linus/dev-priv/sonic-pi/app/vcpkg/buildtrees/sdl2/src/bfc793b2ac-a3edea5847.clean/src/video/wayland/SDL_waylandvideo.c:1098: undefined reference to `libdecor_unref' /usr/bin/ld: /home/linus/dev-priv/sonic-pi/app/vcpkg/installed/x64-linux/debug/lib/libSDL2d.a(SDL_waylandwindow.c.o): in function `SetMinMaxDimensions': /home/linus/dev-priv/sonic-pi/app/vcpkg/buildtrees/sdl2/src/bfc793b2ac-a3edea5847.clean/src/video/wayland/SDL_waylandwindow.c:349: undefined reference to `libdecor_frame_set_min_content_size' /usr/bin/ld: /home/linus/dev-priv/sonic-pi/app/vcpkg/buildtrees/sdl2/src/bfc793b2ac-a3edea5847.clean/src/video/wayland/SDL_waylandwindow.c:352: undefined reference to `libdecor_frame_set_max_content_size' /usr/bin/ld: /home/linus/dev-priv/sonic-pi/app/vcpkg/buildtrees/sdl2/src/bfc793b2ac-a3edea5847.clean/src/video/wayland/SDL_waylandwindow.c:357: undefined reference to `libdecor_state_new' /usr/bin/ld: /home/linus/dev-priv/sonic-pi/app/vcpkg/buildtrees/sdl2/src/bfc793b2ac-a3edea5847.clean/src/video/wayland/SDL_waylandwindow.c:358: undefined reference to `libdecor_frame_commit' /usr/bin/ld: /home/linus/dev-priv/sonic-pi/app/vcpkg/buildtrees/sdl2/src/bfc793b2ac-a3edea5847.clean/src/video/wayland/SDL_waylandwindow.c:359: undefined reference to `libdecor_state_free' [...]
See previously uploaded/linked, full sonic-pi-buildlog.txt.
Check out this comment: https://github.com/microsoft/vcpkg/issues/25892#issuecomment-1272454574
libsdl2 libsdl2-dev
are the packages I believe he is referring to.
When trying to build a current sonic-pi "dev" branch on Linux / Debian Sid / amd64 arch linking seems to fail with various glew functions missing:
Full build log here: sonic-pi-buildlog.txt
However libglew libraries seem to be installed: