BLAS (Basic Linear Algebra Subprograms) is a widely used library for calculating vector and matrix operations. LAPACK (Linear Algebra PACKage) is a library for linear algebra that builds upon BLAS. Both are written in Fortran (BLAS in Fortran 77, LAPACK in Fortran 90) but are used by software written in many different languages.
On the cluster, LAPACK version 3.4.2 is installed for GCC. The shared libraries of BLAS and LAPACK are in the standard 64 bit library folder (
/usr/lib64), reachable from both login and compute nodes.
Using the libraries
In order to use BLAS, the corresponding module needs to be loaded:
$ module load blas/gcc/64/3.7.0
Likewise for LAPACK:
$ module load lapack/gcc/64/3.7.0
The installed libraries are then available and compilers can link programs against them.
Note: some other programs on the cluster also use BLAS or LAPACK. In those cases, the BLAS or LAPACK modules do not need to be loaded explicitly.
In the following example, a program is compiled with GFortran that uses BLAS:
$ gfortran -o bsp bsp.f90 -lblas