complexlogic / rsgain

A simple, but powerful ReplayGain 2.0 tagging utility
Other
289 stars 21 forks source link

Cannot build on RPiOS #133

Closed gearhead closed 6 days ago

gearhead commented 6 days ago

Trying to build form source as rsgain is not available for install on rpios in either 32 or 64 bit flavors. I was previously able to build v3.5 without issue but cannot build v3.5.2. My build command is (stolen form the Arch AUR):

  cmake -B build -S rsgain-3.5.2 \
        -DUSE_STD_FORMAT=ON \
        -DCMAKE_INSTALL_PREFIX=/usr
  cmake --build build

and the response I get is:

-- The CXX compiler identification is GNU 12.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/distcc/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for include files format, print
-- Looking for include files format, print - not found
CMake Error at CMakeLists.txt:47 (message):
  You do not have the required system headers for std::format and/or
  std::print

-- Configuring incomplete, errors occurred!

The log shows this:

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_d763c/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_d763c.dir/build.make CMakeFiles/cmTC_d763c.dir/build
gmake[1]: Entering directory '/Rune_dev/RuneOS/rpios_packages/rsgain/src/build/CMakeFiles/CMakeScratch/TryCompile-jor4C4'
Building CXX object CMakeFiles/cmTC_d763c.dir/SUPPORT_STD_FORMAT.cpp.o
/usr/lib/distcc/c++   -march=armv8-a -O2 -pipe -fstack-protector-strong -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -Wp,-D_GLIBCXX_ASSERTIONS  -std=gnu++20 -o CMakeFiles/cmTC_d763c.dir/SUPPORT_STD_FORMAT.cpp.o -c /Rune_dev/RuneOS/rpios_packages/rsgain/src/build/CMakeFiles/CMakeScratch/TryCompile-jor4C4/SUPPORT_STD_FORMAT.cpp
/Rune_dev/RuneOS/rpios_packages/rsgain/src/build/CMakeFiles/CMakeScratch/TryCompile-jor4C4/SUPPORT_STD_FORMAT.cpp:2:10: fatal error: format: No such file or directory
    2 | #include <format>
      |          ^~~~~~~~
compilation terminated.

How can I get this to compile on RPiOS?

complexlogic commented 6 days ago

It's because you are using -DUSE_STD_FORMAT=ON. That only works when building with GCC 14 or later. You are running GCC 12.2, so the configuration script does not find the required header and fails.

You need to use DUSE_STD_FORMAT=OFF, and make sure you have the fmt library installed (sudo apt install libfmt-dev).

gearhead commented 6 days ago

That did it. Thanks!