# Ubuntu – Installing a comprehensive LAPACK implementation under Ubuntu

cprogrammingsoftware installation

I would like to ask how to properly install a comprehensive LAPACK package
as e.g. is offered by the Gentoo package 'sci-libs/clapack' within a Ubuntu
environment.

I am not talking about atlas here, which only offers a small part of lapack
functionality, but a more general solution offering functions for e.g.
eigen value problems like 'dstegr'.

Here is what I achieved so far: My favorite search command

apt-file search clapack.h


offered only two possible sources.

libatlas-dev: /usr/include/atlas/clapack.h
libfreefem++-dev: /usr/include/freefem++/clapack.h


As mentioned, the atlas version is not, what I want. The libfreefem variation
on the other hand reads fine. So

apt-get install libfreefem++-dev


apt-cache search lapack


offers a lot, the most promising looking lines being

liblapack-dev - library of linear algebra routines 3 - static version
liblapack3gf - library of linear algebra routines 3 - shared version


the first package of which I installed. Now adding

#include <freefem++/clapack.h>


into my program returns an understandable long list of errors in the style

'integer', 'real', 'doublereal', … was not declared in this scope

as in fact they were not. Anyways I am not looking
is there really no such thing for Ubuntu?

Rereading my own post I believe the question might also be boiled down to
"Where can I obtain a comprehensive header file for 'liblapack-dev'"?

I got the same result by using package manager. I did the following:

sudo apt-get install libblas-dev checkinstall
sudo apt-get install libblas-doc checkinstall
sudo apt-get install liblapacke-dev checkinstall
sudo apt-get install liblapack-doc checkinstall


The libraries went in /usr/lib and the includes in /usr/include.

Thanks to Markus-Hermann for the example code in the previous post. It helped me test it out real quick. Using the default install directories I used the following command:

g++ svd_demo.cpp -I"/usr/include" -L"/usr/lib" -llapacke -lblas