Standard software library for linear algebra.
LAPACK requires an environment module
In order to use LAPACK, you must first load the appropriate environment module:
module load gnu
As described in the LAPACK website:
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 aforementioned.
Using LAPACK on HPC Cluster#
On the HPC cluster, LAPACK can be used by linking your source code to the various LAPACK libraries located in
Once linked, you can utilize various LAPACK subroutines. Below we have a simple example of compiling, linking and running some LAPACK routines.
Here we are compiling a lapack test file. Upon executing the command "
./a.out", the user should get output which, shows
the successful testing of a number of the LAPACK subroutines.
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 the
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
module load intel.
Then, you can link all appropriate libraries and options through the following commands:
- For more information about LAPACK subroutines, referencing, etc.: http://www.netlib.org/lapack/lug/
- For linking information for