Skip to content

GNU Compilers

GNU C, C++, and Fortran Compilers


GNU Compilers requires an environment module

In order to use GNU Compilers, you must first load the appropriate environment module:

module load gnu

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

Supported languages#

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

1
2
3
4
5
# C and C++
$ gcc

# Fortran
$ gfortan

Alternative versions#

The HPC provides multiple versions of the GNU compilers via environment modules. To see the versions of the Intel compiler that are available, run the following:

$ module avail gnu

To load an alternative version of the compiler, run the following:

$ module load gnu/11.2.1

Debugging#

The GNU compilers include a debugger:

$ gdb

More information#

For a quick reference of how to use GNU compilers, add the --help flag to any command:

$ gcc --help
$ gfortran --help

More detailed information is available on the compilers' respective manual pages. To access these pages forom the shell, type:

$ man gcc
$ man fortran

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