I am using CentOS 7.9 and I encountered the same problem after following instructions here to install and run gcc 11. I tried launching different versions of gcc and found only devtoolset-9 works, which corresponds to the file devtoolset-9 in /etc/scl/conf/ folder. So I copied devtoolset-9 to devtoolset-11 in the same folder, and gcc 11 gets working.

Answer from zzzhhh on Stack Overflow
🌐
Linux @ CERN
linux.web.cern.ch › devtoolset
Developer Toolset - Linux @ CERN
$ scl enable devtoolset-1.1 bash $ gcc --version gcc (GCC) 4.7.2 20121015 (Red Hat 4.7.2-5) Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions.
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_toolset › 9 › html › 9.0_release_notes › dts9.0_release
Chapter 2. Red Hat Developer Toolset 9.0 Release | 9.0 Release Notes | Red Hat Developer Toolset | 9 | Red Hat Documentation
The devtoolset-version-package_name-debuginfo packages can conflict with the corresponding packages from the base Red Hat Enterprise Linux system or from other versions of Red Hat Developer Toolset. This namely applies to devtoolset-version-gcc-debuginfo, devtoolset-version-ltrace-debuginfo, devtoolset-version-valgrind-debuginfo, and might apply to other debuginfo packages, too.
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_toolset › 10 › epub › 10.0_release_notes › index
10.0 Release Notes | Red Hat Developer Toolset | 10 | Red Hat Documentation
However, if the Red Hat Software ... Toolset 3.x version, which is still available in the repository. To work around this problem, exclude this package while updating: ... Copy to Clipboard Copied! ... When the user attempts to start the devtoolset-10-stap-server service, ...
🌐
Red Hat
access.redhat.com › documentation › en-us › red_hat_developer_toolset › 10 › html-single › 10.0_release_notes › index
10.0 Release Notes | Red Hat Developer Toolset | 10 | Red Hat Documentation
However, if the Red Hat Software ... the Red Hat Developer Toolset 3.x version, which is still available in the repository. To work around this problem, exclude this package while updating: ... When the user attempts to start the devtoolset-10-stap-server service, an SELinux ...
Find elsewhere
🌐
Princeton CS Guide
csguide.cs.princeton.edu › software › gcc
GCC, the GNU Compiler Collection | Department of Computer Science Computing Guide
You can use scl to control which version you want to use (bash starts a new shell with all variables set). devtoolset-3 - version 4.9.2 devtoolset-4 - version 5.3.1
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_toolset › 10 › html › user_guide › chap-red_hat_developer_toolset
Chapter 1. Red Hat Developer Toolset | User Guide | Red Hat Developer Toolset | 10 | Red Hat Documentation
rhel-variant-rhscl-version-rpms rhel-variant-rhscl-version-debug-rpms rhel-variant-rhscl-version-source-rpms · In addition, certain packages, such as devtoolset-10-gcc-plugin-devel, depend on packages that are only available in the Optional channel.
🌐
Softwarecollections
softwarecollections.org › en › scls › rhscl › devtoolset-7
Developer Toolset 7 — Software Collections
devtoolset-7 - Developer Toolset is designed for developers working on CentOS or Red Hat Enterprise Linux platform. It provides current versions of the GNU Compiler Collection, GNU Debugger, and other development, debugging, and performance monitoring tools.
🌐
Upenn
hpcwiki.pmacs.upenn.edu › wiki › index.php › HPC:Developer_Tool_Set
HPC:Developer Tool Set - HPC wiki
devtoolset-2-gcc-4.8.0-5 devtoolset-2-libstdc++-devel-4.8.0-5 devtoolset-2-runtime-2.0-14 devtoolset-2-gdb-7.6-28 devtoolset-2-libquadmath-devel-4.8.0-5 devtoolset-2-gcc-gfortran-4.8.0-5 devtoolset-2-gcc-c++-4.8.0-5 devtoolset-2-binutils-2.23.52.0.1-5
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_toolset › 10 › html-single › user_guide › index
User Guide | Red Hat Developer Toolset | 10 | Red Hat Documentation
Red Hat Developer Toolset is distributed with GCC 10.2.1. This version is more recent than the version included in Red Hat Enterprise Linux and provides a number of bug fixes and enhancements. In Red Hat Developer Toolset, the GNU C compiler is provided by the devtoolset-10-gcc package and ...
🌐
Reddit
reddit.com › r/cpp › devtoolset is a game changer for c++ development on linux
r/cpp on Reddit: Devtoolset is a game changer for C++ development on Linux
March 23, 2018 -

