我想编译boost(作为另一个库安装的一部分),但它向我报告我的gcc已损坏。bash错误,同时用cmake编译提升
当我运行cmake我得到
-- 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!
我真的不知道什么可能是错误的。当我在C中创建自己的cmake项目时,我没有编译它的问题。
值得一提的是'Boost.CMake'并不是通常的建设方式。通常我们使用'Boost.Build'系统。参见[www.boost.org:入门](http://www.boost.org/doc/libs/1_55_0/more/getting_started/unix-variants.html)。另外,你的编译器[有点过时]。(http://www.gnu.org/software/gcc/releases.html)这些都不是问题,但可能会让你的生活更加困难。至于CMake,你显然有这样的问题:'/ usr/bin/gcc -m64 -O3 -march = native(在Linux上是默认的)......' – Drop