Compilers and Libraries

Following compilers are available on the accelerator server.
For more details, see each manual.

Compiler Version Notes
Intel Compiler Fortran/C/C++ 2022.3.1
2021.5.0
19.1.3.304
19.1.0.166
19.0.2.187
18.0.3.222
17.0.4.196
default: 17.0.4.196
2021.5.0 is only available when running applications, not compiling.
PGI Compiler Fortran/C/C++ 20.4
19.10
19.1
18.10
18.5
default: 19.1
NVIDIA HPC Compiler 23.1
22.11
22.5
21.11
20.9
default: 20.9
GNU Compiler 4.9.1
6.1.0
8.5.0
11.3.0
default: 6.1.0
nvcc Compiler (CUDA Toolkit) 11.6.2
10.2.89
10.1.243
9.2.148
9.0.176
8.0.44
default: 9.0.176



Intel Compiler


Setting of program environment
Intel compiler is the default one on the accelerator server.
If you want to change the compiler version, execute the following command.

$ module avail intel
intel/17.0.4(default) intel/18.0.3 intel/19.0.2
intel/19.1.0 intel/19.1.3 intel/21.5.0 intel/oneapi/22.3.1

$ module switch intel/17.0.4 intel/18.0.3

intel/21.5.0 is only available when running applications, not compiling.

How to compile

Command
・serial

Language Command Execution type
Fortran ifort ifort [options] files
C icc icc [options] files
C++ icpc icpc [options] files


・MPI

Language Command Execution type
Fortran mpiifort mpiifort [options] files
C mpiicc mpiicc [options] files
C++ mpiicpc mpiicpc [options] files


Options

・Optimization options and others

Option Description
-o outfile Set output file. If ‘-o’ option is not specified, the default output file is a.out.
-l library_name Specify libraries to be linked.
-L library_path Specify paths to be searched for the libraries.
-O0|-O1|-O2|-O3 Set optimizing options. -O2 is default.
-fast Set the whole program execution speed maximum.
The following options are set automatically.
-ipo, -O3, -no-prec-div, -static, -fp-model fast=2, -xHost
-parallel Compile the input source file enabling auto threading.
-openmp Compile the input source file enabling OpenMP.
-xcore-avx512 Specify Intel AVX-512 instruction as target.
(Recommended)


・Options for Fortran

Option Description
-free|-fixed Set the format of source files.


・Debugging Options

Option Description
-g Output debugging information.
-traceback Output traceback when an error occurs.
-fpe[0-3] Trap exception handling. (-fpe0 is most detailed)


Example

・Make the execution module 'hello.out' from Fortran source file 'hello.f' in fixed form.

$ ifort -xcore-avx512 -fixed -o hello.out hello.f


・Make the execution module ’hello.out’ from the Fortran source file ‘hello.f90’ in free form.

$ ifort -xcore-avx512 -free -o hello.out hello.f90


・Make the execution module 'hello.out' auto threaded from the Fortran source file 'hello.f' in fixed form.

$ ifort -xcore-avx512 -fixed -parallel -o hello.out hello.f


・Make the execution module 'hello.out' auto threaded from the Fortran source file 'hello.f90' in free form.

$ ifort -xcore-avx512 -free -parallel -o hello.out hello.f90


・Make the execution module 'hello.out' from C source file 'hello.c'.

$ icc -xcore-avx512 -o hello.out hello.c


・Make the execution module 'hello.out' auto threaded from C source file 'hello.c'.

$ icc -xcore-avx512 -parallel -o hello.out hello.c


・Make the execution module 'hello.out' from the C++ source file 'hello.cpp'.

$ icpc -xcore-avx512 -o hello.out hello.cpp


・Make the execution module 'hello.out' auto threaded from the C++ source file.

$ icpc -xcore-avx512 -parallel -o hello.out hello.cpp



PGI Compiler


Setting of program environment
When the program environment is changed, execute the following commands.

$ module avail PrgEnv-pgi
PrgEnv-pgi/18.5 PrgEnv-pgi/18.10 PrgEnv-pgi/19.1(default) PrgEnv-pgi/19.10 PrgEnv-pgi/20.4

$ module switch intel PrgEnv-pgi


How to compile

Command
・serial

Language Command Execution type
Fortran pgf90 pgf90 [options] files
C pgcc pgcc [options] files
C++ pgc++ pgc++ [options] files


・MPI

