0

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

cpplearner
  • 13,776
  • 2
  • 47
  • 72
Gabriel Fair
  • 4,081
  • 5
  • 33
  • 54
  • 1
    Simply install from sources. configure, make, make install... – Klaus Nov 10 '17 at 12:49
  • You keep getting that message when? Are you specifically running the installed `g++`? Or are you just running your distro's default? Anyway, see the documentation on which versions of `g++` support which parts of which standards: https://gcc.gnu.org/projects/cxx-status.html Version 4.9 is not necessarily sufficient for your needs, as its C++14 implementation is incomplete. – underscore_d Nov 10 '17 at 13:29

2 Answers2

6

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

Gabriel Fair
  • 4,081
  • 5
  • 33
  • 54
0

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
OriBS
  • 722
  • 5
  • 9