The BLAS and LAPACK libraries

From Planets
Revision as of 09:08, 24 May 2023 by Emillour (talk | contribs) (Created page with "The BLAS and LAPACK libraries are very common libraries useful for doing linear algebra operations involving matrices and vectors, .e.g. solving linear equation systems, doing...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The BLAS and LAPACK libraries are very common libraries useful for doing linear algebra operations involving matrices and vectors, .e.g. solving linear equation systems, doing SVD factorization, etc. In many case they are already installed and available Linux systems, but not always... and then you will have to download and install them yourself.

Obtaining the source code of the BLAS and LAPACK libraries

The Fortran source codes are available on Netlib.org : http://www.netlib.org/blas/ and http://www.netlib.org/lapack/

Compiling the libraries

Prerequisites

All you need are a Fortran compiler and the gmake utility

Compiling the BLAS library

Assuming you dowloaded the package in a "BLAS" directory, edit the make.inc to fit your settings, if needed and simply run

make

which should produce the static library blas_UNIX.a. It is good practice to usually use a different naming convention and call the library libblas.a so you can make a symbolic link to have both available:

ln -s blas_UNIX.a libblas.a


Compiling the LAPACK library

Assuming you dowloaded the package in a "LAPACK" directory