【问题标题】:Error when bootstrapping CMake:Log of errors引导 CMake 时出错:错误日志
【发布时间】:2020-01-20 08:29:32
【问题描述】:

要安装 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

但还是出现同样的错误。

我在谷歌搜索了其他方式。我找到了这两种方法。

$ 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 (红帽 4.4.6-4) 版权所有 (C) 2010 Free Software Foundation, Inc. 这是免费软件;查看复制条件的来源。没有 保修单;甚至不是为了适销性或特定用途的适用性。

[sohyeon@theochem11 cmake-3.15.3]$ g++ --version g++ (GCC) 4.4.6 20120305 (红帽 4.4.6-4) 版权所有 (C) 2010 Free Software Foundation, Inc. 这是免费软件;查看复制条件的来源。没有 保修单;甚至不是为了适销性或特定用途的适用性。

【问题讨论】:

  • 询问您的系统管理员安装了哪些开发工具(至少 cmake 和 clang/g++)(如果有)以及如何将它们纳入范围。也许它就像以某种方式更新您的 $PATH 变量一样简单。
  • »» 找不到同时支持 C++11 和指定 C++ 标志的 C++ 编译器««:请编辑您的问题以包括操作系统名称和版本、gcc/g++ 版本。然后您将获得有关可以构建 Cmake 的 gcc 版本的信息。

标签: linux cmake


【解决方案1】:

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


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

# 1. Install a package with repository for your system:
# On CentOS, install package centos-release-scl available in CentOS repository:
$ sudo yum install centos-release-scl

# On RHEL, enable RHSCL repository for you system:
$ sudo yum-config-manager --enable rhel-server-rhscl-7-rpms

# 2. Install the collection:
$ sudo yum install devtoolset-7

# 3. Start using software collections:
$ scl enable devtoolset-7 bash

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/


制作:

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

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


附: : 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 

【讨论】:

  • 感谢您的回答。我尝试了您的推荐,所以我在我的 linux 终端上编写代码,但它不起作用。 '[sohyeon@theochem11 ~]$ yum-config-manager --enable rhel-server-rhscl-6-rpms / 您必须是 root 才能更改 yum 配置。这句话是不是表示我的linux系统没有安装yum?
  • 要使用yum,必须输入root密码。 .... 如果您没有 Redhat 订阅,可以使用yum install [package].rpm 安装上述软件包... 也可以作为 root。
  • 除了yum还有什么办法吗?
  • 安装下载的包:查看我编辑的答案。
【解决方案2】:

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

【讨论】:

  • 最新版本是什么?
猜你喜欢
  • 2017-12-23
  • 1970-01-01
  • 2019-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-03-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多