Table des matières
Jean Zay: The BLAS library
Introduction
BLAS (Basic Linear Algebra Subprograms) is a set of functions effectuating basic linear algebra operations such as vector addition, scalar products and matrix multiplication. BLAS is available via the Math Kernel Library (MKL) (recommended version) or in free versions (via LAPACK or OpenBLAS).
Installed versions
- Intel MKL with Intel compilers (recommended version)
- Via LAPACK 3.8.0 with the GCC 8.2.0 compiler
- Via LAPACK 3.8.0 with the 9.1.0 compiler
- Via LAPACK 3.8.0 with the Intel 2019.4 compiler
- OpenBLAS 0.3.6 with the GCC 8.2.0 compiler
- OpenBLAS 0.3.6 with the GCC 9.1.0 compiler
- OpenBLAS 0.3.6 with the Intel 2019.4 compiler
Usage of BLAS via MKL
MKL contains optimised implementations of the BLAS library. The library is directly accessible via the Intel compiler by using the module command:
$ module load intel-compilers/19.0.4 intel-mkl/19.0.4
To know which versions are installed on the machine:
$ module avail intel-compilers $ module avail intel-mkl
For the linking, you must add the following options:
'-L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl'
The options can vary from one version to another depending on the compiler used. Linking information can also be found on Intel MKL Link Line Advisor.
Usage of BLAS in free version via LAPACK
The library is accessible by loading LAPACK with the following command:
$ module load netlib-lapack
To know which versions are installed on the machine:
$ module avail netlib-lapack
Important: At the linking, you must add the -lblas
option.
Usage of BLAS in free version via OpenBLAS
The library is accessible with the following command:
$ module load openblas
To know which versions are installed on the machine:
$ module avail openblas
Important: At the linking, you must add the -lopenblas
option.