Octave, GNU Octave, Matlab, Scientific Computing, Language, Interpreter, Compiler, C++, LAPACK, Fortran, Fun , GNU

Sunday, October 7, 2007

Compiling Octave from CVS

Compiling Octave from CVS, from version 2.9.x onwards, is possible only using GCC 4.x. This means a lot, really, because of GCC 4.x losing support for g77 (older FORTRAN compiler), and moving over the gfortran, the FORTRAN 95 compiler. So step 0, is to have GCC 4.x installed on your computer; either from apt-get install method, or if youre too old in system, install from sources.

Next try to recompile the following libraries from source,

1. BLAS
2. LAPACK
3. SuiteSparse

BLAS, and LAPACK can be downloaded from netlib.org, which need to be recompiled from
scratch using gfortran. Do the compilation in this order, as LAPACK depends on BLAS. Specific instructions include,

 tar zxf blas.tgz
tar zxf lapack-3.1.1.tgz
cd BLAS
gfortran -c -O2 *.f
ar rcv ../lapack-3.1.1/blas_LINUX.a *.o
cd ../lapack-3.1.1
cp INSTALL/make.inc.gfortran make.inc

due to John Eaton, from the help-octave mailing lists.

Next install SuiteSparse, this is a little involved like the previous installation
is not automated with GNU tools. I havent succeded in getting the whole thing from SuiteSparse picked up by the Octave configure script.

I had compiled BLAS, LAPACK and everything else falls into place like a
dovetail. No massaging scripts, no editing.

The exact configure lines I used (note, I installed to a local directory) are,


./configure --prefix=$HOME/GCC42/ --with-f77=gfortran --enable-shared
--disable-static --with-blas=$HOME/GCC42/lib/libblas.a
--with-lapack=$HOME/GCC42/lib/liblapack.a

Finally

$ make && make install

should wrap it up after a few hours ofcourse!
Cheers,
-Muthu

No comments:

Creative Commons License