csympy cmake错误:编译器不支持C ++ 11结构

时间:2015-03-18 00:42:12

标签: python c++ c++11 sympy

sudo apt-get install cmake libgmp-dev
sudo cmake .
sudo make

我尝试使用上面的说明从gitub安装csympy。

running install
running build
-- The CXX compiler identification is unknown
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
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:4 (PROJECT)


CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
CMake Error at CMakeLists.txt:38 (message):
  Compiler does not support C++11 constructs

  CXX11 ERROR LOG :


-- Configuring incomplete, errors occurred!
See also "/home/user/Downloads/csympy-master/CMakeFiles/CMakeOutput.log".
See also "/home/user/Downloads/csympy-master/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "setup.py", line 118, in <module>
    'install' : InstallWithCmake,
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "setup.py", line 99, in run
    _install.run(self)
  File "/usr/lib/python2.7/distutils/command/install.py", line 601, in run
    self.run_command('build')
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "setup.py", line 69, in run
    cmake_build()
  File "setup.py", line 39, in cmake_build
    raise EnvironmentError("error calling cmake")
EnvironmentError: error calling cmake

但是我在cmake期间收到了上述错误。我检查了我安装了gcc-4.8的突触。

cmake -std=c++0x .
cmake -std=c++11 .

我强制cmake使用上面的以下编译器,但是我收到错误消息,指出指定的源目录不存在。编译csympy cmake时我缺少什么?

1 个答案:

答案 0 :(得分:2)

您缺少C ++编译器。安装g ++

sudo apt-get install g++

之后,您需要清理回购git clean -dfx并再次运行cmake .python setup.py install