See the GNU C Compiler project pageopen in new window. To use GNU C Compiler, you’ll use the module tool.

You can see what versions are available by using:

[me@login01 ~]$ module avail gcc

------------------------------ /opt/modulefiles -------------------------------
   gcc/9.3.0

Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching
any of the "keys".

To load a specific version, you would use:

[me@login01 ~]$ module load gcc/9.3.0

while the "gcc" wildcard will load the default version, gcc-9.3.0 in this case.

You should now be able to run GNU C Compiler commands:

[me@login01 ~]$ gcc --version
gcc (GCC) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.