Sometimes more recent versions of programming tools are needed. To accomodate that without replacing the base operating system tools, Redhat has implemented software collections. This allows users to run gcc 4.9.x, python 2.7.x, etc. on a per application basis while maintaining well-tested operating system integrity.
scl utility makes the switching simple.
The current gcc version is 4.4. To use gcc 4.9 in bash shell, run the following commands:
scl enable devtoolset-4 bash gcc -v gfortran -v
Likewise to use python 3.6, run the following:
scl enable rh-python36 bash python -V
By exiting that bash shell, users will return back to the default system tools.
Other useful commands:
cat my_script | scl enable rh-python36 - scl -l devtoolset-4
The first command runs my_script using python3.6 from the current shell (note the dash in the end). The second lists the packages included in collection devtoolset-4.
For more information, refer to Red Hat Software Collections 2.0