引导CMake时发生错误:错误日志

时间:2019-09-19 10:14:24

标签: linux cmake

要安装charmm程序,我必须安装CMake,但是,它没有安装CMake。

[sohyeon@theochem11 cmake-3.15.3]$ ./bootstrap 
---------------------------------------------
CMake 3.15.3, Copyright 2000-2019 Kitware, Inc. and Contributors
Found GNU toolchain
C compiler on this system is: gcc       
---------------------------------------------
Error when bootstrapping CMake:
Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.
Please specify one using environment variable CXX.
The C++ flags are "".
They can be changed using the environment variable CXXFLAGS.
See cmake_bootstrap.log for compilers attempted.
---------------------------------------------
Log of errors: /export/home/sohyeon/cmake-3.15.3/Bootstrap.cmk/cmake_bootstrap.log

所以我尝试了该脚本

[sohyeon@theochem11 cmake-3.15.3]$ env CC=cc CXX=CC ./bootstrap

但是它仍然发生相同的错误。

我在Google中搜索了其他方式。我发现了这两种方法。

$ yum -y install gcc-c++ 
You need to be root to perform this command.

$ yum install gcc-c++.x86_64 
You need to be root to perform this command.

但这不能解决我的问题。

(而且我看到了cmake_bootstrap.log,但我不知道出了什么问题。)


(编辑) 谢谢你们!

操作系统版本:Linux theochem11.hpc.org 2.6.32-279.14.1.el6.x86_64#1 SMP Tue Nov 6 23:43:09 UTC 2012 x86_64 x86_64 x86_64 GNU / Linux

[sohyeon @ theochem11 cmake-3.15.3] $ gcc --version gcc(GCC)4.4.6 20120305(Red Hat 4.4.6-4) 版权所有(C)2010自由软件基金会公司。 这是免费软件;请参阅复制条件的来源。没有 保证;甚至不是出于适销性或针对特定目的的适用性。

[sohyeon @ theochem11 cmake-3.15.3] $ g ++ --version g ++(GCC)4.4.6 20120305(红帽4.4.6-4) 版权所有(C)2010自由软件基金会公司。 这是免费软件;请参阅复制条件的来源。没有 保证;甚至不是出于适销性或针对特定目的的适用性。

2 个答案:

答案 0 :(得分:1)

cmake-3.15.3可以使用g ++版本6.3 .. 9.2进行引导。 ...早期的4.9或5.3等g ++版本都失败了。


RHEL 6,安装gcc-c ++-7.3:

# yum-config-manager --enable rhel-server-rhscl-6-rpms
# yum install devtoolset-7-gcc-c++

https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/

仅安装了五个软件包,其中包含'yum install devtoolset-7-gcc-c ++'

devtoolset-7-gcc-c++-7.3.1-5.15.el6.x86_64
devtoolset-7-binutils-2.28-11.el6.x86_64
devtoolset-7-libstdc++-devel-7.3.1-5.15.el6.x86_64
devtoolset-7-runtime-7.1-4.el6.x86_64
devtoolset-7-gcc-7.3.1-5.15.el6.x86_64

包裹http://mirror.centos.org/centos/7/sclo/x86_64/rh/devtoolset-7/


Cmake:

cd cmake-3.15.3/
scl enable devtoolset-7 bash     // g++ is set to "7.3"
./bootstrap

注意:命令scl enable devtoolset-7 bash仅对当前终端会话有效。


P.S。 :cmake3可从EPEL存储库https://fedoraproject.org/wiki/EPELyum install cmake 3中获得。您得到cmake3-3.6.1-3.el6.x86_64。提供/usr/bin/cmake3

Epel软件包https://dl.fedoraproject.org/pub/epel/6/x86_64/Packages/


参考评论

  

除了使用yum之外,还有其他方法吗?

rpm命令可用于安装下载的软件包:需要root密码。例子...

rpm -Uvh cmake3-3.6.1-3.el6.x86_64

rpm -Uvh <package>.rpm <package>.rpm  <package>.rpm <package>.rpm <package>.rpm 

答案 1 :(得分:0)

我遇到了同样的问题,下载最新版本即可解决