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-3 bash gcc -v gfortran -v
Likewise to use python 2.7, run the following:
scl enable python27 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 python27 - scl -l devtoolset-3
The first command runs my_script using python27 from the current shell (note the dash in the end). The second lists the packages included in collection devtoolset-3.
For more information, refer to Red Hat Software Collections 2.0