To use recent versions of compilers such as gcc 11 on centos stream, install the gcc toolsets, eg gcc-toolset-11 which is in the AppStream repos.
Answer from jiopaley on Stack Overflowlinux - How to install gcc8 using devtoolset-8-gcc - Stack Overflow
yum - Centos 7 gcc 8 installation - Unix & Linux Stack Exchange
Installing devtoolset-X
Use devtoolset-8 on Centos/RHEL for Node.js 14+
To install the full tools-set including gfortran on centos 7:
yum install centos-release-scl
yum install devtoolset-8
scl enable devtoolset-8 -- bash
enable the tools:
source /opt/rh/devtoolset-8/enable
you may wish to put the command above in .bash_profile
ref: https://unix.stackexchange.com/questions/477360/centos-7-gcc-8-installation
devtoolset-8 was only released a short while ago. The linked installation instructions may be of use. However, your question pertains to CentOS, and this does not yet appear to have been made available yet. You can see some evidence of it being build for CentOS here, but it's not been updated for the final release yet.
You could ask on the SCL mailing list for an ETA, or wait until it appears in its final form. In the meantime, you could download the RPMs from koji directly.
On CentOS I can do yum install devtoolset-8 followed by scl enable devtoolset-8 bash so that my paths are setup to use GCC et al packaged with that development toolset.
Is there an equivalent in AlmaLinux?
Hi,
The company I work for is developing a software package that is distributed to users. We made a linux port available last year and we're starting to run in to compatibility issues with different versions glibc/libstdc++, especially as we start moving to newer versions of gcc/g++. It seems like devtoolset will solve our problem, but I have a question about it which is this:
If we start using devtoolset-8 on centos 8, will our binaries work on centos 7?
If not, since devtoolset-8 is available on centos 7, can I use docker to build my distrutables on CentOS 7 with devtoolset-8 with the expectation that the automated tests will equally succceed on Centos 7?
Thanks for reading,
We're currently on ubuntu and we're looking to switch to centos 8.
A work-around that I found is to set gnome-terminal to run
bash -c "$HOME/.bashrc; exec zsh"
as a custom command in place of the default shell, which is equivalent to opening a terminal emulator with
gnome-terminal -- bash -c "$HOME/.bashrc; exec zsh"
adapted from here.
It seems you could also use:
source /opt/rh/devtoolset-8/enable
Tested on RHEL7.6 for package rh-php73, it worked:
source /opt/rh/rh-php73/enable
Found the hint here