What is BLAS / LAPACK?
BLAS (Basic Linera Algebra Subprograms) are routines for performing common linear algebra operations such as vector addition, scalar multiplication, dot products and matrix operations.
LAPACK (Linear Algebra PACKage) extends BLAS to provide higher level numerical solvers for linear equations and linear least squares, eigenvalues problems and singular value decomposition. Routines for matrix factorizations such as LU, Cholesky, QR and SVD are also provided.
Using BLAS / LAPACK at HPC system
To compile C/C++ or Fortran program with BLAS & LAPACK library, add the flag ‘-lblas’ and ‘-llapack’ :
PGI Compiler | Serial C |
pgcc -lblas -llapack your_program.c |
Serial C++ |
pgc++ -lblas -llapack your_program.cpp |
|
Serial FORTRAN |
pgfortran -lblas -llapack your_program.f |
|
Intel Compiler | Serial C |
icc -lblas -llapack your_program.c |
Serial C++ |
icpc -lblas -llapack your_program.cpp |
|
Serial FORTRAN |
ifort -lblas -llapack your_program.f |
|
GNU Compiler | Serial C |
gcc -lblas -llapack your_program.c |
Serial C++ |
g++ -lblas -llapack your_program.cpp |
|
Serial FORTRAN |
gfortran -lblas -llapack your_program.f |
For other flags un-related to BLAS/LAPACK but specific to the compilers, one can refer to ITS user guide for PGI Compilers, Intel Compilers and GNU Compilers respectively.
Using BLAS and LAPACK library that comes from Intel Math Kernel Library(MKL) can refer to ITS user guide Intel MKL.
Additional Information
BLAS website: www.netlib.org/blas
LAPACK website: www.netlib.org/lapack