Installation of BLAS/LAPACK

LAPACK is a library of Fortran subroutines for solving the most commonly occurring problems in numerical linear algebra. LAPACK reference implementation is available on GitHub, corresponding releases are available on netlib. It is worth noting that there are further implementations of BLAS/LAPACK libraries, such as OpenBLAS and Intel MKL,

LAPACK and BLAS are packaged and distributed by distros such as Debian, Ubuntu, Pop!OS, CentOS and others. It is recommended to install these packages using apt or yum package managers. They can be installed on Debian or Ubuntu systems using the following commands.

        sudo apt update && sudo apt upgrade
        sudo apt install libblas3 libblas-dev
        sudo apt install liblapack3 liblapack-dev

Below is a short summary of instructions on how to compile and install LAPACK by hand (for the case you wish to do so).

How to compile and install LAPACK by hand

First clone the LAPACK repository. And configure cmake to build lapack as a shared library. The following commands will result in a set of .so files or shared library files installed in the path specified with CMAKE_INSTALL_LIBDIR flag :

        cd lapack
        mkdir build
        cd build
        cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_LIBDIR=$HOME/.local/lapack ../
        make install
After successful execution of above set of commands, a list of .so files such as,,, are generated.

Interfacing deal.II to LAPACK

Support for LAPACK will be enabled automatically if a system wide installation of LAPACK can be found. To use a self compiled version, specify

when invoking cmake, for example,
        git clone
        cd dealii
        mkdir build
        cd build
        cmake -DDEAL_II_WITH_LAPACK=ON -DLAPACK_DIR=$HOME/.local/lapack/ ../

You can override the autodetection by manually setting


Valid HTML 4.01! Valid CSS!