Compilers
Compilers
Compiler Types and Setting
The work, parallel 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 | 4.8.5 | default | |
gcc | 7.5.0 | gcc/750 | work and calculation servers |
gcc | 8.3.0 | gcc/830 | work and calculation servers |
gcc | 9.3.0 | gcc/930 | work and calculation servers |
Intel Compiler(64bit) | 2020 | intel/2020 | |
Intel Compiler(32bit) | 2020 | intel32/2020 | |
PGI Compiler(64bit) | 20.1 | pgi/20.1 |
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 1 |
---|---|---|---|
gcc version 9.3.0 2 gcc version 8.3.0 2 gcc version 7.5.0 2 gcc version 4.8.5 2 |
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 | ||
gfortran -o hello hello.f | |||
Fortran 32bit | gfortran | ||
gfortran -m32 -o hello hello.f | |||
Fortran90 64bit | gfortran・・・・except version3.4.6 | ||
gfortran -o hello hello.f90 | |||
Fortran90 32bit | gfortran・・・・except version3.4.6 | ||
gfortran -m32 -o hello hello.f90 | |||
PGI 20.1 PGI 20.1 3 Link to Manuals |
C 64bit/32bit | pgcc | pgdbg |
pgcc -o hello hello.c | |||
C++ 64bit/32bit | pgCC | ||
pgCC -o hello hello.cpp | |||
Fortran 64bit/32bit | pgf77 | ||
pgf77 -o hello hello.f | |||
Fortran90 64bit/32bit | pgf90 | ||
pgf90 -o hello hello.f90 | |||
Intel Parallel Studio XE 2020 Cluster Edition Link to Manuals |
C 64bit/32bit | icc | idb |
icc -o hello hello.c | |||
C++ 64bit/32bit | icpc | ||
icpc -o hello hello.cpp | |||
Fortran 64bit/32bit Fortran90 64bit/32bit |
ifort | ||
ifort -o hello hello.f |
Library
MKL Library
The MKL libraries are available on work, parallel 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/2020 (64bit) $> module load intel32/2020 (32bit)
- For gnu and PGI compiler
$> module load mkl/2020 (64bit) $> module load mkl32/2020 (32bit)
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/2020 $> icc|icpc|ifort -o example example.[c|f] -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread -lm -ldl4
AOCL Library
The AOCL library on work, calculation and parallel servers is stored on each compiler in the following directory.
Directory | compiler |
---|---|
/opt/aocl-2.1/amd/aocl/2.1/amd-blis/ | blas library |
/opt/aocl-2.1/amd/aocl/2.1/amd-fftw/ | fftw library |
/opt/aocl-2.1/amd/aocl/2.1/amd-libflame/ | libFLAME library for AMD |
/opt/aocl-2.1/amd/aocl/2.1/amd-libm/lib | math library |
/opt/aocl-2.1/amd/aocl/2.1/amd-rng/lib | AMD_Random_Number_Generator_Library |
/opt/aocl-2.1/amd/aocl/2.1/amd-scalapack | high performance linear algebra routines for distributed memory computers supporting MPI |
/opt/aocl-2.1/amd/aocl/2.1/amd-securerng | AMD_SecureRNG_Library |
/opt/aocl-2.1/amd/aocl/2.1/libs | all library link here |
Compiler Options
Please refer following web. https://developer.amd.com/wp-content/resources/AOCL_User%20Guide_2.1.pdf
fftw3 Library
The fftw3 library on work, calculation and parallel servers is stored in the following directory.
Directory | type | version | |
---|---|---|---|
/usr/lib64 | fftw3 without MPI | 3.2 | default |
/sw/packages/fftw/fftw3 4 | fftw3 with MPI | 3.3 | build by Intel compiler |
/opt/intel/mkl/ | fftw3 | MKL |
Examples
- fftw3 with MPI version
When using fftw3 library, the Intel compiler is needed in your environment, for fftw3 build with the Intel compiler. Loading the Intel compiler is required even in the use with other compilers.
$> module load intel/2020
When compiling, specify the options -L/sw/packages/fftw/fftw3/lib/ -lfftw3 after the filename (***.f or ***.c ...)
- fftw3 include MKL
To use fftw3, set same as using MKL.
MPI Compilation
Execution Environment
Compiling with MPI can be executed on work, calculation and parallel servers. IntelMPI and OpenMPI are available as MPI environment modules.
Environment Configuration
Set environment cariables with module command before compiling with MPI. The compiler for OpenMPI varies, chose correspondingly.
MPI | module file |
---|---|
OpenMPI(1.10.7) build by gcc(4.8.5) 5 | openmpi/1.10.7 |
OpenMPI(1.10.7) build by gcc(7.5.0) 5 | openmpi/1.10.7-gcc750 |
OpenMPI(1.10.7) build by gcc(8.3.0) 5 | openmpi/1.10.7-gcc830 |
OpenMPI(1.10.7) build by gcc(9.3.0) 5 | 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) 5 | openmpi/2.1.6-gcc |
OpenMPI(2.1.6) build by gcc(7.5.0) 5 | openmpi/2.1.6-gcc750 |
OpenMPI(2.1.6) build by gcc(8.3.0) 5 | openmpi/2.1.6-gcc830 |
OpenMPI(2.1.6) build by gcc(9.3.0) 5 | 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/2020 $> mpiicc -o intelmpi_64 intelmpi_64.c
OpenMPI
$> module load openmpi/1.10.7-gcc $> 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/2020 $> mpiicc|mpiifort -o intelmpi_sltest intelmpi_sltest.[c|f] -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64 -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread -lm -ldl
OpenMPI with gnu
Please refer here for options with other compilers.
C / Fortran
$> module load mkl/2020 $> module load openmpi/1.10.7-gcc $> mpicc|mpif90 -o openmpi_sltest openmpi_sltest.[c|f] -Wl,--no-as-needed -lmkl_scalapack_lp64 -lmkl_blacs_openmpi_lp64 -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lm -lpthread -ldl
OpenMP Program Compilation
Execution Environment
Compiling OpenMP program can be executed on work and parallel 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/2020 $> icc -qopenmp -o openmp_64.icc openmp_64.c
PGI compiler
Shown below is an example of compilation with PGI compiler.
$> module load pgi/20.1 $> pgcc -mp -o openmp_64.pgi openmp_64.c
Note
Number of Licenses
Licenses of PGI and Intel Compiler are managed by FlexLM. Users are expected to share total of five licenses for PGI and Intel Compiler together. If the usage exceeds this limit, the execution of the compilation is put on hold.