Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake in sniper fails to locate libogg and libvorbis #735

Open
Gelmo opened this issue Jan 10, 2025 · 3 comments
Open

cmake in sniper fails to locate libogg and libvorbis #735

Gelmo opened this issue Jan 10, 2025 · 3 comments

Comments

@Gelmo
Copy link

Gelmo commented Jan 10, 2025

Your system information

  • Steam Runtime Version: Sniper
  • Distribution: Using the image registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest

Please describe your issue in as much detail as possible:

We are building our game in the Sniper container per the documentation at GitLab. We have Cmake find several packages, for example:

find_package(ZLIB REQUIRED GLOBAL)

However, this does not work for ogg or vorbis:

find_package(Ogg REQUIRED GLOBAL)
 CMake Error at extern/CMakeLists.txt:38 (find_package):
   By not providing "FindOgg.cmake" in CMAKE_MODULE_PATH this project has
   asked CMake to find a package configuration file provided by "Ogg", but
   CMake did not find one.

   Could not find a package configuration file provided by "Ogg" with any of
   the following names:

     OggConfig.cmake
     ogg-config.cmake

   Add the installation prefix of "Ogg" to CMAKE_PREFIX_PATH or set "Ogg_DIR"
   to a directory containing one of the above files.  If "Ogg" provides a
   separate development package or SDK, be sure it has been installed.
find_package(Vorbis REQUIRED GLOBAL)
   Could not find a package configuration file provided by "Vorbis" with any
   of the following names:

     VorbisConfig.cmake
     vorbis-config.cmake

   Add the installation prefix of "Vorbis" to CMAKE_PREFIX_PATH or set
   "Vorbis_DIR" to a directory containing one of the above files.  If "Vorbis"
   provides a separate development package or SDK, be sure it has been
   installed.

When browsing the Sniper image, we see that vorbis is missing as well.

find /usr -iname "*sdl*cmake*" -o -iname "*zlib*cmake*" -o -iname "*freetype*cmake*" -o -iname "*vorbis*cmake*" -o -iname "*openal*cmake*" -o -iname "*curl*cmake*" -o -iname "*stb*cmake*"
/usr/lib/i386-linux-gnu/cmake/SDL2/sdl2-config-version.cmake
/usr/lib/i386-linux-gnu/cmake/SDL2/sdl2-config.cmake
/usr/lib/i386-linux-gnu/cmake/SDL2_image/sdl2_image-config-version.cmake
/usr/lib/i386-linux-gnu/cmake/SDL2_image/sdl2_image-config.cmake
/usr/lib/i386-linux-gnu/cmake/SDL2_mixer/sdl2_mixer-config-version.cmake
/usr/lib/i386-linux-gnu/cmake/SDL2_mixer/sdl2_mixer-config.cmake
/usr/lib/i386-linux-gnu/cmake/SDL2_ttf/sdl2_ttf-config-version.cmake
/usr/lib/i386-linux-gnu/cmake/SDL2_ttf/sdl2_ttf-config.cmake
/usr/lib/x86_64-linux-gnu/cmake/SDL2/sdl2-config-version.cmake
/usr/lib/x86_64-linux-gnu/cmake/SDL2/sdl2-config.cmake
/usr/lib/x86_64-linux-gnu/cmake/SDL2_image/sdl2_image-config-version.cmake
/usr/lib/x86_64-linux-gnu/cmake/SDL2_image/sdl2_image-config.cmake
/usr/lib/x86_64-linux-gnu/cmake/SDL2_mixer/sdl2_mixer-config-version.cmake
/usr/lib/x86_64-linux-gnu/cmake/SDL2_mixer/sdl2_mixer-config.cmake
/usr/lib/x86_64-linux-gnu/cmake/SDL2_ttf/sdl2_ttf-config-version.cmake
/usr/lib/x86_64-linux-gnu/cmake/SDL2_ttf/sdl2_ttf-config.cmake
/usr/share/cmake-3.25/Modules/FindCURL.cmake
/usr/share/cmake-3.25/Modules/FindFreetype.cmake
/usr/share/cmake-3.25/Modules/FindSDL_gfx.cmake
/usr/share/cmake-3.25/Modules/FindSDL_image.cmake
/usr/share/cmake-3.25/Modules/FindSDL_net.cmake
/usr/share/cmake-3.25/Modules/FindOpenAL.cmake
/usr/share/cmake-3.25/Modules/FindSDL.cmake
/usr/share/cmake-3.25/Modules/FindSDL_mixer.cmake
/usr/share/cmake-3.25/Modules/FindSDL_sound.cmake
/usr/share/cmake-3.25/Modules/FindSDL_ttf.cmake
/usr/share/cmake-3.25/Modules/FindZLIB.cmake
/usr/share/cmake-3.25/Modules/TestBigEndian.cmake
Gelmo added a commit to TeamForbiddenLLC/warfork-qfusion that referenced this issue Jan 10, 2025
@Gelmo
Copy link
Author

