Correct LAPACK installation

Hello,

I just found this website, I am completely new to Fortran90 and in desperate need of some help. I want to use a Fortran-based code that requires me to install LAPACK and then point to the right directory in my make.inc file as seen below:

LAPACKDIR=
LAPACKLIBS=-L${LAPACKDIR}/lib -llapack -lblas

I followed the instructions in Installing LAPACK on a Unix System to install Fortran (version LAPACK — Linear Algebra PACKage); however, I do not see anywhere in my “lapack-3.11” directory a “lib” subdirectory. So I am not sure how to tell my code where to look for LAPACK…

It seems like I’m stuck right at the beginning; without correctly installing this, I cannot move on to testing the actual code. I would really appreciate some help on this. Thank you in advance.

Most linux distributions provide lapack and blas as system libraries. Often there will be a choice of optimized libraries. These are much less work, and are usually faster, than building your own.

For example, Ubuntu 22.04 LTS offers these for amd64

File Packages
/usr/lib/R/lib/liblapack.so revolution-mkl
/usr/lib/x86_64-linux-gnu/atlas/liblapack.so libatlas-base-dev
/usr/lib/x86_64-linux-gnu/lapack/liblapack.so liblapack-dev
/usr/lib/x86_64-linux-gnu/mkl/liblapack.so libmkl-dev
/usr/lib/x86_64-linux-gnu/openblas-openmp/liblapack.so libopenblas-openmp-dev
/usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so libopenblas-pthread-dev
/usr/lib/x86_64-linux-gnu/openblas-serial/liblapack.so libopenblas-serial-dev

You may already have one or more installed. You make need to modify paths to link them and find them at run time.

You will need to do some research to see what is available for your system and works with your Fortran compiler.

1 Like

I tried linking the installed blas and lapack to /usr/local/lib and then calling them from that lib when compiling with fortran. It looks like it is working, thank you very much for your help!