Cmake with gcc does not recognise -quiet option / swipl 9.2.9

I have Amazon Linux and I’m trying to build swipl-9.2.9 from source, but the cmake package uses a -quiet option which is not supported by the GNU c/cpp compiler.
CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:62 (message):
The C++ compiler

"/usr/bin/gcc"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /home/ec2-user/swipl-9.2.9/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_f0c4e/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_f0c4e.dir/build.make CMakeFiles/cmTC_f0c4e.dir/build
gmake[1]: Entering directory '/home/ec2-user/swipl-9.2.9/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_f0c4e.dir/testCXXCompiler.cxx.o
/usr/bin/gcc    -o CMakeFiles/cmTC_f0c4e.dir/testCXXCompiler.cxx.o -c /home/ec2-user/swipl-9.2.9/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
cc1plus: error: unrecognized command-line option ‘-quiet’

Is there any way to remove this -quiet option ? I don’t want to have put a wrapper around gcc to ignore it.

Is this a very old version is gcc? Surely SWI-Prolog does not set a --quiet itself, so this must be something between cmake and gcc.

Not entirely sure which gcc version is required, but you do need a version with C11 support for recent SWI-Prolog versions.

You could also try clang. It does produce significantly slower code for SWI-Prolog though (~30%)

Actually its the latest version on the latest o/s. I suspect your suggestion of cmake with gcc may highlight an incompatibility, gcc probably works with with gmake… which you don’t use, so clang may be the only solution. Besides that, I could move to Ubuntu and use the PPA version, which I know works.

Which versions (gcc --version, cmake --version)? Could it be that gcc is not really gcc (as for example on MacOS, where it is Apple-clang)?

gmake is something different. Cmake is (despite the name) not a “make” dialect. It is a replacement of the GNU autotools, i.e., a tool that inspects the environment and generates a “make file”, though I prefer ninja these days for faster building with less noise on your terminal. If cmake cannot work with gcc on some platform there is something pretty wrong with it … I can barely imagine that could be the case on any Linux distribution.

Surely building on Ubuntu works fine and the PPAs are nice too :slight_smile:

1 Like