GNU Compiler

Version Module File Name System A System B/C System G Cloud System Note
12.2.0 gcc/12.2.0 + + + + Installed in November 2022
8.5.0 - + + + + OS Standard

+ : Available for all users

- : Not available

When you log into the system, either the Intel compiler or the NVIDIA HPC SDK compiler is available by default. Please execute the module command as shown below to switch compilers.

(System B, C, Cloud)
$ module switch PrgEnvIntel PrgEnvGCC
(System G)
$ module switch PrgEnvNvidia PrgEnvGCC

You can use version 8.5.0 when you log into the system. If you want to use version 12.2.0, please execute the module command as follows with PrgEnvGCC loaded.

$ module load gcc/12.2.0

Language Command Operands
Fortran gfortran gfortran Option File name
C gcc gcc Option File name
C++ g++ g++ Option File name

  • Main options(e.g., parallelization, optimization)
Option Purpose
-o FILENAME Specifies the name of the object file.
-mcmodel=medium Supports more than 2 Gbytes of memory.
-fopenmp Compile with OpenMP directives enabled.
-O0/-O1/-O2/-O3 Specifies the level of optimization (default is -O0).
  • Message output and debugging options
Option Purpose
-Wall Displays all warning messages.
  • Fortran language options
Option Purpose
-ffixed-form Indicates that the program is written in a fixed format.
-ffree-form Indicates that the program is written in a free format.
-pedantic Warns against the use of Fortran extensions.
-fimplicit-none Warns against implicit type declarations.

$ gfortran test.f90    # For Fortran
$ gcc test.c           # For C
$ g++ test.cpp         # For C++
$ tssrun ./a.out       # Execution

OpenMP is an open standard for parallelizing programs. You can have the compiler perform parallelization automatically only by writing instructions starting with #pragma omp in the source code and compile with the given options.

To compile the source code with written instructions to OpenMP, use the -fopenmp option.

$ gcc -fopenmp test.c

When executing a compiled program, if you specify the number of parallels for t and c with the -A option, the program will be executed with the number of parallels.

$ tssrun --rsc p=1:t=8:c=8 ./a.out # Execute with the number of parallels specified as 8

IntelMPI library and OpenMPI library are available. Please refer to IntelMPI library and OpenMPI library on how to compile, link and execute MPI programs.