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

Arch Linux theora compilation CMake error 'Could not find a configuration file for package "Ogg" that is compatible with requested version ' #118

Closed
gioan777 opened this issue Apr 26, 2023 · 6 comments · Fixed by #119

Comments

@gioan777
Copy link
Contributor

gioan777 commented Apr 26, 2023

Trying to build the repo fails on my machine. I'm not sure what causes it
From a little investigating it fails when it tries to build 'theora' which it does from the build-cmakelibs.sh file
BTW manually cloning the theora repo with the pull request and running cmake without any options builds normally.
Here's the log.

[100%] Linking CXX static library ../../lib/libjsoncpp.a
[100%] Built target jsoncpp_static
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /home/george/.local/share/ps2dev/ps2sdk/ports/lib/pkgconfig/jsoncpp.pc
-- Installing: /home/george/.local/share/ps2dev/ps2sdk/ports/lib/cmake/jsoncpp/jsoncpp-targets.cmake
-- Installing: /home/george/.local/share/ps2dev/ps2sdk/ports/lib/cmake/jsoncpp/jsoncpp-targets-relwithdebinfo.cmake
-- Installing: /home/george/.local/share/ps2dev/ps2sdk/ports/lib/cmake/jsoncpp/jsoncppConfigVersion.cmake
-- Installing: /home/george/.local/share/ps2dev/ps2sdk/ports/lib/cmake/jsoncpp/jsoncppConfig.cmake
-- Installing: /home/george/.local/share/ps2dev/ps2sdk/ports/lib/cmake/jsoncpp/jsoncpp-namespaced-targets.cmake
-- Installing: /home/george/.local/share/ps2dev/ps2sdk/ports/lib/libjsoncpp.a
-- Installing: /home/george/.local/share/ps2dev/ps2sdk/ports/include/json/allocator.h
-- Installing: /home/george/.local/share/ps2dev/ps2sdk/ports/include/json/assertions.h
-- Installing: /home/george/.local/share/ps2dev/ps2sdk/ports/include/json/config.h
-- Installing: /home/george/.local/share/ps2dev/ps2sdk/ports/include/json/forwards.h
-- Installing: /home/george/.local/share/ps2dev/ps2sdk/ports/include/json/json.h
-- Installing: /home/george/.local/share/ps2dev/ps2sdk/ports/include/json/json_features.h
-- Installing: /home/george/.local/share/ps2dev/ps2sdk/ports/include/json/reader.h
-- Installing: /home/george/.local/share/ps2dev/ps2sdk/ports/include/json/value.h
-- Installing: /home/george/.local/share/ps2dev/ps2sdk/ports/include/json/version.h
-- Installing: /home/george/.local/share/ps2dev/ps2sdk/ports/include/json/writer.h
CMake Warning:
  Ignoring extra path from command line:

   "/home/george/Repos/emu_repos/ps2dev/build/ps2sdk-ports/build/theora/build"


CMake Warning:
  Ignoring extra path from command line:

   "."


-- The C compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/george/.local/share/ps2dev/ee/bin/mips64r5900el-ps2-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at CMakeLists.txt:7 (FIND_PACKAGE):
  Could not find a configuration file for package "Ogg" that is compatible
  with requested version "".

  The following configuration files were considered but not accepted:

    /usr/lib/cmake/Ogg/OggConfig.cmake, version: 1.3.5 (64bit)



-- Configuring incomplete, errors occurred!

@AKuHAK
Copy link
Contributor

AKuHAK commented Apr 27, 2023

sudo pacman -S libogg
doesnt help?

@gioan777
Copy link
Contributor Author

Nope. I already had libogg installed. Also installed libogg-lib32 just in case, but unfortunately it didn't help.

@AKuHAK
Copy link
Contributor

AKuHAK commented Apr 27, 2023

I am not sure, if this is really related to ps2sdk-ports, probably you should post it here: xiph/theora#14

@gioan777
Copy link
Contributor Author

gioan777 commented Apr 27, 2023

That's what I thought as well, but git pulling the relevant repo pull request and manually cmake .. and make worked without any issue, so I figured it's either an issue with my system or the build script's cmake parameters.
Still it's more likely I did something wrong with my system, I'm currently double checking.

@gioan777
Copy link
Contributor Author

gioan777 commented Apr 27, 2023

So after testing in two VMs (Arch Linux, where it had the same error and Ubuntu 22.04 LTS where it worked flawlessly) I discovered the culrpit is cmake.
The key seems to be the warnings, specifically

CMake Warning:
  Ignoring extra path from command line:

   "/home/george/Repos/emu_repos/ps2dev/build/ps2sdk-ports/build/theora/build"


CMake Warning:
  Ignoring extra path from command line:

   "."

For whatever reason, the cmake in Arch Linux (version 3.26.3) ignores all local cmake config files and tries to find the system ones, even if I removed the OggConfig from my system it wouldn't search the local directory and it would produce the following error

CMake Error at CMakeLists.txt:7 (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.

, whereas Ubuntu's cmake (version cmake 3.16.3) doesn't produce the same warning and works flawlessly.
Probably adding some extra parameter in the script for cmake would fix the error, but I don't know very well how cmake works.

Edit: So I tried to compile the repo with binaries straight from cmake's website (ver 3.26.3) and it works in Ubuntu normally though now the warnings appear as well. In Arch Linux I still have the error with Ogg. I'm at a loss on what could be causing this. I didn't even have the libogg-dev package installed in Ubuntu when I built it.

Edit 2: Found a workaround/solution

For some reason even if it's literally the same executable cmake's FIND_PACKAGE behavior is different between Ubuntu and Arch. Both try to search $PS2SDK (it's included in $PATH) but for some reason only in Ubuntu it searches one layer deeper i.e. $PS2SDK/ports where it finds the rest of the path "lib/cmake/Ogg/OggConfig.conf". In Arch it only searches $PS2SDK and then it gives up.

Specifying $PS2SDK/ports by adding the following cmake parameter
"-DCMAKE_PREFIX_PATH=$PS2SDK/ports"
in the build-cmake script solves the issue and ps2sdk-ports compiles normally under Arch.

Sry for the spamming.

@AKuHAK
Copy link
Contributor

AKuHAK commented Apr 28, 2023

I think that you can provide the PR. This modification is safe for another platforms, so it will not break anything.

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

Successfully merging a pull request may close this issue.

2 participants