CMake Error at CMakeLists.txt:7 (project)

Last year I have been very busy with other activities, hence I didn’t have much time to continue with my Prolog/C++ project. Hopefully the next future will be more quiet so I can pickup programmig again.

I recently bought a new laptop, installed Fedora 43 and after installing all the prerequisites I am trying to install the lates version of SWIPL. I followed these instructions: https://www.swi-prolog.org/build/unix.html . But the command cmake -DCMAKE_INSTALL_PREFIX=$HOME -DCMAKE_BUILD_TYPE=PGO -G Ninja .. results in an error, complaining that it cannot find a c++ compiler.

is this a known problem? And how can I fix this (which file should be edited)?

Are you sure you have installed a C++ compiler?

To my knowlwedge C and C++ have always default been installed in Fedora.

gcc –version returns gcc (GCC) 15.2.1 20251111 (Red Hat 15.2.1-4)

How about

$ g++ --version

??

Just upgraded to Fedora 43 and I can confirm the system builds completely clean. Not being able to detect a C++ compiler is either a missing package or some other weird local problem. Nothing SWI-Prolog can do anything about.

g++ (GCC) 15.2.1 20251111 (Red Hat 15.2.1-4)

The new laptop has a clean install from Fedora 43. My old laptop has an upgrade form 42 → 43.

I’ll try to upgrade swipl on that machine also and see what happens there.

EDIT

I added SDL3-devel package, pulled the new code, updated submodules, cd’d into build and entered the cmake command. On the old machine this command executes!

ninja aborts, complaining that it can not find java-21-openjdk-21.0.3.0.9-1

I’ll try to change that into java-latest-openjdk

Maybe the problems on the new machine are caused by new CMake?

EDIT 2

On the old laptop I renamed swipl-devel to swipl-devel_bak. Then I edited .bashrc to enter Java environment variables for JAVA_HOME and LD_LIBRARY_PATH.

After cloning swipl I started the compile/build procedure which executed without problems. If I have enough time, I’ll do the same on myn new laptop.

EDIT 3

After creating the environment variables for Java on the new machine, I tried again to execute the cmake command. This command reproduced the same error:

– The C compiler identification is unknown
– The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:7 (project):
The CMAKE_C_COMPILER:

/usr/lib64/ccache/cc

is not a full path to an existing compiler tool.

I renamed swipl-devel to swipl-devel.bak and create a new clone. This time there were no problems.

I checked CMakefiles.txt in both development branches and they are identical so I have no idea what causes the compiulation error.