Error when bootstrapping CMake:Log of errors - linux

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.

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

I met the same problems,you can solve it by downloading the latest version

Related

gfortran-9 installed, but getting "no Fortran compiler found" error (Ubuntu Server 18.04)

I've just installed gfortran-9 on Ubuntu Server 18.04 as follows:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gfortran-9
I've been able to confirm that gfortran-9 is working correctly by compiling and running a simple 'Hello World' program.
I'm now trying to install PyPROSAIL as follows:
sudo -H pip3 install pyprosail
... but I'm receiving the following error:
error: extension 'PyPROSAIL._prosail_model' has Fortran sources but no Fortran compiler found
gfortran-9 --version shows me the following:
GNU Fortran (Ubuntu 9.2.1-17ubuntu1~18.04.1) 9.2.1 20191102
Copyright (C) 2019 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.
whereis gfortran-9 shows me the following:
gfortran-9: /usr/bin/gfortran-9 /usr/share/man/man1/gfortran-9.1.gz
Why is gfortran-9 apparently not being found? Do I need to manually set a path to gfortran-9 somewhere?
In case anyone else is having the same issue, I was able to solve this by installing a different Fortran compiler - gfortran:
sudo apt-get install gfortran

How to install gcc8 using devtoolset-8-gcc

I am using CentOS Linux release 7.3.1611 which has gcc 4.8.5 20150623 installed. I am looking for a way to install a newer version of gcc, specially 8.1. I found the following site on how to install gcc v7 link 1 which describes how to install gcc v7 (using devtoolset-7-gcc*). I did follow the guidelines and was able to install gcc v7. Though, if I followed the same procedure, but used "devtoolset-8-gcc*" instead the return message states "No package devtoolset-8-gcc* available.".
Performed a search and found a page called "Information for build devtoolset-8-gcc-8.1.1-4.el6" link 2, but not sure how to install this. I believe I would need to download the rpm source, compile/build the source, then finally install it.
Basically, I am looking for a easy way to install gcc v8 just like using the method described on link 1.
Thanks in advance.
To install the full tools-set including gfortran on centos 7:
yum install centos-release-scl
yum install devtoolset-8
scl enable devtoolset-8 -- bash
enable the tools:
source /opt/rh/devtoolset-8/enable
you may wish to put the command above in .bash_profile
ref:
https://unix.stackexchange.com/questions/477360/centos-7-gcc-8-installation
devtoolset-8 was only released a short while ago. The linked installation instructions may be of use. However, your question pertains to CentOS, and this does not yet appear to have been made available yet. You can see some evidence of it being build for CentOS here, but it's not been updated for the final release yet.
You could ask on the SCL mailing list for an ETA, or wait until it appears in its final form. In the meantime, you could download the RPMs from koji directly.
The follows worked in centos/rhel 7.
How to install it?
# rpm -ivh http://mirror.centos.org/centos/7/extras/x86_64/Packages/centos-release-scl-rh-2-3.el7.centos.noarch.rpm
# yum install devtoolset-8
Here is the rpm from http://mirror.centos.org/centos/7/extras/x86_64/Packages/ that might be needed to be updated accordingly.
How to use it?
$ scl enable devtoolset-8 bash
$ gcc --version
gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
Copyright (C) 2018 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.
The flags -std=c++17 -lstdc++fs and the following line could be helpful.
#include <experimental/filesystem>

how to install gcc 4.9.2 on RHEL 7.4

