Help installing Octave (linux-generic)

Last modified: Sun Jan 15 23:17:31 EST 2012


Overview

Successfully building Octave and its mandatory dependencies has become tricky.  These instructions were last validated on 2012-01-15 with gcc 4.6.2 for the versions of software indicated below on 32-bit Slackware Linux 13.37.

Lapack 3.4.0 (released 2011-11-11)

Source:  http://www.netlib.org/lapack/

Lapack does not have an autoconf build process.  Copy make.inc.example (or the identical INSTALL/make.inc.gfortran) to make.inc and add –fPIC to the gfortran commands:

*** make.inc~   2012-01-15 19:46:54.566387743 -0500
--- make.inc    2012-01-15 19:49:20.806387687 -0500
***************
*** 12,22 ****
  #  selected.  Define LOADER and LOADOPTS to refer to the loader and 
  #  desired load options for your machine.
  #
! FORTRAN  = gfortran 
  OPTS     = -O2
  DRVOPTS  = $(OPTS)
  NOOPT    = -O0
! LOADER   = gfortran
  LOADOPTS =
  #
  # Timer for the SECOND and DSECND routines
--- 12,22 ----
  #  selected.  Define LOADER and LOADOPTS to refer to the loader and 
  #  desired load options for your machine.
  #
! FORTRAN  = gfortran -fPIC
  OPTS     = -O2
  DRVOPTS  = $(OPTS)
  NOOPT    = -O0
! LOADER   = gfortran -fPIC
  LOADOPTS =
  #
  # Timer for the SECOND and DSECND routines

make blaslib lapacklib
su
mkdir /usr/local/lapack-3.4.0
install -t /usr/local/lapack-3.4.0 -m 644 liblapack.a librefblas.a

Atlas 3.8.4 (released 2011-05-14)

Source:  http://math-atlas.sourceforge.net/

Use –fPIC, but do not build or install shared libs.  The shared libs don't include "full LAPACK," which breaks the Octave build.

mkdir foo
cd foo
../ATLAS/configure -Fa alg -fPIC --prefix=/usr/local/atlas-3.8.4 \
                   --with-netlib-lapack=/usr/local/lapack-3.4.0/liblapack.a
# make -j fails with race conditions
make
su
make install

Fltk 1.3.0 (released 2011-06-16)

Source:  http://www.fltk.org/

Fltk is for optional native graphics in Octave.  It will build against nVidia's GL libs if they are present.

./configure --prefix=/usr/local/fltk-1.3.0 CFLAGS="-fPIC" CXXFLAGS="-fPIC"
make
su
make install

For ~/.bash_profile:

export PATH=/usr/local/fltk-1.3.0/bin:${PATH}
export MANPATH=/usr/local/fltk-1.3.0/share/man:${MANPATH}

Octave 3.4.3 (released 2011-10-10)

Source:  http://www.octave.org/

Any errors output by configure can be highly misleading.  You must read the log to find out what actually happened.

./configure --prefix=/usr/local/octave-3.4.3 \
  --with-fltk-prefix=/usr/local/fltk-1.3.0 \
  CPPFLAGS="-I/usr/local/atlas-3.8.4/include" \
  LDFLAGS="-L/usr/local/atlas-3.8.4/lib"
make
su
make install

Many optional dependencies were skipped, with the following consequences:

configure: WARNING: UMFPACK not found.  This will result in some lack of functionality for sparse matrices.
configure: WARNING: qrupdate not found.  The QR & Cholesky updating functions will be slow.
configure: WARNING: AMD library not found.  This will result in some lack of functionality for sparse matrices.
configure: WARNING: COLAMD library not found.  This will result in some lack of functionality for sparse matrices.
configure: WARNING: CCOLAMD library not found.  This will result in some lack of functionality for sparse matrices.
configure: WARNING: CHOLMOD library not found.  This will result in some lack of functionality for sparse matrices.
configure: WARNING: CXSparse library not found.  This will result in some lack of functionality for sparse matrices.
configure: WARNING: cURL library not found.  The ftp objects, urlread and urlwrite functions will be disabled.
configure: WARNING: GLPK library not found.  The glpk function for solving linear programs will be disabled.
configure: WARNING: GraphicsMagick++ library not found.  The imread function for reading image files will not be fully functional.
configure: WARNING: HDF5 library not found.  Octave will not be able to save or load HDF5 data files.
configure: WARNING: Qhull library not found -- this will result in loss of functionality of some geometry functions.

For ~/.bash_profile:

export PATH=/usr/local/octave-3.4.3/bin:${PATH}
export MANPATH=/usr/local/octave-3.4.3/share/man:${MANPATH}
export INFOPATH=/usr/local/octave-3.4.3/share/info:${INFOPATH}

Extra packages can be obtained from http://octave.sourceforge.net/ and installed by doing pkg install whatever.tar.gz from the Octave prompt (as root).


KB
Home