Gelmo commented Jan 10, 2025

Maybe this is related - xiph/vorbis#69 - And if so, I suppose that means it won't be fixed until SLR is newer than Debian 11. I guess we'll need to add our own FindOgg.cmake and FindVorbis.cmake

Gelmo added a commit to TeamForbiddenLLC/warfork-qfusion that referenced this issue Jan 10, 2025
Gelmo added a commit to TeamForbiddenLLC/warfork-qfusion that referenced this issue Jan 10, 2025
Gelmo added a commit to TeamForbiddenLLC/warfork-qfusion that referenced this issue Jan 10, 2025
@Gelmo
Copy link
Author

Gelmo commented Jan 10, 2025

Likely related - xiph/ogg#82

Gelmo added a commit to TeamForbiddenLLC/warfork-qfusion that referenced this issue Jan 10, 2025
Gelmo added a commit to TeamForbiddenLLC/warfork-qfusion that referenced this issue Jan 10, 2025
pollend pushed a commit to TeamForbiddenLLC/warfork-qfusion that referenced this issue Jan 11, 2025
https://gitlab.steamos.cloud/steamrt/sniper/sdk/-/blob/steamrt/sniper/README.md

https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/main/docs/slr-for-game-developers.md

- Revert to clang-11
- Don't install system libs that won't be provided to users in the SLR
- Use system libs where possible
- Update Dockerfile to match CI pipeline
- [temp] Manually find Ogg/Vorbis when using system libs
- revert once resolved: ValveSoftware/steam-runtime#735
- fix rpath for build
- issue using sdl from steam-runtime: ValveSoftware/steam-runtime#736
- set fpic for all targets
- Don't use system ogg/vorbis ValveSoftware/steam-runtime#735

Signed-off-by: Michael Pollind <[email protected]>
Co-authored-by: Gelmo <[email protected]>
Gelmo added a commit to TeamForbiddenLLC/warfork-qfusion that referenced this issue Jan 11, 2025
https://gitlab.steamos.cloud/steamrt/sniper/sdk/-/blob/steamrt/sniper/README.md

https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/main/docs/slr-for-game-developers.md

- Revert to clang-11
- Don't install system libs that won't be provided to users in the SLR
- Use system libs where possible
- Update Dockerfile to match CI pipeline
- [temp] Manually find Ogg/Vorbis when using system libs
- revert once resolved: ValveSoftware/steam-runtime#735
- fix rpath for build
- issue using sdl from steam-runtime: ValveSoftware/steam-runtime#736
- set fpic for all targets
- Don't use system ogg/vorbis ValveSoftware/steam-runtime#735

Signed-off-by: Michael Pollind <[email protected]>
Co-authored-by: Gelmo <[email protected]>
@smcv
Copy link
Contributor

smcv commented Jan 13, 2025

The versions of libogg and libvorbis in sniper are correctly installed, but because they were built with Autotools, they didn't generate CMake-specific metadata describing how to find them.

For the Steam Runtime environment, please locate these libraries using pkg-config, which has cross-build-system metadata discovery that can be used from Autotools, CMake, Meson and probably others. The versions of libogg and libvorbis in sniper do provide pkg-config metadata.

https://cmake.org/cmake/help/latest/module/FindPkgConfig.html suggests that pkg_check_modules (OGG ogg) should set variables like OGG_FOUND, OGG_CFLAGS and OGG_LIBRARIES, and similar for vorbis.

A few libraries (like SDL and dbus) generate CMake-specific metadata even when they were built with some other build system, but this is not universal and cannot be relied on: it requires the maintainer of every library to write CMake-specific build system code, even if they do not use or recommend CMake themselves.

@TTimo TTimo changed the title Looks like ogg and vorbis may not be properly installed in the sniper image, for building cmake in sniper fails to locate libogg and libvorbis Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants