Gabriel Fair
Gabriel Fair

Reputation: 4274

how to install C++14 on RHEL 7.4

My question is similar to how to install gcc 4.9.2 on RHEL 7.4

But I'm trying to get C++14 support on Red Hat 7 so I can install mapnik.

I've tried: # yum-config-manager --enable rhel-server-rhscl-7-rpms

Install gcc, g++ version 4.9.2 : # yum install devtoolset-3-gcc-c++

Enabling gcc-4.9, g++-4.9 : $ scl enable devtoolset-3 bash

But I keep getting

C++ compiler does not support C++14 standard (-std=c++14), which is required. Please upgrade your compiler

Upvotes: 0

Views: 16979

Answers (2)

Gabriel Fair
Gabriel Fair

Reputation: 4274

The issue is that devtoolset-3 contains the c++11 standard. Making and installing GCC from source caused two GCC versions to exist together. The default being the c++11 version. In order to get the correct version of gcc I needed to install devtoolset-7 and make sure devtoolset-3 was superseded or removed.

Here is how I enabled it:

1. Install a package with repository for your system:

On RHEL, enable RHSCL repository for your 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

Upvotes: 7

OriBS
OriBS

Reputation: 732

You can download GCC sources and build it.

Generally the process involve:

  1. Download tar.gz with GCC source code, from here: https://ftp.gnu.org/gnu/gcc/
  2. Configure, Make and install. You can look for documentation in their site on how to do it, specifically you can start here: https://gcc.gnu.org/wiki/InstallingGCC

Upvotes: 0

Related Questions