Issue
I'm trying to compile boost(as part of another library installation) but it reports to me that my gcc is broken.
when I run cmake I get
-- The C compiler identification is unknown
-- The CXX compiler identification is GNU 4.7.2
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (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/lecopivo/code/bempp-inst/bempp/build/contrib/boost/build/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make "cmTryCompileExec3895803733/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec3895803733.dir/build.make
CMakeFiles/cmTryCompileExec3895803733.dir/build
make[1]: Entering directory
`/home/lecopivo/code/bempp-inst/bempp/build/contrib/boost/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report
/home/lecopivo/code/bempp-inst/bempp/build/contrib/boost/build/CMakeFiles/CMakeTmp/CMakeFiles
1
Building C object
CMakeFiles/cmTryCompileExec3895803733.dir/testCCompiler.c.o
/usr/bin/gcc -m64 -O3 -march=native (Default on Linux) -o
CMakeFiles/cmTryCompileExec3895803733.dir/testCCompiler.c.o -c
/home/lecopivo/code/bempp-inst/bempp/build/contrib/boost/build/CMakeFiles/CMakeTmp/testCCompiler.c
/bin/sh: 1: Syntax error: "(" unexpected
make[1]: *** [CMakeFiles/cmTryCompileExec3895803733.dir/testCCompiler.c.o]
Error 2
make[1]: Leaving directory
`/home/lecopivo/code/bempp-inst/bempp/build/contrib/boost/build/CMakeFiles/CMakeTmp'
make: *** [cmTryCompileExec3895803733/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:28 (project)
-- Configuring incomplete, errors occurred!
I really do not know what might be wrong. When I make my own cmake project in C I have no problems compiling it.
Solution
The error you are getting is not from gcc
but from /bin/sh
, there is no sign that the problem is actually with gcc itself.
/usr/bin/gcc -m64 -O3 -march=native (Default on Linux) -o
CMakeFiles/cmTryCompileExec3895803733.dir/testCCompiler.c.o -c
/home/lecopivo/code/bempp-inst/bempp/build/contrib/boost/build/CMakeFiles/CMakeTmp/testCCompiler.c
/bin/sh: 1: Syntax error: "(" unexpected
Is this value (Default on Linux)
something that you have entered somewhere?
Answered By - Håkan Lindqvist Answer Checked By - Mildred Charles (WPSolving Admin)