Trunk build failing with gcc version error

Howdy,

I’ve been building trunk fine until recently, Ubuntu 22.04

I get the error:

=============================================

CMake Error at src/external/rawspeed/cmake/compiler-versions.cmake:41 (message):
GNU C++ compiler version 11.3.0 is too old and is unsupported. Version 12+
is required.
Call Stack (most recent call first):
src/external/rawspeed/CMakeLists.txt:188 (include)

=============================================

GCC was indeed at v 11.3.0,

I installed the gcc-12 package,

$ gcc --version

gcc (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0

but the error persists.

Where is the reference to 11.3 coming from?

Do I need to install more v 12 packages?

Thanks,

Kent

You need to start w/ a clean build folder (the old compiler is cached by CMake).

Welcome!

1 Like

thanks for the response

ktenney@hp17:/opt/fetching/darktable$ rm -rf build/
ktenney@hp17:/opt/fetching/darktable$ ./build.sh

Make Error at cmake/compiler-versions.cmake:43 (message):
GNU C++ compiler version 11.3.0 is too old and is unsupported. Version 12+
is required.
Call Stack (most recent call first):
CMakeLists.txt:155 (include)

CMake Error at src/external/rawspeed/cmake/compiler-versions.cmake:41 (message):
GNU C++ compiler version 11.3.0 is too old and is unsupported. Version 12+
is required.
Call Stack (most recent call first):
src/external/rawspeed/CMakeLists.txt:188 (include)

I’ve been searching for where else 11.3 is cached, without success

Thanks,
Kent

You might try and set an environment variable so that GCC points to gcc12

I usually use
git clean -d -f -x
to get my local copy to a pristine state.

What does gcc --version report?

If it’s still v11, you may need some update-alternatives magic. Maybe
sudo update-alternatives --config gcc

I did a full fresh darktable repo and submodule clone,
same error, so it is coming from elsewhere …

ktenney@hp17:/opt/fetching/darktable$ gcc --version
gcc (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0

ktenney@hp17:/opt/fetching/darktable$ sudo update-alternatives --config gcc
update-alternatives: error: no alternatives for gcc

What happens if you configure manually?

git clone --recurse-submodules https://github.com/darktable-org/darktable.git
git submodule update --init

cd darktable
mkdir build/
cd build/
cmake -DCMAKE_INSTALL_PREFIX=<your-test-dir>/install -DCMAKE_BUILD_TYPE=Release  ..
make -j8
make install

cd <your-test-dir>/install/bin
./darktable

This is mentioned here:

export CC=gcc-12
export CXX=g++-12

I built and bootstrapped my own gcc 12.2.0 from gcc source, so I am not using the package system of my distro (Debian). I do not have to set CC or CXX, however I do have to source other variables before build and runtime, because of this.

the solution was found in Master wont build on Ubuntu 22,04 LTS · Issue #13943 · darktable-org/darktable · GitHub

Thanks,
Kent

Please update the link to point to the specific comment that helped you.

after the ‘update-alternatives --install’ commands
followed by
the ‘update-alternatives --config’ commands
build was successful

1 Like