Language Command Execution type
Fortran mpif90 mpif90 [options] files
C mpicc mpicc [options] files
C++ mpic++ mpic++ [options] files


Options

・Optimization options and others

Option Description
-o outfile Set output file. If ‘-o’ option is not specified, the default output file is a.out.
-l library_name Specify libraries to be linked.
-L library_path Specify paths to be searched for the libraries.
-O0|-O1|-O2|-O3|-O4 Set optimizing options. -O2 is default.
-fast Enable general optimization flag.
-Mconcur Compile the input source file enabling auto threading.
-mp Compile the input source file enabling OpenMP.


・Option for Fortran

Option Description
-Mfree|-Mfixed Set the format of source files.


・Debugging options

Option Description
-g|-gopt Output debugging information.


Example

・Make the execution module 'hello.out' from the Fortran source file 'hello.f' in fixed form.

$ pgf90 -Mfixed -o hello.out hello.f


・Make the execution module 'hello.out' auto threaded from the Fortran source file 'hello.f' in fixed form.

$ pgf90 -Mfixed -Mconcur -o hello.out hello.f


・Make the execution module 'hello.out' using OpenMP from the Fortran source file 'hello.f' in fixed form.

$ pgf90 -mp -Mfixed -o hello.out hello.f


・Make the execution module ’hello.out’ from the Fortran source file ‘hello.f90’ in free form.

$ pgf90 -Mfree -o hello.out hello.f90 


・Make the execution module 'hello.out' auto threaded from the Fortran source file 'hello.f90' in free form.

$ pgf90 -Mfree -Mconcur -o hello.out hello.f90


・Make the execution module 'hello.out' using OpenMP from the Fortran source file 'hello.f90' in free form.

$ pgf90 -mp -Mfree -o hello.out hello.f90


・Make the execution module 'hello.out' from C source file 'hello.c'.

$ pgcc -o hello.out hello.c


・Make the execution module 'hello.out' auto threaded from C source file 'hello.c'.

$ pgcc -Mconcur -o hello.out hello.c


・Make the execution module 'hello.out' using OpenMP from C source file 'hello.c'.

$ pgcc -mp -o hello.out hello.c


・Make the execution module 'hello.out' from the C++ source file 'hello.cpp'.

$ pgc++ -o hello.out hello.cpp


・Make the execution module 'hello.out' auto threaded from the C++ source file 'hello.cpp'

$ pgc++ -Mconcur -o hello.out hello.cpp


・Make the execution module 'hello.out' using OpenMP from the C++ source file 'hello.cpp'.

$ pgc++ -mp -o hello.out hello.cpp



NVIDIA HPC Compiler


Setting of program environment
The following modules are available.

Module Description
nvhpc Adds environment variable settings for the NVIDIA HPC Compilers, CUDA libraries, and additional libraries such as MPI, NCCL, and NVSHMEM.
nvhpc-nompi Adds environment variable settings for the NVIDIA HPC Compilers, CUDA libraries, and additional libraries such as NCCL and NVSHMEM.
nvhpc-byo-compilers Adds environment variable settings for the CUDA libraries and additional libraries such as NCCL and NVSHMEM.
nvhpc-hpcx Adds environment variable settings for the such as MPI


When the program environment is changed, execute the following commands.

$ module avail nvhpc 
nvhpc/20.9(default) nvhpc-byo-compiler/20.9(default)
nvhpc-nompi/20.9(default)
nvhpc/21.11 nvhpc-byo-compiler/21.11 nvhpc-nompi/21.11
nvhpc/22.5 nvhpc-byo-compiler/22.5 nvhpc-nompi/22.5
nvhpc/22.11 nvhpc-byo-compiler/22.11 nvhpc-nompi/22.11
nvhpc/23.1 nvhpc-byo-compiler/23.1 nvhpc-nompi/23.1
nvhpc-hpcx/23.1

$ module switch intel nvhpc


How to compile

Command
・serial

Language Command Execution type
Fortran nvfortran nvfortran [options] files
C nvc nvc [options] files
C++ nvc++ nvc++ [options] files


・MPI

Language Command Execution type
Fortran mpif90 mpif90 [options] files
C mpicc mpicc [options] files
C++ mpic++ mpic++ [options] files


Options
・Optimization options and others

