The BLAS library
This page was translated by an AI (LLM) with a cursory human check and is awaiting full review.
Descriptionโ
BLAS (Basic Linear Algebra Subprograms) is a set of functions performing basic linear algebra operations such as vector additions, scalar products or matrix multiplications.
BLAS is available in free versions (Netlib and OpenBLAS) or via the Intel MKL (Math Kernel Libraries) that we recommend because they offer better performance.
Installed Versionsโ
The versions installed on Jean Zay can be found using the following commands:
- Intel MKL versions (recommended versions)
module avail intel-mkl - Netlib-Lapack versions
module avail netlib-lapack - OpenBLAS versions
module avail openblas
Environmentโ
The BLAS versions are available in different environments.
- Intel Environments
For Intel environments, please refer to our documentation on the Intel MKL library.
- Free Versions
For free versions, this information can be found using the module show command. For example:
module show netlib-lapack
module-whatis {LAPACK version 3.X is a comprehensive FORTRAN library that does linear algebra operations including matrix inversions, least squared solutions to linear sets of equations, eigenvector analysis, singular value decomposition, etc. It is a very comprehensive and reputable package that has found extensive use in the scientific community.}prereq gcc/11.4.1 gcc/10.1.0conflict netlib-lapack
Available software environment(s):- gcc/11.4.1- gcc/10.1.0
module show openblas
To use this library in other environments, please contact the User Support team.
- To obtain information on the library access paths for the free version, it will be necessary to first load the chosen environment (gcc in this example):
module load gcc/11.4.1module show netlib-lapack- With the
module showcommand, you can also obtain information on the library access paths for OpenBLAS:
module show openblasUsageโ
The library is accessible via the module command.
Using BLAS via MKLโ
For the use of MKL, please refer to the page concerning the Intel MKL library.
Using BLAS via LAPACKโ
For the use of the LAPACK library, please refer to our documentation concerning the LAPACK libraries.
Using BLAS via OpenBLASโ
To load the default version in the current environment (or in the default environment if no environment is previously loaded):
module load openblas
or to load a specific version in a specific environment (gcc in this example):
module load gcc/8.2.0module load openblas/0.3.6
Link Editingโ
Link Editing with MKLโ
Please refer to the page concerning the Intel MKL library.
Link editing for the use of MKL can vary depending on several parameters such as the operating system, the type of compiler and the architecture. It is recommended to use the Intelยฎ MKL Link Line Advisor to find the appropriate options.
Here is an example for the BLAS library:
module load intel-mklifort appel_blas.f90 -L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 \
-lmkl_sequential -lmkl_core -lpthread -lm -ldl
Link Editing with Free LAPACK Versionโ
For link editing with the free LAPACK library, please refer to our documentation concerning the LAPACK libraries.
When link editing, it is necessary to add the -lblas options:
module load gcc/11.4.1module load netlib-lapackgfortran appel_blas.f90 -lblas
Link Editing with Free BLAS Versionโ
When link editing, it is necessary to add the -lopenblas option:
module load gcc/9.1.0module load openblasgfortran appel_blas.f90 -lopenblas
Documentationโ
๐ Reference Site (Netlib)
๐ Reference Site (OpenBLAS)
๐ Intel MKL documentation
๐ Intel MKL Link Line Advisor