Ubuntu 14.04。我正在尝试安装和构建本征(C++ 库)从源代码开始,遇到了一些 Ubuntu/GCC 配置错误。这肯定不是源代码的问题,所以我认为 StackOverflow 不是适合这个问题的网站。
我运行的命令是:
hg clone https://bitbucket.org/eigen/eigen#3.2
mkdir eigen_build && cd eigen_build
cmake . ../eigen
当我运行该cmake
命令时出现以下错误:
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Performing Test standard_math_library_linked_to_automatically
CMake 错误位于 /usr/share/cmake-2.8/Modules/CMakeCXXInformation.cmake:37 (get_filename_component):get_filename_component 调用时使用的参数数量不正确 调用堆栈(最近调用优先):CMakeLists.txt:3 (PROJECT)
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Performing Test standard_math_library_linked_to_automatically - Failed
-- Performing Test standard_math_library_linked_to_as_m
CMake Error at /usr/share/cmake-2.8/Modules/CMakeCXXInformation.cmake:37 (get_filename_component):
get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
CMakeLists.txt:3 (PROJECT)
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Performing Test standard_math_library_linked_to_as_m - Failed
CMake Error at CMakeLists.txt:75 (message):
Can't link to the standard math library. Please report to the Eigen
developers, telling them about your platform.
-- Configuring incomplete, errors occurred!
See also "/home/vagrant/eigen_build/CMakeFiles/CMakeOutput.log".
See also "/home/vagrant/eigen_build/CMakeFiles/CMakeError.log".
该文件的内容CMakeError.log
如下:
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND
Build flags:
Id flags:
The output was:
No such file or directory
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND
Build flags:
Id flags: -c
The output was:
No such file or directory
Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
Performing C++ SOURCE FILE Test standard_math_library_linked_to_automatically failed with the following output:
Source file was:
#include<cmath>
int main() { std::sin(0.0); std::log(0.0f); }
Performing C++ SOURCE FILE Test standard_math_library_linked_to_as_m failed with the following output:
Source file was:
#include<cmath>
int main() { std::sin(0.0); std::log(0.0f); }
有人能帮我解释一下这是 GCC 配置问题,还是 Eigen 的 make 出了问题吗(我高度对此感到怀疑)?
GCC 已安装(运行gcc -v
)gcc version 4.8.4
。我还知道cmake
已安装(通过运行cmake --help
)。只是不确定它是否配置正确。有任何想法吗?