Option Description
-o outfile Set output file. If ‘-o’ option is not specified, the default output file is a.out.
-llibrary_name Specify libraries to be linked.
-Llibrary_path Specify paths to be searched for the libraries.
-O0|-O1|-O2|-O3|-O4 Set optimizing options. -O2 is default.
-fast Enable general optimization flag.
-Mconcur Compile the input source file enabling auto threading.
-mp Compile the input source file enabling OpenMP.

・Option for Fortran

Option Description
-Mfree|-Mfixed Set the format of source files.

・Debugging options

Option Description
-g | -gopt Output debugging information.


Example

・Make the execution module 'hello.out' from the Fortran source file 'hello.f' in fixed form.

$ nvfortran -Mfixed -o hello.out hello.f


・Make the execution module 'hello.out' auto threaded from the Fortran source file 'hello.f' in fixed form

$ nvfortran -Mfixed -Mconcur -o hello.out hello.f


・Make the execution module 'hello.out' using OpenMP from the Fortran source file 'hello.f' in fixed form.

$ nvfortran -mp -Mfixed -o hello.out hello.f


・Make the execution module ’hello.out’ from the Fortran source file ‘hello.f90’ in free form.

$ nvfortran -Mfree -o hello.out hello.f90


・Make the execution module 'hello.out' auto threaded from the Fortran source file 'hello.f90' in free form.

$ nvfortran -Mfree -Mconcur -o hello.out hello.f90


・Make the execution module 'hello.out' using OpenMP from the Fortran source file 'hello.f90' in free form.

$ nvfortran -mp -Mfree -o hello.out hello.f90


・Make the execution module 'hello.out' from C source file 'hello.c'.

$ nvc -o hello.out hello.c


・Make the execution module 'hello.out' auto threaded from C source file 'hello.c'.

$ nvc -Mconcur -o hello.out hello.c


・Make the execution module 'hello.out' using OpenMP from C source file 'hello.c'.

$ nvc -mp -o hello.out hello.c


・Make the execution module 'hello.out' from the C++ source file 'hello.cpp'.

$ nvc++ -o hello.out hello.cpp


・Make the execution module 'hello.out' auto threaded from the C++ source file 'hello.cpp'.

$ nvc++ -Mconcur -o hello.out hello.cpp


・Make the execution module 'hello.out' using OpenMP from the C++ source file 'hello.cpp'.

$ nvc++ -mp -o hello.out hello.cpp



GNU Compiler


Setting of program environment
If you do not make any special settings, the GNU compiler version is OS default 4.8.5.
If you use another version, please execute the following command.

$ module avail gcc
gcc/4.9.1 gcc/6.1.0(default) gcc/8.5.0 gcc/11.3.0

$ module load gcc


How to compile

Command
・serial

Language Command Execution type
Fortran gfortran gfortran [options] files
C gcc gcc [options] files
C++ g++ g++ [options] files


・MPI

Language Command Execution type
Fortran mpif90 mpif90 [options] files
C mpicc mpicc [options] files
C++ mpicxx mpicxx [options] files


Options

・Optimization options and others

Option Description
-o outfile Set output file. If ‘-o’ option is not specified, the default output file is a.out.
-l library_name Specify libraries to be linked.
-L library_path Specify paths to be searched for the libraries.
-O0|-O1|-O2|-O3|-O4 Set optimizing options. -O2 is default.
-fopenmp Compile the input source file enabling OpenMP.


・Options for Fortran

Option Description
-ffree-form|-ffixed-form Set the format of source files.


・Debugging options

Option Description
-g Output debugging information.
-g0|-g1|-g2|-g3 Manage debugging information.(-g2 = -g)


Example

・Make the execution module 'hello.out' from Fortran source file 'hello.f' in fixed form.

$ gfortran -ffixed-form -o hello.out hello.f


・Make the execution module ’hello.out’ from the Fortran source file ‘hello.f90’ in free form.

$ gfortran -ffree-form -o hello.out hello.f90


・Make the execution module 'hello.out' from C source file 'hello.c'.

$ gcc -o hello.out hello.c


・Make the execution module 'hello.out' from the C++ source file 'hello.cpp'.

$ g++ -o hello.out hello.cpp



nvcc Compiler


Setting of program environment
The CUDA is available as default.
If you want to change the version, execute the following command.

$ module switch cudatoolkit/9.0.176 cudatoolkit/10.1.243


・Because the Intel compiler is set up as default, you use Intel compiler for backend compiler.

・Using PGI compiler for backend compiler, execute the following commands to set up PGI compiler.