On Linux the dependency on system compilers have always been frustrating since it means your stuck with ancient GCC versions. But I must say I'm very impressed with devtoolset for RHEL/CentOS, it means you can use gcc-7 on old crappy RHEL6 that so many large companies insist on using. And you can ship the resulting binaries and it will run on plain vanilla RHEL installations!

Top answer
1 of 5
12

what is devtoolset ?

2 of 5
6

devtoolset-7 also provides newer versions of lots of supporting debug and performance tools like gdb.

They (RH or Centos) also provide containerised versions of the build tools and the performance tools.

There is also a tech preview of the llvm-toolset, admittedly at clang v4 but still able to build those compatible binaries.

Note that you want to build using a host that is lower or same version as your minimum target version.

e.g. toolset-7 on host centos v6.7 will create bins compatible with 6.7, 6.9 and 7.x If your host is say centos 7.2 toolset-7 builds are only guaranteed to be compatible with v7.2+ targets.

Redhat's documentation is really good (and you can even get a free developer login to access more resources).

Also note that Centos provides similar options to RHEL.

The only downside is I don't think you can use the new ABI variant of CXX LIB as the ABI isn't compatible with older compilers like the default Centos gcc 4

Not really a problem as you can still use the C++11/14/17 features, just a few items are incompatible (such as list::size() still being O(n) and not const time, or strings still being COW)

https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ (Lots of other tools/langs etc there too like Go,Rust,Python3 and lots of database updated versions etc.)

Not sure if you need to have a developer account, but an example of the documentation: https://access.redhat.com/documentation/en-us/red_hat_developer_toolset/7/html/7.0_release_notes/dts7.0_release

🌐
Abysm
blog.abysm.org › 2016 › 03 › installing-developer-toolset-rhel-based-distributions
Installing Developer Toolset on RHEL-based Distributions · Kuan-Yi Li's Blog
March 25, 2016 - Install the version(s) of your choice. Yes, they can co-exist. yum install devtoolset-10 · yum install devtoolset-9 · yum install devtoolset-8 · yum install devtoolset-7 · yum install devtoolset-6 · yum install devtoolset-4 · yum install devtoolset-3 ·
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_toolset › 12 › html-single › user_guide › index
User Guide | Red Hat Developer Toolset | 12 | Red Hat Documentation
Red Hat Developer Toolset is distributed with GCC 12.2.1. This version is more recent than the version included in Red Hat Enterprise Linux and provides a number of bug fixes and enhancements. In Red Hat Developer Toolset, the GNU C compiler is provided by the devtoolset-12-gcc package and ...
🌐
Red Hat
docs.redhat.com › en-us › documentation › red_hat_developer_toolset › 12 › pdf › user_guide › Red_Hat_Developer_Toolset-12-User_Guide-en-US.pdf pdf
Red Hat Developer Toolset 12 User Guide
Red Hat Developer Toolset is distributed with make 4.3. This version is more recent than the version · included in Red Hat Enterprise Linux and provides a number of bug fixes and enhancements. ... automatically installed with devtoolset-12-toolchain as described in Section 1.5, “Installing ...
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_toolset › 12 › html-single › 12.0_release_notes › index
12.0 Release Notes | Red Hat Developer Toolset | 12 | Red Hat Documentation
~]$ scl enable devtoolset-12 '/usr/lib64/ccache/gcc -c foo.c' Alternatively, you can create a shell with the Red Hat Developer Toolset version of GCC as the default compiler:
🌐
Stack Overflow
stackoverflow.com › questions › tagged › devtoolset
Newest 'devtoolset' Questions - Stack Overflow
We use devtoolset-10 in CentOS 7 ("Actual" default version of gcc in OS is 4.8.5, but in devtoolset we use 10.2.1 version, which is real actual version for project).