Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when bootstrapping CMake:Log of errors

Tags:

linux

cmake

To install charmm program I have to install CMake, however, it doesn't install 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

so I tried to that script

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

But it still occurred same error.

I searched other ways in google. I found this two ways.

$ 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.

But it is not solve my problem.

(And I saw cmake_bootstrap.log but I don't know what is wrong.)


(Edit) Thank you all!

OS version : 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) Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[sohyeon@theochem11 cmake-3.15.3]$ g++ --version g++ (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4) Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

like image 327
sohyeon Avatar asked Oct 24 '25 12:10

sohyeon


1 Answers

cmake-3.15.3 can do bootstrap with g++ versions 6.3 .. 9.2 . ... Earlier g++ versions like 4.9 or 5.3 are failing.


RHEL 6, install 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/

Five packages only are installed, with '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

Packages 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

Note : The command scl enable devtoolset-7 bash is valid for the current terminal session only.


P.S. : cmake3 is available from the EPEL repo https://fedoraproject.org/wiki/EPEL → sudo yum install cmake3 . You get cmake3-3.6.1-3.el6.x86_64 . Provides /usr/bin/cmake3

Epel packages https://dl.fedoraproject.org/pub/epel/6/x86_64/Packages/


Ref. comment

Is there any other way than using yum?

The rpm command can be used to install downloaded packages : Root password is required. Examples ...

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

rpm -Uvh <package>.rpm <package>.rpm  <package>.rpm <package>.rpm <package>.rpm 
like image 76
Knud Larsen Avatar answered Oct 27 '25 02:10

Knud Larsen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!