Compilers

Compiler Types and Setting

The work, parallel and calculation servers offer compiling functions.

Setting

Use the module command to set the compiler environment.
Please refer to the Environment Modules for module command.
The module file to be loaded in every compiler below.

CompilerVersionmodule file
gcc4.4.7default
gcc3.4.6default
gcc4.8.5gcc/485work and calculation servers
gcc5.3.0gcc/530work and calculation servers
gcc6.3.0gcc/630work and calculation servers
gcc8.2.0gcc/820work and calculation servers
Intel Compiler(64bit)2019intel/2019
Intel Compiler(32bit)2019intel32/2019
Intel Compiler(64bit)2018intel/2018
Intel Compiler(32bit)2018intel32/2018
Intel Compiler(64bit)2017intel/2017
Intel Compiler(32bit)2017intel32/2017
PGI Compiler(64bit)16.3pgi/16.3
PGI Compiler(32bit)16.3pgi32/16.3

Command

Shown below is some of the major compilation commands for each source program.
If you want to compile MPI applications, see "MPI Compilation".

Compiler TypeProgram TypeCompilation CommandDebugger (*1)
Examples
gcc version 8.2.0 (*2)
gcc version 6.3.0 (*2)
gcc version 5.3.0 (*2)
gcc version 4.8.5 (*2)
gcc version 4.4.7
gcc version 3.4.6
C 64bitgcc ・・・・except version 3.4.6
gcc34 ・・・・version 3.4.6
gdb
gcc -o hello hello.c
C 32bitgcc ・・・・except version 3.4.6
gcc34 ・・・・version 3.4.6
gcc -m32 -o hello hello.c
C++ 64bitg++ ・・・・except version 3.4.6
g++34 ・・・・version 3.4.6
g++ -o hello hello.cpp
C++ 32bitg++ ・・・・except version 3.4.6
g++34 ・・・・version 3.4.6
g++ -m32 -o hello hello.cpp
Fortran 64bitg77・・・・version 3.4.6
g77 -o hello hello.f
Fortran 32bitg77 ・・・・version 3.4.6
g77 -m32 -o hello hello.f
Fortran90 64bitgfortran ・・・・except version 3.4.6
gfortran -o hello hello.f90
Fortran90 32bitgfortran ・・・・except version 3.4.6
gfortran -m32 -o hello hello.f90
PGI 16.1
PGI 12.1 (*3)
Link to Manuals
C 64bit/32bitpgccpgdbg
pgcc -o hello hello.c
C++ 64bit/32bitpgCC
pgCC -o hello hello.cpp
Fortran 64bit/32bitpgf77
pgf77 -o hello hello.f
Fortran90 64bit/32bitpgf90
pgf90 -o hello hello.f90
Intel Parallel Studio XE 2019 Cluster Edition
Intel Parallel Studio XE 2018 Cluster Edition
Intel Parallel Studio XE 2017 Cluster Edition
Link to Manuals
C 64bit/32biticcidb
icc -o hello hello.c
C++ 64bit/32biticpc
icpc -o hello hello.cpp
Fortran 64bit/32bit
Fortran90 64bit/32bit
ifort
ifort -o hello hello.f

(*1) You can also use Allenea Inc. Forge as debugger. Please refer here for Forge. 
(*2) Only on work and calculation servers
(*3) Only on parallel servers

Library

MKL Library

The MKL libraries are available on work, parallel and calculation servers.
For more information, please refer to the following manual.

Link to Manuals

Setting

When using the MKL library, set the environment with module command.

○For Intel compiler

 $> module load intel/2019   (64bit)
 $> module load intel32/2019 (32bit)

○For gnu and PGI compiler

 $> module load mkl/2019   (64bit)
 $> module load mkl32/2019 (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/2019
 $> icc|icpc|ifort -o example example.[c|f] -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread -lm -ldl4  ↓ 

○gnu compiler [C]/[C++]/[Fortran]

 $> module load mkl/2019
 $> gcc|g++|gfortran -o example example.[c|f] -Wl,--no-as-needed -lmkl_intel_lp64 -lmkl_core  -lmkl_sequential -lm -lpthread -ldl ↓ 

○PGI compiler [C]/[C++]/[Fortran]

 $> module load mkl/2019
 $> module load pgi/16.3
 $> pgcc|pgCC|pgf90 -o example example.[c|f] -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread -lm -ldl ↓ 

ACML Library

The ACML library on work, calculation and parallel servers is stored on each compiler in the following directory.

Directorycompiler 
/opt/acml-5.3.1/ifort64/lib/ For fortran 64 bit with a compiler intel
/opt/acml-5.3.1/ifort64_mp/lib/ For multiprocessor fortran 64 bit with a compiler intel
/opt/acml-5.3.1/pgi64/lib/  For fortran 64 bit with a compiler PGI
/opt/acml-5.3.1/pgi64_mp/lib/ For multiprocessor fortran 64 bit with a compiler PGI
/opt/acml-6.1.0/gfortran64/lib/ For fortran 64 bit with a compiler gnu
/opt/acml-6.1.0/gfortran64_mp/lib/ For multiprocessor fortran 64 bit with a compiler gnu

Compiler Options

When compiling, specify the options -L/opt/acml-6.1.0/gfortran64/lib/ -lacml after the filename (***.f or ***.c ...)

fftw3 Library

The fftw3 library on work, calculation and parallel servers is stored in the following directory.

Directorytype version
/usr/lib64fftw3 without MPI3.2default
/sw/packages/fftw3 (*4)fftw3 with MPI3.3builld with intel compiler
/opt/intel/mkl/ fftw3MKL

(*4) Only on work and calculation servers

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/2019

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.

MPImodule file
Intel MPIintel/2019 intel/2018 intel/2017
OpenMPI(1.10.2) build by gcc(4.4.7)openmpi/1.10.2-gcc
OpenMPI(1.10.2) build by gcc(4.8.5) (*5)openmpi/1.10.2-gcc485
OpenMPI(1.10.2) build by gcc(5.3.0) (*5)openmpi/1.10.2-gcc530
OpenMPI(1.10.2) build by gcc(6.3.0) (*5)openmpi/1.10.2-gcc630
OpenMPI(1.10.2) build by gcc(8.2.0) (*5)openmpi/1.10.2-gcc820
OpenMPI(1.10.2) build by Intelopenmpi/1.10.2-intel
OpenMPI(1.10.2) build by PGIopenmpi/1.10.2-pgi

(*5) Only on work and calculation servers

Examples of compilation

Shown below is an example of compilation with IntelMPI.

 $> module load intel/2019
 $> mpiicc -o intelmpi_64 intelmpi_64.c

OpenMPI

Shown below is an example of compilation with OpenMPI with gcc.
For options with other compiler, please refer Intel Math Kernel Library Link Line Advisor.

 $> module load openmpi/1.10.2-gcc
 $> mpicc -o openmpi_64 openmpi_64.c

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/2019
 $> 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/2019
 $> module load openmpi/1.10.2-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/2019
 $> icc -qopenmp -o openmp_64.icc openmp_64.c

PGI compiler

Shown below is an example of compilation with PGI compiler.

 $> module load pgi/16.3
 $> 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.


Last-modified: 2019-01-29 (火) 17:15:19 (49d)