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:
-
from the SuiteSparse directory, go to UFconfig directory and edit UFconfig.mk, and uncomment this option
# If you use CHOLMOD_CONFIG = -DNPARTITION then you must use the following
# options:
METIS_PATH =
METIS =
and add add this line
CHOLMOD_CONFIG = -DNPARTITION
- 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
b/gcc/x86_64-redhat-linux/4.1.1/
Somehow I got error that it couldn’t fine libgfortran, so I need to specify the location with the -L option. - Go back to SuiteSparse directory and type “make”. It will compile and run the test
- run this script SuiteSparse direcotry to install headers and libraries to your local directory.
#!/bin/bash
INSTALL_DIR=$HOME/usr/local
# Make sure the install directories exist
if !(test -d $INSTALL_DIR/include);
then
echo $INSTALL_DIR/include did not exist, creating $INSTALL_DIR/include
mkdir $INSTALL_DIR/include
fi;
if !(test -d $INSTALL_DIR/include/suitesparse);
then
echo $INSTALL_DIR/include/suitesparse did not exist, creating $INSTALL_DIR/include/suitesparse
mkdir $INSTALL_DIR/include/suitesparse
fi;
if !(test -d $INSTALL_DIR/lib);
then
echo $INSTALL_DIR/lib did not exist, creating $INSTALL_DIR/lib
mkdir $INSTALL_DIR/lib
fi;
# 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
- 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.
Advertisements
Filed under: Uncategorized | 5 Comments »