I want to run a matlab code in ubuntu 12.04 in which error is coming that liblapack.so shared library file is missing. How to get this file installed and from where can I get this file.Please help me please its urgent.


Simply install the following

 sudo apt-get install libatlas3-base


If you do

 sudo apt-cache search liblapack.so

You will find 2 files, install one then and you will have liblapack.so

 liblapack3 - Library of linear algebra routines 3 - shared version
 libatlas3-base - Automatically Tuned Linear Algebra Software, generic shared

You can find liblapack.so.3 for either quantal or raring (liblapack for precise is not available) at the following URLs:

You can find liblapack3 for precise (Ubuntu 12.04) in this PPA: ppa:andrikos/ppa

Save the package, open the compressed package with Archive Manager, and browse the archive to find the liblapack.so.3 file.

In Ubuntu 14.04 and beyond, you can install liblapack3 directly from the default Ubuntu repositories.


As others have suggested, if you can install the relevant package on your system, that is the best approach. But perhaps you are not able to do that.

If you can get hold of a correct copy of liblapack.so anywhere on your system, you can just add that directory to your LD_LIBRARY_PATH - there is no need to officially 'install' it on your system.

One option is to compile lapack yourself. Unfortunately, it is a little difficult to do so. By default, it will create a non-shared file liblapack.a, and that is not sufficient in many cases. (For me, python's scipy insisted on the .so file).

I used cmake to compile lapack for a shared objects (.so) as suggested by this comment. I had tried many other things first, but I found it easier to compile and install cmake locally than to try to build lapack.so without cmake!

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/lapack-3.5.0 -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=ON ../lapack-3.5.0 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.