RedHat provides so called developer toolsets with more recent versions of GNU compilers. Most ScienticLinux and Centos installations provide a number of these developer toolsets:

@max-wgs001:~$ scl -l  # or scl --list
devtoolset-3
devtoolset-4
devtoolset-6
devtoolset-8

# start a new shell with devtoolset-8 activated
@max-wgs001:~$ scl enable devtoolset-8 bash
@max-wgs001:~$ which gcc
/opt/rh/devtoolset-8/root/usr/bin/gcc

@max-wgs001:~$ gcc --version
gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)

Please note: as soon as you leave the shell, the compiler will fall back to the default version. Usually the devtoolset won't be needed at runtime.

Please note: not all devtoolset-modules are installed. You won't find for example gfortran in all variants. If you need those please contact UCO.