Installing Octave with UMFPACK from Source

if you are not using Ubuntu and need to compile the UMFPACK manually, download the SuiteSparse package at this page. I didn’t use METIS, so I need to disable it first. Follow the instruction at the README.txt on how to disable it. This is the step btw:

  1. from the SuiteSparse directory, go to UFconfig directory and edit, and uncomment this option

    # If you use CHOLMOD_CONFIG = -DNPARTITION then you must use the following
    # options:
    METIS =

    and add add this line

  2. Since I’m compiling for linux, I choose this compiler alternative option.

    CFLAGS = -O3 -fexceptions -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -L/usr/li

    Somehow I got error that it couldn’t fine libgfortran, so I need to specify the location with the -L option.
  3. Go back to SuiteSparse directory and type “make”. It will compile and run the test
  4. run this script SuiteSparse direcotry to install headers and libraries to your local directory.

    # Make sure the install directories exist
    if !(test -d $INSTALL_DIR/include);
    echo $INSTALL_DIR/include did not exist, creating $INSTALL_DIR/include
    mkdir $INSTALL_DIR/include
    if !(test -d $INSTALL_DIR/include/suitesparse);
    echo $INSTALL_DIR/include/suitesparse did not exist, creating $INSTALL_DIR/include/suitesparse
    mkdir $INSTALL_DIR/include/suitesparse
    if !(test -d $INSTALL_DIR/lib);
    echo $INSTALL_DIR/lib did not exist, creating $INSTALL_DIR/lib
    mkdir $INSTALL_DIR/lib
    # Copy all the files to the new directories
    echo Copying UMFPACK files into $INSTALL_DIR...
    cp UFconfig/UFconfig.h $INSTALL_DIR/include/suitesparse
    cp UMFPACK/Include/*.h $INSTALL_DIR/include/suitesparse
    cp UMFPACK/Lib/libumfpack.a $INSTALL_DIR/lib
    ranlib $INSTALL_DIR/lib/libumfpack.a
    echo Copying AMD files into $INSTALL_DIR/...
    cp AMD/Include/*.h $INSTALL_DIR/include/suitesparse
    cp AMD/Lib/libamd.a $INSTALL_DIR/lib
    ranlib $INSTALL_DIR/lib/libamd.a
    echo Copying CAMD files into $INSTALL_DIR/...
    cp CAMD/Include/*.h $INSTALL_DIR/include/suitesparse
    cp CAMD/Lib/libcamd.a $INSTALL_DIR/lib
    ranlib $INSTALL_DIR/lib/libcamd.a
    echo Copying COLAMD files into $INSTALL_DIR/...
    cp COLAMD/Include/*.h $INSTALL_DIR/include/suitesparse
    cp COLAMD/Lib/libcolamd.a $INSTALL_DIR/lib
    ranlib $INSTALL_DIR/lib/libcolamd.a
    echo Copying CCOLAMD files into $INSTALL_DIR/...
    cp CCOLAMD/Include/*.h $INSTALL_DIR/include/suitesparse
    cp CCOLAMD/Lib/libccolamd.a $INSTALL_DIR/lib
    ranlib $INSTALL_DIR/lib/libccolamd.a
    echo Copying CXSPARSE files into $INSTALL_DIR/...
    cp CHOLMOD/Include/*.h $INSTALL_DIR/include/suitesparse
    cp CHOLMOD/Lib/libcholmod.a $INSTALL_DIR/lib
    ranlib $INSTALL_DIR/lib/libcholmod.a
    echo Copying CHOLMOD files into $INSTALL_DIR/...
    cp CXSparse/Include/*h $INSTALL_DIR/include/suitesparse
    cp CXSparse/Lib/libcxsparse.a $INSTALL_DIR/lib
    ranlib $INSTALL_DIR/lib/libcxsparse.a
    echo Copying METIS files into $INSTALL_DIR/...
    cp metis-4.0/Lib/*.h $INSTALL_DIR/include/suitesparse
    cp metis-4.0/libmetis.a $INSTALL_DIR/lib
    ranlib $INSTALL_DIR/lib/libmetis.a
  5. Go to octave-3.0.0 source directory. and type

    ./configure CPPFLAGS=-I$HOME/usr/local/include/suitesparse LDFLAGS=-L$HOME/usr/local/lib/ --prefix=$HOME/programs/Octave3.0

    where I decide to install it into my $HOME/programs/Octave3.0 directory.