Install LAPACKE (Ubuntu)

Prerequisites:

  1. C/C++ compiler

Summary of what you are going to install:

  1. BLAS
  2. Lapack
  3. Lapacke

Summary of the commands:

sudo apt-get update
sudo apt-get install liblapack3
sudo apt-get install liblapack-dev
sudo apt-get install libopenblas-base
sudo apt-get install libopenblas-dev
sudo apt-get install liblapacke-dev

sudo apt-get install liblapack-dev

Lapack was originally written in Fortran F90. Lapack uses BLAS, a collection of low level functions for vector and matrix related algebra operations. Lapacke is a wrapper for C/C++.

This tutorial explains how to install BLAS, Lapack and Lapacke. Note that installation of Lapacke is relatively complex and some things could go wrong. It is not recommended to compile the libraries by hand.

The following is a baseline for installation procedure:

Step 1 – Install necessary libraries

$ sudo apt-get install liblapack3
$ sudo apt-get install liblapack-dev
$ sudo apt-get install libopenblas-base
$ sudo apt-get install libopenblas-dev
$ sudo apt-get install liblapacke-dev

Step 2 – Install static linking libraries if needed

$ sudo apt-get install liblapack-dev

Step 3 – Add the necessary linking flags to gcc/g++

-lm -lblas -llapack -llapacke

 

References:

Leave a Reply