What gcc versions are available in Red Hat Enterprise Linux?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 3
  • Red Hat Enterprise Linux 4
  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • Red Hat Developer Toolset (DTS)

Issue

  • What gcc versions and versions of the C++ standard runtime library are available in Red Hat Enterprise Linux?

Resolution

Primary compiler packages
  • The following gcc packages are available as the default compiler:
    • RHEL7 : gcc 4.8.x
    • RHEL6 : gcc 4.4.x
    • RHEL5 : gcc 4.1.x
    • RHEL4 : gcc 3.4.x
    • RHEL3 : gcc 3.2.x
    • DTS8 : gcc 8.2.x
    • DTS7 : gcc 7.2.x
    • DTS6 : gcc 6.2.x
    • DTS4 : gcc 5.2.x, 5.3.x
    • DTS3 : gcc 4.9.x
    • DTS2 : gcc 4.8.x
    • DTS1 : gcc 4.7.x
Compiler backward compatibility packages

Compatibility packages are available to provide build compatibility with code designed to be built under earlier releases:

  • RHEL7:
    • compat-gcc-44 (gcc 4.4.7 for compatibility with code designed to be built under RHEL6)
  • RHEL6:
    • compat-gcc-34 (gcc 3.4 for compatibility with code designed to be built under RHEL4)
  • RHEL5:
    • compat-gcc-34 (gcc 3.4 for compatibility with code designed to be built under RHEL4)
  • RHEL4:
    • compat-gcc-32 (gcc 3.2 for compatibility with code designed to be built under RHEL3)
  • RHEL3:
    • compat-gcc   (gcc-2.96.x compatible)
Runtime backward compatibility packages

Compatibility packages are available to provide runtime compatibility for binary C++ code that was built under earlier releases:

  • RHEL7:
    • compat-libstdc++-33 (g++ 3.3.x compatible)
  • RHEL6:
    • compat-libstdc++-33 (g++ 3.3 compatible)
    • compat-libstdc++-296 (g++ 2.96.x compatible)
  • RHEL5:
    • compat-libstdc++-33 (g++ 3.3 compatible)
    • compat-libstdc++-296 (g++ 2.96.x compatible)
  • RHEL4:
    • compat-libstdc++-33 (g++ 3.3 compatible)
    • compat-libstdc++-296 (g++ 2.96.x compatible)
Preview packages for forward compatibility testing

Packages of newer gcc versions may be available to facilitate testing of code for compatibility with forthcoming releases:

  • RHEL6: Refer to "Red Hat Developer Toolset" under "Comments" below.
  • RHEL5.8 and later: gcc44 (gcc 4.4, fully supported; see the release notes) . Refer to "Red Hat Developer Toolset" under "Comments" below as well.
  • RHEL5.6 and later: gcc44 (gcc 4.4, fully supported; see the release notes)
  • RHEL5.4 and later: gcc44 (gcc 4.4 Technology Preview; see the release notes)
  • RHEL5.3 and later: gcc43 (gcc 4.3 Technology Preview; see the release notes)

Comments

Using compatibility and preview gcc packages

The compatibility and preview gcc packages provide the compiler binaries under a name that incorporates the version number. For instance, to compile code on Red Hat Enterprise Linux 5.4 using the gcc 4.4 Technology Preview packages, call the compiler as gcc44. When building code that uses a "configure" script, this is best done at configure time:

# env CC=/usr/bin/gcc44 CXX=/usr/bin/g++44 ./configure ...
Red Hat Developer Toolset

Red Hat provides another option via the Red Hat Developer Toolset.

With the developer toolset, developers can choose to take advantage of the latest versions of the GNU developer tool chain, packaged for easy installation on Red Hat Enterprise Linux. This version of the GNU development tool chain is an alternative to the toolchain offered as part of each Red Hat Enterprise Linux release. Of course, developers can continue to use the version of the toolchain provided in Red Hat Enterprise Linux.

The developer toolset gives software developers the ability to develop and compile an application once to run on multiple versions of Red Hat Enterprise Linux (such as Red Hat Enterprise Linux 5 and 6). Compatible with all supported versions of Red Hat Enterprise Linux, the developer toolset is available for users who develop applications for Red Hat Enterprise Linux 5 and 6. Please see the release notes for support of specific minor releases.

Unlike the compatibility and preview gcc packages provided with RHEL itself, the developer toolset packages put their content under a /opt/rh path. The scl ("Software CoLlections") tool is provided to make use of the tool versions from the Developer Toolset easy while minimising the potential for confusion with the regular RHEL tools.

Red Hat provides support to Red Hat Developer Tool Set for all Red Hat customers with an active Red Hat Enterprise Linux Developer subscription.

You will need an active Red Hat Enterprise Linux Developer subscription to gain access to Red Hat Developer Tool set.

For further information on Red Hat Developer Toolset, refer to the relevant release documentation:
https://access.redhat.com/site/documentation/en-US/Red_Hat_Developer_Toolset/.

For further information on Red Hat Enterprise Linux Developer subscription, you may reference the following links:
* Red Hat Discussion
* Red Hat Developer Toolset Support Policy

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

3 Comments

Red Hat Developer Toolset 2.0 brings gcc to V4.8.

Can you also explain why GCC versions that have reached stage 4 (fix regressions only) like 4.5.4 (July 2, 2012) and 4.6.4 (April 12, 2013)and 4.7.4 (June 12, 2014) have not been made available in RHEL 6? Same for 4.9.4 (August 3, 2016) and 5.4 (June 3, 2016) in RHEL 7? The DTS / SC do not provide these versions either as far as I know.

I have the same problem when I try to install the gcc-g++ on the HPC Cluster compute nodes but it is working on the head node could you help me how as I fix this problem