Skip to main content

Compilers

Compilers, modules and commands:
Developer Module name C C++ Fortran
AMD aocc clang clang flang
GNU gcc gcc g++ gfortran
INTEL intel icc icpc ifort
INTEL intel-oneapi-compilers icx icpx ifx
NVIDIA nvhpc nvcc nvc++ nvfortran

aocc

Link to section 'Description' of 'aocc' Description

The AOCC compiler system is a high performance, production quality code generation tool. The AOCC environment provides various options to developers when building and optimizing C, C++, and Fortran applications targeting 32-bit and 64-bit Linux® platforms.

Link to section 'Versions' of 'aocc' Versions

  • Bell: 2.1.0
  • Anvil: 3.1.0

Link to section 'Module' of 'aocc' Module

You can load the modules by:

module load aocc

gcc

Link to section 'Description' of 'gcc' Description

The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Ada, and Go, as well as libraries for these languages.

Link to section 'Versions' of 'gcc' Versions

  • Bell: 4.8.5, 6.3.0, 9.3.0, 10.2.0
  • Brown: 4.8.5, 5.2.0, 6.3.0, 7.3.0, 8.3.0
  • Scholar: 4.8.5, 5.2.0, 6.3.0, 7.3.0, 8.3.0
  • Gilbreth: 4.8.5, 6.3.0, 9.3.0
  • Negishi: 8.5.0, 11.2.0, 12.2.0
  • Anvil: 8.4.1, 11.2.0, 11.2.0-openacc
  • Workbench: 4.8.5, 5.2.0, 6.3.0, 7.3.0, 8.3.0

Link to section 'Module' of 'gcc' Module

You can load the modules by:

module load gcc

Link to section 'Compiling Serial Programs' of 'gcc' Compiling Serial Programs

A serial program is a single process which executes as a sequential stream of instructions on one processor core. Compilers capable of serial programming are available for C, C++, and versions of Fortran.

Here are a few sample serial programs:

  • serial_hello.f
  • serial_hello.f90
  • serial_hello.f95
  • serial_hello.c
  • serial_hello.cpp

    The following table illustrates how to compile your serial program:
    Language GCC
    Fortran 77
    $ gfortran myprogram.f -o myprogram
     
    Fortran 90
    $ gfortran myprogram.f90 -o myprogram
     
    Fortran 95
    $ gfortran myprogram.f95 -o myprogram
     
    C
    $ gcc myprogram.c -o myprogram
    C++
    $ g++ myprogram.cpp -o myprogram

intel-oneapi-compilers

Link to section 'Description' of 'intel-oneapi-compilers' Description

icc, icpc, ifort, icx, icpx, ifx, and dpcpp.

Link to section 'Versions' of 'intel-oneapi-compilers' Versions

  • Negishi: 2023.0.0

Link to section 'Module' of 'intel-oneapi-compilers' Module

You can load the modules by:

module load intel-oneapi-compilers

intel

Link to section 'Description' of 'intel' Description

Intel Parallel Studio.

Link to section 'Versions' of 'intel' Versions

  • Bell: 17.0.1.132, 19.0.5.281
  • Brown: 16.0.1.150, 17.0.1.132, 18.0.1.163, 19.0.3.199
  • Scholar: 16.0.1.150, 17.0.1.132, 18.0.1.163, 19.0.3.199
  • Gilbreth: 17.0.1.132, 19.0.5.281
  • Negishi: 19.1.3.304
  • Anvil: 19.0.5.281
  • Workbench: 16.0.1.150, 17.0.1.132, 18.0.1.163, 19.0.3.199

Link to section 'Module' of 'intel' Module

You can load the modules by:

module load intel

Link to section 'Compiling serial programs' of 'intel' Compiling serial programs

A serial program is a single process which executes as a sequential stream of instructions on one processor core. Compilers capable of serial programming are available for C, C++, and versions of Fortran.

Here are a few sample serial programs:

  • serial_hello.f
  • serial_hello.f90
  • serial_hello.f95
  • serial_hello.c
  • serial_hello.cpp

     

    The following table illustrates how to compile your serial program:
    Language Intel Compiler
    Fortran 77
    $ ifort myprogram.f -o myprogram
     
    Fortran 90
    $ ifort myprogram.f90 -o myprogram
     
    Fortran 95
    $ ifort myprogram.f90 -o myprogram
     
    C
    $ icc myprogram.c -o myprogram
    C++
    $ icc myprogram.cpp -o myprogram

    The Intel compiler will not output anything for a successful compilation. Also, the Intel compiler does not recognize the suffix ".f95".

nvhpc

Link to section 'Description' of 'nvhpc' Description

The NVIDIA HPC SDK C, C++, and Fortran compilers support GPU acceleration of HPC modeling and simulation applications with standard C++ and Fortran, OpenACC® directives, and CUDA®. GPU-accelerated math libraries maximize performance on common HPC algorithms, and optimized communications libraries enable standards-based multi-GPU and scalable systems programming.

Link to section 'Homepage' of 'nvhpc' Homepage

https://developer.nvidia.com/hpc-sdk

Link to section 'Versions' of 'nvhpc' Versions

  • Scholar: 22.11
  • Gilbreth: 22.7
  • Anvil: 21.7

Link to section 'Module' of 'nvhpc' Module

You can load the modules by:

module purge
module load nvhpc

Link to section 'Example' of 'nvhpc' Example

Below is the example to use nvcc to compile a simple hello-world cuda code.

Link to section 'Cuda code' of 'nvhpc' Cuda code

hello.cu
#include <stdio.h>


__global__ void cuda_hello(){
    printf("Hello World from GPU!\n");
}

int main() {
    cuda_hello<<<1,1>>>();
    cudaDeviceSynchronize();
    return 0;
}
</stdio.h>

Link to section 'Compile cuda code' of 'nvhpc' Compile cuda code

$ nvcc hello.cu -o hello

Link to section 'Run compiled code' of 'nvhpc' Run compiled code

$ ./hello
  Hello World from GPU!
Helpful?

Thanks for letting us know.

Please don't include any personal information in your comment. Maximum character limit is 250.
Characters left: 250
Thanks for your feedback.