0
votes

When I create new project in Clion, cmake cannot find CMakeTmp directory.

Run Build Command(s):/usr/bin/cmake cmTC_df723/fast && No such file or directory

OS: Linux Mint 19 (Ubuntu based)

I have tried:

Error output:

/usr/local/bin/cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=/usr/bin/cmake -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/c++ -DCMAKE_C_COMPILER=/usr/bin/gcc -G "CodeBlocks - Unix Makefiles" /home/sacha/CLionProjects/testProject
-- The C compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/gcc
CMake Error: Generator: execution of make failed. Make command was: /usr/bin/cmake cmTC_df723/fast && 
-- Check for working C compiler: /usr/bin/gcc -- broken
CMake Error at /usr/local/share/cmake-3.15/Modules/CMakeTestCCompiler.cmake:60 (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/sacha/CLionProjects/testProject/cmake-build-release-system/CMakeFiles/CMakeTmp

 Run Build Command(s):/usr/bin/cmake cmTC_df723/fast && No such file or directory
Generator: execution of make failed. Make command was: /usr/bin/cmake cmTC_df723/fast && 

Any help or directions appreciated, thanks!

1
The first error message you got is CMake Error: Generator: execution of make failed., I would interpret it as "something wrong with your environment settings". In the argument -DCMAKE_MAKE_PROGRAM=/usr"/bin/cmake which sets make command the double quote looks very suspicious. It could be the very reason which invalidates the path to make.Tsyvarev
Sorry, that was my mistake, when editing readable output. My cmake settings have correct -DCMAKE_MAKE_PROGRAM=/usr/bin/cmake without quotation mark. I already edited the question error output, thanks for pointing it out.Sach
There is more serious problem with CMAKE_MAKE_PROGRAM parameter: it should refer to Make executable, but /usr/bin/cmake, according to its last component, refers to CMake one. These executables are definitely not interchangeable. Probably, you need /usr/bin/make instead (or just type which make and find the proper path).Tsyvarev
You are right! Thanks, that was the problem.Sach

1 Answers

1
votes

The error message

CMake Error: Generator: execution of make failed.

signals, that something wrong with CMake settings or its generator.


In the given case you have additional message

Make command was: /usr/bin/cmake cmTC_df723/fast &&

which means that cmake is run as a Make command.

This is wrong: cmake and make commands are not interchangeable.

Would you inspect the very first command line, you will find the source of that problem:

-DCMAKE_MAKE_PROGRAM=/usr/bin/cmake

Exactly it sets cmake executable for Make command. You need to fix that line (e.g. in CLion settings).