Difference between revisions of "Lapack compilation"
import>Jss43 |
import>Jss43 |
||
Line 1: | Line 1: | ||
− | + | I had some problems using the atlas modules, which seem to be not applicable to all machines (e.g. 64-bit P4s). I compiled my own lapack routines (available from [http://www.netlib.org]. Their documentation is wrong in certain places, but it's kind of obvious what paths they refer to. As Catherine [http://www-theor.ch.cam.ac.uk/IT/software/atlas.html notes], it's not worth doing much tuning, so I just used the bog-standard f77 configuration. I installed it in ~/src/lib/lapack-3.1.1: |
|
<pre> |
<pre> |
Revision as of 15:26, 5 July 2008
I had some problems using the atlas modules, which seem to be not applicable to all machines (e.g. 64-bit P4s). I compiled my own lapack routines (available from [1]. Their documentation is wrong in certain places, but it's kind of obvious what paths they refer to. As Catherine notes, it's not worth doing much tuning, so I just used the bog-standard f77 configuration. I installed it in ~/src/lib/lapack-3.1.1:
jss43@keiko:~/src/lib> wget -O - http://www.netlib.org/lapack/lapack.tgz | tar xvzf - # Download and extract to lapack-3.1.1 jss43@keiko:~/src/lib> cd lapack-3.1.1 jss43@keiko:~/src/lib/lapack-3.1.1> cp make.inc.example make.inc # Use g77 configuration. Other examples exist in the INSTALL directory. jss43@keiko:~/src/lib/lapack-3.1.1> make # A (cursory) glance at the docs implies this makes everything (including BLAS). [reams of output] g77: ../../blas_LINUX.a: No such file or directory # FIBBERS! jss43@keiko:~/src/lib/lapack-3.1.1> cd BLAS/SRC && make && cd ../../ # Fine, we'll make BLAS ourselves... jss43@keiko:~/src/lib/lapack-3.1.1> make # ...and finish the job.
The last make command takes a while to run, so it's worth having a cup of tea as you wait.
The makefile also runs tests which passed. The libraries are blas_LINUX.a and lapack_LINUX.a, so we can link to them to give them more standard names:
jss43@keiko:~/src/lib/lapack-3.1.1> ln -s lapack_LINUX.a liblapack.a jss43@keiko:~/src/lib/lapack-3.1.1> ln -s blas_LINUX.a libblas.a
These can now be used in compilation by using:
-L ~/src/lib/lapack-3.1.1 -llapack -lblas
in the link line. This is somewhat platform dependent though, so we can make it even easier to use by using enviroment modules to reduce the link line to:
-llapack -lblas