LAPACK is a library of Fortran subroutines for solving the most commonly occurring problems in numerical linear algebra.
It is important to note that the BLAS functions included in LAPACK (libblas.so and liblapack.so) are distinct to those within OpenBLAS. Do not try to swap out OpenBLAS with LAPACK, or vice versa.
Some applications or libraries may need a specific version of LAPACK. The guide below shows how to configure and compile a specific version of LAPACK into your own directory.
Note that we have found that when attempting to link applications against LAPACK 3.12.1 we see missing symbol errors - this appears to have been reported by at least one Linux distribution (ARCH) missing several symbols (see 1, and 2) but appears to not have been fixed upstream.
Either use LAPACK 3.12.0, or > 3.12.1, when it is released.
#!/bin/bash
LAPACK_DIR=$HOME/lapack
echo "Download Lapack ..."
echo "==================="
wget -q https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.12.0.tar.gz -O 3.2.0.tgz
echo ""
echo "Untar ..."
echo "========="
tar -zxf 3.2.0.tgz
echo ""
echo "Load modules ..."
echo "================"
module purge
module load GCC/13.3.0
echo ""
echo "Configure ..."
echo "============="
cd lapack-3.12.0
rm -rf build
mkdir build
cd build
CFLAGS="-O2 -pipe -march=znver5"
cmake .. -DCMAKE_INSTALL_PREFIX=$LAPACK_DIR
echo ""
echo "Compile ..."
echo "==========="
make -j2
echo ""
echo "Install ..."
make install
To compile code using this specific version of LAPACK you will need to point to the files at $HOME/lapack/lib64. Most users will not need to install LAPACK from source, but this quick guide is for those that do.