GNU Compilers


GNU Compilers

The GNU C/C++ and Fortran compilers are provided on the HPC and Spear as an alternative to the Intel compilers.

GNU compilers are always available in the shell path. There is no need to load any environment modules, unless you need to use the GNU MVAPICH, GNU MVAPICH2, or GNU OpenMPI libraries.

Supported Languages

Below are the compiler commands for C/C++ and Fortran, respectively:

C and C++

$ gcc


$ gfortran


The GNU compilers include a debugger:

$ gdb

More Information

For a quick reference of how to use each GNU compiler, add the --help flag to either compiler command:

$ gcc --help 
$ gfortran --help

More detailed information is available on the compilers' respective manual pages. To access these pages from the command line, type:

$ man gcc
$ man gfortran

For a comprehensive guide to using the GNU compilers, please refer to the official documentation.