Compilers – GNU

Overview

The GNU Compiler Collection supports a number of programming languages.

Several versions are available on the iCSF – please see the table below.

Advice on programming in Fortran or C is currently beyond the scope of this webpage.

Restrictions on use

None, the compilers are open source.

Set up procedure

This depends on which version you require.

Version Commands/compilers available Module required Additional Notes
4.4.6 gcc, gfortran None This is considered the system default
4.6.2 gcc, gfortran module load compilers/gcc/4.6.2
4.7.0 gcc, gfortran module load compilers/gcc/4.7.0
4.9.0 gcc, gfortran module load compilers/gcc/4.9.0
6.4.0 gcc, gfortran module load compilers/gcc/6.4.0
8.2.0 gcc, gfortran module load compilers/gcc/8.2.0
8.3.0 gcc, gfortran module load compilers/gcc/8.3.0
11.2.0 gcc, gfortran module load compilers/gcc/11.2.0

By loading/swapping modules, the correct LD_LIBRARY_PATH will be set.

Running the application

Example Code Compilations

   gcc hello_world.c -o hello
       #
       # ...produces executable binary called "hello"...
       #

   gfortran hello_fworld.f77 -o f77hello
   gfortran hello_fworld.f95 -o f95hello
       #
       # ...produce executable binary called "f77hello" or "f95hello"...
       #

To run your code:

   ./f95hello

Further info

  • Online manuals available from the command line:
     man gcc
         # for the C/C++ compiler

     man gfortran
         # for the fortran compiler

Last modified on April 4, 2022 at 12:57 pm by Ben Pietras