CLAPACK on Linux

This page gives some information on how to compile and install CLAPACK, the f2c‘ed version of LAPACK, on a Linux system.

From Source

tar xfz clapack.tgz
make f2clib

Edit and set BLASLIB to

BLASLIB = ../../libcblaswr.a -L/usr/lib/sse2 -lcblas -latlas

Compile the CBLAS wrapper and the lapack library.

make cblaswrap
make lapacklib
mv lapack_LINUX.a liblapack.a

To avoid having to link the CBLAS wrapper every time you want to use the LAPACK library, you can pack the wrapper’s functions into liblapack.a.

mkdir tmp
cd tmp
ar x ../libcblaswr.a
ar r ../liblapack.a *.o
cd ..
rm -rf tmp

Leave a Reply

Your email address will not be published.