Another error compiling darktable from git

I have some trouble since a week or so to compile the latest darktable from git. Any ideas what could be the reason for the following compiling error?

[ 13%] Built target rawspeed_parsers
[ 13%] Building CXX object lib64/darktable/rawspeed/src/librawspeed/decompressors/CMakeFiles/rawspeed_decompressors.dir/PentaxDecompressor.cpp.o
during GIMPLE pass: vect
/home/det/darktable/src/external/rawspeed/src/librawspeed/decompressors/PentaxDecompressor.cpp: In static member function 'static rawspeed::HuffmanCode<rawspeed::BaselineCodeTag> rawspeed::PentaxDecompressor::SetupPrefixCodeDecoder_Modern(rawspeed::ByteStream)':
/home/det/darktable/src/external/rawspeed/src/librawspeed/decompressors/PentaxDecompressor.cpp:81:1: internal compiler error: Segmentation fault
   81 | PentaxDecompressor::SetupPrefixCodeDecoder_Modern(ByteStream stream) {
      | ^~~~~~~~~~~~~~~~~~
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <> for instructions.

I’m using Linux Fedora Rawhide. Perhaps the gcc version is the reason?

gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,m2,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/sh
are/info --with-bugurl= --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --ena
ble-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace --with-
libstdcxx-zoneinfo=/usr/share/zoneinfo --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-14.0.1-20240127/obj-x
86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none,amdgcn-amdhsa --enable-offload-defaulted --without-cuda-driver --enable-gnu-indirect-function --ena
ble-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240127 (Red Hat 14.0.1-0) (GCC)

The error messages is

internal compiler error: Segmentation fault

That’s a GCC error, possibly not an error in the source code. Even if it is an error in the source code, the compiler should not stop with a segmentation fault…
Trying another GCC version (>=12, iirc) could work.
And of course, following the suggestion in the message you gave to create a bug report for redhat or gcc would be good as well. Note that GCC 14 is listed as a development version

1 Like

Fedora Rawhide is not very stable, it is a test bed for the next stable version. If you want to use it as your daily driver be prepared for (sometimes) broken software.

If someone runs into the same trouble, I found at least a simple work around to compile the git version with gcc 14.x:

  1. the compiler flags ‘-O3’ need to replaced by ‘-O2’ in $HOME/darktable/build/CMakeCache.txt
  2. run ‘ccmake .’
  3. configure and generate
  4. make -j32 && make install
  5. done

Looks like gcc14 is even more broken than usual for GCC’s.
Just use clang, you’ll get better performance, too.

Thanks, I would love to - but how to use clang instead of gcc? Any howto’s, tips and tricks?

Install clang package, and do CC=clang CXX=clang++ ./ i guess.

1 Like

Indeed, it works. Thanks for this.