samedi 6 mars 2021

Building Boost 1.75 Issue in CentOS7 with an Already Installed C++11 Compiler

I am trying to build boost 1.75 in CentOS7.

gcc and C++ were updated to version 9.3.1 and c++14, respectively with the following shell scripts.

script_update_gcc.sh

sudo yum -y install centos-release-scl
sudo yum -y install devtoolset-9-gcc*
source scl_source enable devtoolset-9
gcc --version
# gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)

script_update_c++.sh

sudo yum -y install centos-release-scl-rh
sudo yum-config-manager --enable centos-release-scl-rh
sudo yum -y install devtoolset-9
source scl_source enable devtoolset-9

The script that I am using to build boost from source is as follows.

wget https://dl.bintray.com/boostorg/release/1.75.0/source/boost_1_75_0.tar.gz
tar -xzf boost_1_75_*
cd boost_1_75_*
sudo ./bootstrap.sh --prefix=/opt/boost 
sudo ./b2 install --prefix=/opt/boost --with=all

However, I receive the following error message

A C++11 capable compiler is required for building the B2 engine.
Toolset 'cxx' does not appear to support C++11.

** Note, the C++11 capable compiler is _only_ required for building the B2
** engine. The B2 build system allows for using any C++ level and any other
** supported language and resource in your projects.


You can specify the toolset as the argument, i.e.:
    ./build.sh gcc

Toolsets supported by this script are:
    acc, clang, como, gcc, intel-darwin, intel-linux, kcc, kylix, mipspro,
    pathscale, pgi, qcc, sun, sunpro, tru64cxx, vacpp

I tried ./build.sh gcc but the file does not exits in the source folder. Could someone kindly help me out? I already have c++ and gcc updated to very recent versions and I don't know why boost complains about not having a c++11 capable compiler.

Aucun commentaire:

Enregistrer un commentaire