Standard software library for linear algebra


From the ( ):

LAPACK is written in Fortran 90 and provides routines for solving systems of simultaneous linear equations, least-squares solutions of linear systems of equations, eigenvalue problems, and singular value problems. The associated matrix factorizations (LU, Cholesky, QR, SVD, Schur, generalized Schur) are also provided, as are related computations such as reordering of the Schur factorizations and estimating condition numbers. Dense and banded matrices are handled, but not general sparse matrices. In all areas, similar functionality is provided for real and complex matrices, in both single and double precision.

LAPACK builds off of BLAS routines to provide more complex linear algebra operations as described above.

Use LAPACK on HPC cluster

Once on the HPC cluster LAPACK can be used by linking your source code the the various LAPACK libraries located in


Once linked one can use various LAPACK subroutines. Below we have a simple example of compiling, linking and running some LAPACK routines.

[fsuID_at_hpc-login-39 ~]$ gfortran lapack_prb.f -llapack

Here we are compiling a lapack test file which can be found at the website Dr. John Burkardt ( ).

Upon execution throught the command:


the user should get output which shows the successful testing of a number of the LAPACK subroutines

For more information about LAPACK subroutines, referencing, etc. the reader is referred to the LAPACK documentation page ( ).


When considering LAPACK type operations one can also use ATLAS, OpenBLAS, and MKL. ATLAS is provided in "C and Fortran77 interfaces to a portably efficient BLAS implementation". OpenBLAS provides an "opensource implementation of BLAS with many hand-crafted optimizations for specific processor types". All of these libraries are provided in


Finally MKL "is a library of optimized math routines for science, engineering, and financial applications" which uses BLAS and LAPACK. This is only available in the intel compiler. You must therefore run the intel module through the command,
module load intel
Then you can link all appropriate libraries and options through the following commands,

[fsuID_at_hpc-login-39 ~]$ icc -g mklBLAS.c -DMKL_ILP64 
-openmp -L/gpfs/research/software/intel/new/mkl/lib/lib64 
-lmkl_intel_ilp64 -lmkl_core -lmkl_intel_thread -lmkl_blas95_ilp64    
-lmkl_blacs_ilp64 -lpthread -lm


icc mklBLAS.o -DMKL_ILP64 -openmp 
-lmkl_intel_ilp64 -lmkl_core -lmkl_intel_thread -lmkl_blas95_ilp64 
-lmkl_blacs_ilp64 -lpthread -lm

For a reference to linking information for mol the reader is referred to the resource