sonic-pi
sonic-pi copied to clipboard
Linux build fails
/home/matheus/Programs/sonic-pi/app/api/src/sonicpi_api.test.cpp:3:10: fatal error: catch2/catch_test_macros.hpp: No such file or directory
3 | #include <catch2/catch_test_macros.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [api-tests/CMakeFiles/api-tests.dir/build.make:76: api-tests/CMakeFiles/api-tests.dir/__/api/src/sonicpi_api.test.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:370: api-tests/CMakeFiles/api-tests.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
OS: archlinux I have catch2 installed but I can't find that headerfile anywhere.
Hi! We require at least catch2 v3 (which Arch does not seem to have packaged)
I assume you're trying to do a build without vcpkg (since otherwise catch2 should automatically be provided by default), so you could try the catch2-git AUR package or manually install it into /usr/local or something depending on your needs
I've built catch2-git from source, also installed aur's vcpkg and ran ./linux-clean.sh and git clean -fdx.
I got passed that but now something is wrong with imgui:
[ 98%] Building CXX object gui/imgui/CMakeFiles/sonic-pi-imgui.dir/core/imgui.cpp.o
[ 99%] Building CXX object gui/imgui/CMakeFiles/sonic-pi-imgui.dir/core/imgui_demo.cpp.o
[ 99%] Building CXX object gui/imgui/CMakeFiles/sonic-pi-imgui.dir/core/imgui_draw.cpp.o
[ 99%] Building CXX object gui/imgui/CMakeFiles/sonic-pi-imgui.dir/core/imgui_tables.cpp.o
[ 99%] Building CXX object gui/imgui/CMakeFiles/sonic-pi-imgui.dir/core/imgui_widgets.cpp.o
[100%] Building CXX object gui/imgui/CMakeFiles/sonic-pi-imgui.dir/backends/imgui_impl_opengl3.cpp.o
[100%] Building CXX object gui/imgui/CMakeFiles/sonic-pi-imgui.dir/backends/imgui_impl_sdl.cpp.o
[100%] Linking CXX executable sonic-pi-imgui
/usr/bin/ld: CMakeFiles/sonic-pi-imgui.dir/backends/imgui_impl_opengl3.cpp.o: warning: relocation against `__glewBindBuffer' in read-only section `.text'
/usr/bin/ld: CMakeFiles/sonic-pi-imgui.dir/main.cpp.o: in function `main':
main.cpp:(.text+0x3a5): undefined reference to `glewInit'
/usr/bin/ld: CMakeFiles/sonic-pi-imgui.dir/backends/imgui_impl_opengl3.cpp.o: in function `ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int)':
imgui_impl_opengl3.cpp:(.text+0x225): undefined reference to `__glewBlendEquation'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x3f2): undefined reference to `__glewUseProgram'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x403): undefined reference to `__glewUniform1i'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x419): undefined reference to `__glewUniformMatrix4fv'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x449): undefined reference to `__glewBindSampler'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x45c): undefined reference to `__glewBindVertexArray'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x46d): undefined reference to `__glewBindBuffer'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x483): undefined reference to `__glewBindBuffer'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x499): undefined reference to `__glewEnableVertexAttribArray'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x4aa): undefined reference to `__glewEnableVertexAttribArray'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x4bb): undefined reference to `__glewEnableVertexAttribArray'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x4cc): undefined reference to `__glewVertexAttribPointer'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x4f9): undefined reference to `__glewVertexAttribPointer'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x526): undefined reference to `__glewVertexAttribPointer'
/usr/bin/ld: CMakeFiles/sonic-pi-imgui.dir/backends/imgui_impl_opengl3.cpp.o: in function `ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*)':
imgui_impl_opengl3.cpp:(.text+0x5f9): undefined reference to `__glewActiveTexture'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x7ad): undefined reference to `__glewGenVertexArrays'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x829): undefined reference to `__glewBufferData'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x863): undefined reference to `__glewBufferData'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0xa5d): undefined reference to `__glewDrawElementsBaseVertex'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0xaea): undefined reference to `__glewDeleteVertexArrays'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0xb02): undefined reference to `__glewUseProgram'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0xb32): undefined reference to `__glewBindSampler'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0xb48): undefined reference to `__glewActiveTexture'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0xb59): undefined reference to `__glewBindVertexArray'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0xb6a): undefined reference to `__glewBindBuffer'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0xb80): undefined reference to `__glewBlendEquationSeparate'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0xb99): undefined reference to `__glewBlendFuncSeparate'
/usr/bin/ld: CMakeFiles/sonic-pi-imgui.dir/backends/imgui_impl_opengl3.cpp.o: in function `CheckShader(unsigned int, char const*)':
imgui_impl_opengl3.cpp:(.text+0xe7e): undefined reference to `__glewGetShaderiv'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0xe95): undefined reference to `__glewGetShaderiv'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0xf01): undefined reference to `__glewGetShaderInfoLog'
/usr/bin/ld: CMakeFiles/sonic-pi-imgui.dir/backends/imgui_impl_opengl3.cpp.o: in function `CheckProgram(unsigned int, char const*)':
imgui_impl_opengl3.cpp:(.text+0xfcd): undefined reference to `__glewGetProgramiv'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0xfe4): undefined reference to `__glewGetProgramiv'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x1054): undefined reference to `__glewGetProgramInfoLog'
/usr/bin/ld: CMakeFiles/sonic-pi-imgui.dir/backends/imgui_impl_opengl3.cpp.o: in function `ImGui_ImplOpenGL3_CreateDeviceObjects()':
imgui_impl_opengl3.cpp:(.text+0x1273): undefined reference to `__glewCreateShader'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x1287): undefined reference to `__glewShaderSource'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x12a7): undefined reference to `__glewCompileShader'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x12f2): undefined reference to `__glewCreateShader'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x1306): undefined reference to `__glewShaderSource'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x1326): undefined reference to `__glewCompileShader'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x134e): undefined reference to `__glewCreateProgram'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x135d): undefined reference to `__glewAttachShader'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x1376): undefined reference to `__glewAttachShader'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x138f): undefined reference to `__glewLinkProgram'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x13b7): undefined reference to `__glewGetUniformLocation'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x13d8): undefined reference to `__glewGetUniformLocation'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x13f9): undefined reference to `__glewGetAttribLocation'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x141a): undefined reference to `__glewGetAttribLocation'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x143b): undefined reference to `__glewGetAttribLocation'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x145c): undefined reference to `__glewGenBuffers'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x1474): undefined reference to `__glewGenBuffers'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x14a3): undefined reference to `__glewBindBuffer'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x14b9): undefined reference to `__glewBindVertexArray'
/usr/bin/ld: CMakeFiles/sonic-pi-imgui.dir/backends/imgui_impl_opengl3.cpp.o: in function `ImGui_ImplOpenGL3_DestroyDeviceObjects()':
imgui_impl_opengl3.cpp:(.text+0x14f3): undefined reference to `__glewDeleteBuffers'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x151f): undefined reference to `__glewDeleteBuffers'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x1555): undefined reference to `__glewDetachShader'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x1582): undefined reference to `__glewDetachShader'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x15a5): undefined reference to `__glewDeleteShader'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x15ca): undefined reference to `__glewDeleteShader'
/usr/bin/ld: imgui_impl_opengl3.cpp:(.text+0x15ef): undefined reference to `__glewDeleteProgram'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make[2]: *** [gui/imgui/CMakeFiles/sonic-pi-imgui.dir/build.make:334: gui/imgui/sonic-pi-imgui] Error 1
make[1]: *** [CMakeFiles/Makefile2:557: gui/imgui/CMakeFiles/sonic-pi-imgui.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
How can i build with vcpkg, I have it installed, and ran ./linux-build-all.sh but doesn't seem like it is picking the right imgui version?
So the build process bootstraps and uses its own version of vcpkg unless you tell it otherwise (system vcpkg would not be used)
Can you redownload a fresh copy of the repository, run ./linux-build-all.sh 2>&1 | tee build.log, and then upload the build.log file?
@lilyinstarlight here it is build.log
Huh, since it only seems to be failing for the optional imgui build, just running ./linux-build-all.sh -n should work -- and it seems to be finding the bootstrapped vcpkg just fine now so idk why installing catch2-git was required
It worked thanks!
@matheusfillipe - great to hear you're up and running. @lilyinstarlight thanks so much for your amazing help here.