Compilers
Compilers
Compiler Types and Setting
The work and calculation servers offer compiling functions.
Setting
Use the module command to set the compiler environment. The module file to be loaded in every compiler below.
Compiler | Version | module file | |
---|---|---|---|
gcc | 11.4.1 | default | |
gcc | 8.5.0 | gcc/850 | work and calculation servers |
gcc | 12.3.0 | gcc/1230 | work and calculation servers |
Intel Compiler(64bit) | 2024 | intel/2024 | work and calculation servers |
PGI(nvhpc) Compiler(64bit) | 24.1 | nvhpc/24.1 | work and calculation servers |
Command
Shown below is some of the major compilation commands for each source program.
If you want to compile MPI applications, see "MPI Compilation".
If you want to compile with OpenMP, see "OpenMP Compilation".
Compiler Type | Program Type | Compilation Command Examples |
Debugger |
---|---|---|---|
gcc version 11.4.1 gcc version 8.5.0 gcc version 12.3.0 |
C 64bit | gcc | gdb |
gcc -o hello hello.c | |||
C 32bit | gcc | ||
gcc -m32 -o hello hello.c | |||
C++ 64bit | g++ | ||
g++ -o hello hello.cpp | |||
C++ 32bit | g++ | ||
g++ -m32 -o hello hello.cpp | |||
Fortran 64bit | gfortran・・・・except version8.5.0 | ||
gfortran -o hello hello.f | |||
Fortran 32bit | gfortran・・・・except version8.5.0 | ||
gfortran -m32 -o hello hello.f | |||
Fortran90 64bit | gfortran・・・・except version8.5.0 | ||
gfortran -o hello hello.f90 | |||
Fortran90 32bit | gfortran・・・・except version8.5.0 | ||
gfortran -m32 -o hello hello.f90 | |||
PGI(nvhpc)24.1 Link to Manuals |
C64bit/32bit | pgcc | cuda-gdb |
pgcc -o hello hello.c | |||
C++ 64bit/32bit | pgc++ | ||
pgc++ -o hello hello.cpp | |||
Fortran 64bit/32bit | pgf77 | ||
pgf77 -o hello hello.f | |||
Fortran90 64bit/32bit | pgf90 | ||
pgf90 -o hello hello.f90 | |||
Intel oneAP Link to Manuals |
C 64bit/32bit | icx | gdb-oneapi |
icx -o hello hello.c | |||
C++ 64bit/32bit | icpx | ||
icpx -o hello hello.cpp | |||
Fortran 64bit/32bit Fortran90 64bit/32bit |
ifx | ||
ifx -o hello hello.f |
Library
MKL Library
The MKL libraries are available on work and calculation servers. For more information, please refer to the manual.
Setting
When using the MKL library, set the environment with module command.
- For Intel compiler
$> module load intel/2024
Examples
For the compiler options on linking MKL, refer to Intel Math Kernel Library Link Line Advisor.
- Intel compiler (C / C++ / Fortran)
$> module load intel/2024
$> icx|icpx|ifx -o example example.[c|f] -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread -lm -ldl
fftw3 Library
The fftw3 library on work and calculation servers is stored in the following directory.
Directory | type | version | |
---|---|---|---|
/usr/lib64 | fftw3 without MPI | 3.2 | default |
/opt/intel/mkl/ | fftw3 | MKL |
Examples
- fftw3 include MKL
To use fftw3, set same as using MKL.
MPI Compilation
Execution Environment
Compiling with MPI can be executed on work and calculation servers. IntelMPI and OpenMPI are available as MPI environment modules.
Environment Configuration
OpenMPI is initially configured in /etc/profile.d. It is available by default.
MPI | module file |
---|---|
OpenMPI(1.10.7) build by gcc(4.8.5) | openmpi/1.10.7 |
OpenMPI(1.10.7) build by gcc(7.5.0) | openmpi/1.10.7-gcc750 |
OpenMPI(1.10.7) build by gcc(8.3.0) | openmpi/1.10.7-gcc830 |
OpenMPI(1.10.7) build by gcc(9.3.0) | openmpi/1.10.7-gcc930 |
OpenMPI(1.10.7) build by Intel | openmpi/1.10.7-intel |
OpenMPI(1.10.7) build by PGI | openmpi/1.10.7-pgi |
OpenMPI(2.1.6) build by gcc(4.8.5) | openmpi/2.1.6-gcc |
OpenMPI(2.1.6) build by gcc(7.5.0) | openmpi/2.1.6-gcc750 |
OpenMPI(2.1.6) build by gcc(8.3.0) | openmpi/2.1.6-gcc830 |
OpenMPI(2.1.6) build by gcc(9.3.0) | openmpi/2.1.6-gcc930 |
OpenMPI(2.1.6) build by Intel | openmpi/2.1.6-intel |
OpenMPI(2.1.6) build by PGI | openmpi/2.1.6-pgi |
Examples of compilation
IntelMPI
$> module load intel/2024
$> mpiicx -o intelmpi_64 intelmpi_64.c
OpenMPI
$> mpicc -o openmpi_64 openmpi_64.c
For options with other compiler, please refer Intel Math Kernel Library Link Line Advisor.
ScaLAPACK
You can use ScaLAPACK on the openmpi/IntelMPI environment. Shown below is an example of compilation linked ScaLAPACK( and BLACS ).
IntelMPI
C / Fortran
$> module load intel/2024
$> mpiicx|mpiifx -o intelmpi_sltest intelmpi_sltest.[c|f] -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64 -lmkl_intel_lp64
-lmkl_core -lmkl_sequential -lpthread -lm -ldl
OpenMP Program Compilation
Execution Environment
Compiling OpenMP program can be executed on work servers.
Environment Configuration
Set environment cariables with module command before compiling OpenMP program.
Examples of compilation
gcc
Shown below is an example of compilation with gcc.
$> gcc -fopenmp -o openmp_64 openmp_64.c
Intel compiler
Shown below is an example of compilation with Intel compiler.
$> module load intel/2024
$> icx -qopenmp -o openmp_64.icc openmp_64.c
PGI(nvhpc) compiler
Shown below is an example of compilation with PGI compiler.
$> module load intel/2024
$> icx -qopenmp -o openmp_64.icc openmp_64.c