I am trying to install gcc and g++ 4.9.2 on Linux. I'm pretty new with Linux and i saw some guides of how to install, but each time I encountered with another problem. I don't have any gcc right now on my machine.
my Linux version is:
Red Hat Enterprise Linux Server release 7.4 (Maipo)
can someone help me and give me instructions from the beginning to the end how to do this properly?
thank you very much.
yum install centos-release-scl-rh
yum install devtoolset-3-gcc devtoolset-3-gcc-c++
update-alternatives --install /usr/bin/gcc-4.9 gcc-4.9 /opt/rh/devtoolset-3/root/usr/bin/gcc 10
update-alternatives --install /usr/bin/g++-4.9 g++-4.9 /opt/rh/devtoolset-3/root/usr/bin/g++ 10
For installing the system compilers gcc, g++, the install command is # yum install gcc-c++ → Provides version 4.8.5 : /usr/bin/{ gcc, g++ }.
Other options: 1. gcc53-c++-5.3.0-1.el6.x86_64.rpm → https://drive.google.com/file/d/0B7S255p3kFXNRm9FVnZYUnhyZzg/view?usp=sharing&resourcekey=0-1N6zQa6Sbl_WycG1O9I7JA : Download and install : # cd Downloads/ && yum install ./gcc53-c++-5.3.0-1.el6.x86_64.rpm ..... Provides /usr/bin/{gcc53, g++53}.
The devtoolset´s : https://www.softwarecollections.org/en/scls/rhscl/devtoolset-6/ →
# yum-config-manager --enable rhel-server-rhscl-7-rpms
Install gcc, g++ version 4.9.2 : # yum install devtoolset-3-gcc-c++
Note : You can have as many gcc/g++ versions as you want, installed at the same time. ( The system compilers are a must.)
gcc49-c++-4.9.3-1.el6.x86_64.rpm https://drive.google.com/file/d/1Pwq1ua80dGM72i7rpDNAIIdfcR1WK-hG/view?usp=sharing → Provides /usr/bin/{gcc49, g++49}.
gcc63-c++-6.3.0-1.el7.x86_64.rpm https://drive.google.com/file/d/1t4WrgvpEP-6_NN3qMJhz9MS3CJhHrHKc/view?usp=sharing → Provides /usr/bin/{gcc63, g++63}.
gcc45-c++-4.5.4-1.el7.x86_64.rpm https://drive.google.com/file/d/15aRg-BPhuyaEyZA9Jy-iAyC21_pwN7nD/view?usp=sharing → Provides /usr/bin/{gcc45, g++45, gfortran45}
gcc42-c++-4.2.4-1.el6.x86_64.rpm https://drive.google.com/file/d/1eYWk6Nd63xeqqAUoJldNWRuwEGO6cAyv/view?usp=sharing → Provides /usr/bin/{gcc42, g++42}
gcc73-c++-7.3.0-1.el7.x86_64.rpm
https://drive.google.com/file/d/1PgwCP5tu8D0EJbJVTqJd7Vg8dJ4l4noi/view?usp=sharing → Provides /usr/bin/{gcc73, g++73}
gcc48-c++-4.8.5-1.el6.x86_64.rpm
https://drive.google.com/file/d/1w6fW6oSflDDYZt_cOpGj3QMEmzUC8Q9L/view?usp=sharing → Provides /usr/bin/{gcc48, g++48, gfortran48}
gcc84-c++-8.4.0-1.el7.x86_64.rpm https://drive.google.com/file/d/1xgFtsiDi2uiB1B0AcOaSpxVizzET-pJf/view?usp=sharing → Provides /usr/bin/{gcc84, g++84, gfortran84}
RHEL comes with preconfigured repo, you can search for the desired packages and install them using yum package manager.
To do so, first run ( to search gcc )
$ sudo yum search gcc
which will show you a list of available packages with the matching name
============================ Name Exactly Matched: gcc =============================
gcc.x86_64 : Various compilers (C, C++, Objective-C, ...)
gcc.x86_64 : Various compilers (C, C++, Objective-C, ...)
gcc.i686 : Various compilers (C, C++, Objective-C, ...)
=========================== Name & Summary Matched: gcc ============================
gcc-c++.x86_64 : C++ support for GCC
gcc-c++.i686 : C++ support for GCC
gcc-gdb-plugin.x86_64 : GCC plugin for GDB
gcc-gdb-plugin.i686 : GCC plugin for GDB
gcc-gdb-plugin.x86_64 : GCC plugin for GDB
gcc-objc.x86_64 : Objective-C support for GCC
...
Install the package you need by running ( to install gcc-c++ )
$ sudo yum install gcc-c++
It will the packages to be installed and ask for confirmation.
Dependencies resolved.
====================================================================================
Package Architecture Version Repository Size
====================================================================================
Installing:
gcc-c++ x86_64 8.3.1-2.fc29 updates 12 M
Transaction Summary
====================================================================================
Install 1 Package
Total download size: 12 M
Installed size: 29 M
Is this ok [y/N]:
NOTE: Steps mentioned above will install latest available version of the package.
Install a particular Version of a Package
Install all development tools
For CentOS run this command
yum install gcc-c++

Uninstalling gcc

I want to uninstall my gcc by terminal. When I type
gcc --version
The output is
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 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.
Could anyone help me? How can I install the last version of gcc after that?
Use the following command (Replace <version> with the appropriate version):
sudo apt-get --purge remove gcc-<version>
You can install a specific version of a program using apt, you can use the following command. (Replace <version> with the appropriate version)
sudo apt-get install gcc=<version>
Alternatively, you can use Synaptic Package Manager.
sudo apt-get update
sudo apt-get install synaptic
Note that, you might need GCC for some programs. If you face any driver issues while installing programs / drivers you can install the latest GCC by using:
sudo apt-get install gcc

How to upgrade GCC from 4.x.x to GCC 5.x.x in RHEL?

My current version of GCC:
gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)
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.
How to upgrade the GCC to 5.X.X
(As you have GCC 4.4.7, I assume you're running RHEL 6.x, hopefully 6.9, the latest released version.)
On RHEL 6 & 7, you can use Red Hat Developer Toolset (DTS) to install new(er) versions of various components, including GCC. DTS uses the 'software collection' packaging method, so the new version will be installed alongside the default version -- without creating any conflicts -- and you'll be able to user both.
If you require GCC 5.x, you will need to use DTS 4.x, which includes this version. If you just want a new version, then I would recommend using the newest DTS available, which is 6.1 (or the just released 7.0 beta), which include GCC 6.x and 7.x respectively.
See Documentation for Red Hat Developer Toolset for instructions on how to install and use DTS.
TL;DR:
# subscription-manager repos --enable rhel-server-rhscl-6-rpms
# subscription-manager repos --enable rhel-6-server-optional-rpms
# yum -y install devtoolset-6-gcc
$ scl enable devtoolset-6 'gcc -o output_file source_file...'
(Note that support for DTS 4.x ends in Nov 2017, so using the newest version is really recommended.)

Resources