GCCcore

Version:

11.2.0, 10.2.0

Category:

compiler

Cluster:

Loki, Vali

Author / Distributor

https://gcc.gnu.org/

Description

GCCcore is a minimal, standalone installation of the GNU Compiler Collection (GCC) that serves as the foundation for compiler-based toolchains such as foss, intel, or CUDA stacks.

Unlike full GCC modules that may include extra development tools or libraries, GCCcore provides just enough functionality to bootstrap:

  • Compilers for C, C++, and Fortran

  • Linkers, assemblers, and basic build utilities

  • ABI compatibility for software compiled against this toolchain

GCCcore is the lowest layer of a modular toolchain stack and is not meant for direct user development but rather to support higher-level builds.

Documentation

The GCCcore module provides the following executables:

gcc       -> GNU C compiler
g++       -> GNU C++ compiler
gfortran  -> GNU Fortran compiler
cpp       -> C preprocessor

Typical flags:
  -O2, -O3           Optimization levels
  -Wall              Enable all common warnings
  -std=c++20         Enable C++20 support
  -fopenmp           Enable OpenMP multithreading

Usage:
  $ gcc hello.c -o hello
  $ g++ -std=c++20 main.cpp -o main
  $ gfortran solver.f90 -o solver

Use `man gcc` or `gcc --help` for full command-line options.

Examples/Usage

  • Load the module:

$ module load GCCcore/11.2.0
  • Compile a C program:

$ gcc -O2 -Wall hello.c -o hello
  • Compile a C++ program using modern standards:

$ g++ -std=c++20 main.cpp -o app
  • Compile a Fortran program:

$ gfortran solver.f90 -o solver
  • Check compiler versions:

$ gcc --version
$ g++ --version
$ gfortran --version
  • Unload the module:

$ module unload GCCcore/11.2.0

Installation

Source code is obtained from GCC