要安装 charm 程序,我必须安装 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
Run Code Online (Sandbox Code Playgroud)
所以我尝试了那个脚本
[sohyeon@theochem11 cmake-3.15.3]$ env CC=cc CXX=CC ./bootstrap
Run Code Online (Sandbox Code Playgroud)
但它仍然出现同样的错误。
我在谷歌搜索了其他方式。我找到了这两种方法。
$ 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.
Run Code Online (Sandbox Code Playgroud)
但这并不能解决我的问题。
(我看到了 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 Free Software Foundation, Inc. 这是免费软件;请参阅复制条件的来源。没有保修;甚至不是为了特定目的的适销性或适合性。
[sohyeon@theochem11 cmake-3.15.3]$ g++ --version g++ (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4) 版权所有 (C) 2010 Free Software Foundation, Inc. 这是免费软件;请参阅复制条件的来源。没有保修;甚至不是为了特定目的的适销性或适合性。
cmake-3.15.3可以使用 g++ 版本 6.3 .. 9.2 进行引导。... 4.9 或 5.3 等早期的 g++ 版本失败了。
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
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
软件包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
Run Code Online (Sandbox Code Playgroud)
注意:该命令scl enable devtoolset-7 bash仅对当前终端会话有效。
PS:cmake3 可从 EPEL 存储库https://fedoraproject.org/wiki/EPEL 获得?yum 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
Run Code Online (Sandbox Code Playgroud)