$ module switch intel PrgEnv-pgi


How to compile

Options
・Backend compiler, optimization options and others

Option Description
-ccbin Compiler Specify backend compiler.
Intel compiler: icpc
PGI compiler: pgc++
-O0|1... Set optimizing options. 
(pass to the backend compiler)
-Xcompiler options Set compiler options except for optimizing options. 
(pass to the backend compiler)
-gencode options Specify CUDA’s version of generating code.
–machine {32|64}
(-m)
Specify the bits.
-I include_path Specify include search paths.
-L library_path Specify paths to be searched for the libraries.
-l library_name Specify libraries to be linked.
–help (-h) Display list and description of available options.
–version (-V) Display version information.


Example

・In case of specifying Intel compiler (icc) for backend compiler,

$ nvcc –ccbin icpc -m64 -gencode arch=compute_70,code=compute_70 -o simple simple.cpp


・In case of specifying PGI compiler (pgc++) for backend compiler,

$ nvcc -ccbin pgc++ -m64 -gencode arch=compute_70,code=compute_70 -o simple simple.cpp


Following libraries are available for compiling and linking on the accelerator server.
For more details, see each manual.

Library Version Compiler Notes
Intel MKL
(Intel Math Kernel Library)
19.1.3.304
19.1.0.166
19.0.2.187
18.0.3.222
17.0.4.196
Intel compiler
cuBLAS 9.0
8.0
Intel compiler
PGI compiler
cuDNN 7.6.5 for CUDA10.2
7.6.3 for CUDA10.1
7.6.5 for CUDA9.2
7.6.3 for CUDA9.0
Intel compiler
PGI compiler



Intel MKL

Intel MKL (Intel Math Kernel Library) contains BLAS, LAPACK, SparseBLAS, PARDISO, Iterative Sparse Solver, FFT, random number generation and so on.

Setting program environment

Intel MKL is default.
Change the compiler version as follows.

$ module switch intel/17.0.4 intel/18.0.3


Example

・Make the execution module 'hello.out' from the Fortran source file 'hello.f90' using BLAS in fixed form.

$ ifort -mkl -o hello.out -fixed hello.f90


・Make the execution module 'hello.out' from C source file 'hello.c' using BLAS.

$ icc -mkl -o hello.out hello.c



cuBLAS

The cuBLAS is BLAS library supporting the CUDA.

Setting of program environment

・The CUDA including the cuBLAS is available as default.
If you want to change the version, execute the following command.

$ module switch cudatoolkit/9.0.176 cudatoolkit/8.0.44


・Because the Intel compiler is set up as default, you use Intel compiler for backend compiler.

・Using PGI compiler for backend compiler, execute the following commands to set up PGI compiler.

$ module switch intel PrgEnv-pgi


Example

・In case of specifying Intel compiler (icc) for backend and linking cuBLAS libraries,

$ nvcc -ccbin icpc -I../../common/inc -m64 -gencode arch=compute_70,code=compute_70 -o simpleCUBLAS simpleCUBLAS.cpp -lcublas


・In case of specifying PGI compiler (pgc++) for backend and linking cuBLAS libraries,

$ nvcc -ccbin pgc++ -I../../common/inc -m64 -gencode arch=compute_70,code=compute_70 -o simpleCUBLAS simpleCUBLAS.cpp -lcublas



cuDNN


Setting of program environment

・The CUDA including the cuDNN is available as default.
If you want to change the version, execute the following command.

$ module switch cudatoolkit/9.0.176 cudatoolkit/10.1.243


・Because the Intel compiler is set up as default, you use Intel compiler for backend compiler.

・Using PGI compiler for backend compiler, execute the following commands to set up PGI compiler.

$ module switch intel PrgEnv-pgi


Example

・In case of specifying Intel compiler (icc) for backend and linking cuDNN libraries,

$ nvcc -ccbin icpc -I../../common/inc -m64 -gencode arch=compute_70,code=compute_70 -o simpleCUBLAS simpleCUBLAS.cpp -lcudnn


・In case of specifying PGI compiler (pgc++) for backend and linking cuDNN libraries,

$ nvcc -ccbin pgc++ -I../../common/inc -m64 -gencode arch=compute_70,code=compute_70 -o simpleCUBLAS simpleCUBLAS.cpp -lcudnn


  • user_manual/acceleratorserver/compilers_libraries.txt
  • Last modified: 2023/08/09 00:56
  • by ccms