CMake Error at /snap/clion/123/bin/cmake/linux/share/cmake-3.17/Modules/CMakeTestCCompiler.cmake:60 (message): The C compiler "/home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc" is not able to compile a simple test program.
I have 2 instance of CLion running. Both for STM microcontroller.
In one window I can compile with the same gcc my program in the other I receive the following error message:
/snap/clion/123/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_C_COMPILER=/home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc -DCMAKE_CXX_COMPILER=/home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-g++ -DTARGET_DEVICE=BF8 -DNOCRC=TRUE -DIGNORE_INCOMPATIBLE_HARDWARE=TRUE -G "CodeBlocks - Unix Makefiles" /home/m.wolz/Projects/elisa2/app/EC2
-- The C compiler identification is GNU 7.3.1
-- The CXX compiler identification is GNU 7.3.1
-- Check for working C compiler: /home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc
-- Check for working C compiler: /home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc - broken
CMake Error at /snap/clion/123/bin/cmake/linux/share/cmake-3.17/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"/home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/m.wolz/Projects/elisa2/app/EC2/cmake-build-debug_bf8/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_880ac/fast && /usr/bin/make -f CMakeFiles/cmTC_880ac.dir/build.make CMakeFiles/cmTC_880ac.dir/build
make[1]: Verzeichnis „/home/m.wolz/Projects/elisa2/app/EC2/cmake-build-debug_bf8/CMakeFiles/CMakeTmp“ wird betreten
Building C object CMakeFiles/cmTC_880ac.dir/testCCompiler.c.o
/home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc -o CMakeFiles/cmTC_880ac.dir/testCCompiler.c.o -c /home/m.wolz/Projects/elisa2/app/EC2/cmake-build-debug_bf8/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_880ac
/snap/clion/123/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_880ac.dir/link.txt --verbose=1
/home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc -rdynamic CMakeFiles/cmTC_880ac.dir/testCCompiler.c.o -o cmTC_880ac
arm-none-eabi-gcc: error: unrecognized command line option '-rdynamic'
CMakeFiles/cmTC_880ac.dir/build.make:106: recipe for target 'cmTC_880ac' failed
make[1]: *** [cmTC_880ac] Error 1
make[1]: Verzeichnis „/home/m.wolz/Projects/elisa2/app/EC2/cmake-build-debug_bf8/CMakeFiles/CMakeTmp“ wird verlassen
Makefile:141: recipe for target 'cmTC_880ac/fast' failed
make: *** [cmTC_880ac/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:4 (project)
-- Configuring incomplete, errors occurred!
See also "/home/m.wolz/Projects/elisa2/app/EC2/cmake-build-debug_bf8/CMakeFiles/CMakeOutput.log".
See also "/home/m.wolz/Projects/elisa2/app/EC2/cmake-build-debug_bf8/CMakeFiles/CMakeError.log".
[Failed to reload]
I attached the ErrorLog and the CMakeCache from the working and no-working controller.
I have no idea how to solve the problem
Please sign in to leave a comment.
Upload ID: 2020_08_13_3W8T92T9QTAYirz7
Hello!
In "CMakeCache_Working.txt" I see
In "CMakeCache.txt" I see
Could you please explain the situation one more time and in more detail? Why do you have two CLion instance running? Are both instances running on the same machines? Do you have the same toolchain settings in these instances? Do you open the same project in them?
Hi Anna,
we have a few STM devices in our projects. For the two controller I'm working with, I have two windows of CLion (one for MC controller the other for EC controller) running.
For debugging purpose I have one window for the called MC controller and one for the EC controller.
For each controller we have a separate cmake file.
Mc controller is working fine.
For the EC controller I get the mentioned error message.
The Toolchain is the same for both controller
Cmake: bundled Version 3.17.3
make: 7user/bin/make
C compiler /home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc
C++ compiler /home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-g++
Debugger: bundled GDB Version9.2
Only difference is, that I path different CMAKE options depending on the controller.
Both are included in the same project
projects root elisa2/app/BC controller
CC controller
EC controller
MC controller
....
PATH variables for both controller PATH /home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin:/usr/bin:
hope this help.
I reset the cmake cache of the EC controller a few times, without any change.
Is there a possbility to set the cmake_addr2Line of the window for the EC controller manuall to the correct FILEPATH?
regards Matthias
Please try adding the following lines before the project() command in your CMakeLists.txt:
Hi Anna,
sorry for my late response, but I was on parental leave.
I tried your suggestion, but it didn't solve it.
Output:
/snap/clion/123/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_C_COMPILER=/home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc -DCMAKE_CXX_COMPILER=/home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-g++ -DTARGET_DEVICE=BF8 -DNOCRC=TRUE -DIGNORE_INCOMPATIBLE_HARDWARE=TRUE -G "CodeBlocks - Unix Makefiles" /home/m.wolz/Projects/elisa2/app/EC2
-- The C compiler identification is GNU 7.3.1
-- The CXX compiler identification is GNU 7.3.1
-- Check for working C compiler: /home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc
-- Check for working C compiler: /home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc - broken
CMake Error at /snap/clion/123/bin/cmake/linux/share/cmake-3.17/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"/home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/m.wolz/Projects/elisa2/app/EC2/cmake-build-debug_bf8/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_a8111/fast && /usr/bin/make -f CMakeFiles/cmTC_a8111.dir/build.make CMakeFiles/cmTC_a8111.dir/build
make[1]: Verzeichnis „/home/m.wolz/Projects/elisa2/app/EC2/cmake-build-debug_bf8/CMakeFiles/CMakeTmp“ wird betreten
Building C object CMakeFiles/cmTC_a8111.dir/testCCompiler.c.obj
/home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc -o CMakeFiles/cmTC_a8111.dir/testCCompiler.c.obj -c /home/m.wolz/Projects/elisa2/app/EC2/cmake-build-debug_bf8/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_a8111
/snap/clion/123/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a8111.dir/link.txt --verbose=1
/home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc CMakeFiles/cmTC_a8111.dir/testCCompiler.c.obj -o cmTC_a8111
/home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): In function `exit':
exit.c:(.text.exit+0x2c): undefined reference to `_exit'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_a8111.dir/build.make:106: recipe for target 'cmTC_a8111' failed
make[1]: *** [cmTC_a8111] Error 1
make[1]: Verzeichnis „/home/m.wolz/Projects/elisa2/app/EC2/cmake-build-debug_bf8/CMakeFiles/CMakeTmp“ wird verlassen
Makefile:141: recipe for target 'cmTC_a8111/fast' failed
make: *** [cmTC_a8111/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:5 (project)
-- Configuring incomplete, errors occurred!
See also "/home/m.wolz/Projects/elisa2/app/EC2/cmake-build-debug_bf8/CMakeFiles/CMakeOutput.log".
See also "/home/m.wolz/Projects/elisa2/app/EC2/cmake-build-debug_bf8/CMakeFiles/CMakeError.log".
[Failed to reload]
Output of the CMakeOutput.log file
The target system is: Generic - 1 -
The host system is: Linux - 5.4.0-42-generic - x86_64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-gcc
Build flags:
Id flags: -c
The output was:
0
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o"
The C compiler identification is GNU, found in "/home/m.wolz/Projects/elisa2/app/EC2/cmake-build-debug_bf8/CMakeFiles/3.17.3/CompilerIdC/CMakeCCompilerId.o"
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: /home/m.wolz/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-g++
Build flags:
Id flags: -c
The output was:
0
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.o"
The CXX compiler identification is GNU, found in "/home/m.wolz/Projects/elisa2/app/EC2/cmake-build-debug_bf8/CMakeFiles/3.17.3/CompilerIdCXX/CMakeCXXCompilerId.o"
@... please also add the following lines before the project() command:
Hi Anna,
adding
I'm glad it helped!
I know this is an old post but it looks like adding the following before the project line works as well