[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: octave, arpack, umfpack
From: |
John W. Eaton |
Subject: |
Re: octave, arpack, umfpack |
Date: |
Wed, 17 Nov 2010 13:01:03 -0500 |
On 17-Nov-2010, sibu xolo wrote:
| On Wednesday 17 November 2010 06:54:28 Ananda Murthy R S wrote:
| > Can you please mention on which distribution of Linux are you trying to
| > compile?
|
| I am using cblfs compiled from sources and 64-bit non multilib. Here is an
| update I had prepared to post to the maintner list I hoped to join:-
|
| I am compiling on a machine with the following:-
| ----cpu amd64 2cores
| ----o/s cblfs linux 64-bit non-multilib kernel-2.6.32, gcc-4.4.2
| ----BLAS: atlas3.9.32 SuiteSparse-3.4.0 lapack-3.2.2 arpac-0.92 (autoconf'ed)
|
| AND this is what happens:-
| Both SuiteSparse and arpac are compiled to give shared and statc libs and
| linked to atlas and lapack libraries. They are available at the locations
| shown below:-
|
| ---------------- arpack and umfpack locations:-
| rt [ ~ ]# ls -l /home/rt/ArpackTEST3/lib
| total 1000
| -rw-r--r-- 1 rt users 662720 Nov 16 23:46 libarpack.a
| lrwxrwxrwx 1 rt users 14 Nov 16 23:46 libarpack.so -> libarpack.so.9
| -rwxr-xr-x 1 rt users 350904 Nov 16 23:46 libarpack.so.0.9.2
| lrwxrwxrwx 1 rt users 18 Nov 16 23:46 libarpack.so.9 -> libarpack.so.0.9.2
| rt [ ~ ]#
|
|
| rt [ ~ ]# ls -l /usr/local/algebra/lib/libumfpack*
| lrwxrwxrwx 1 root root 15 Nov 17 12:49
usr/local/algebra/lib/libumfpack.so
| -> libumfpack.so.5
| lrwxrwxrwx 1 root root 19 Nov 17 12:49
| usr/local/algebra/lib/libumfpack.so.5 -> libumfpack.so.5.2.0
| -rwxr-xr-x 1 root root 708862 Nov 17 12:44
| usr/local/algebra/lib/libumfpack.so.5.2.0
| rt [ ~ ]#
| rt [ ~ ]# ls -l /usr/local/algebra/static_lib/libumfpack*
| -rw-r--r-- 1 root root 1328178 Nov 17 12:45
| usr/local/algebra/static_lib/libumfpack.a
| rt [ ~ ]#
| --------------------------
|
| I then ran the configure script for octave-3.3.53 with the folowing
| switches:-
|
| --with-umfpack-includedir=/usr/local/algebra/include \
| --with-umfpack-libdir=/usr/local/algebra/static_lib \
| --with-arpack-libdir=/home/rt/ArpackTEST3/lib \
| --with-arpack-includedir=/home/rt/ArpackTEST3/include
|
|
| -------------it responds as shown below:-
| configure: WARNING: UMFPACK not found. This will result in some lack of
| functionality for sparse matrices.
| configure: WARNING: ARPACK not found. The eigs function will be disabled.
| ------------------
|
| The rest of the SparseSuite components including libcholmod are found but
not
| umfpack. Also if arpac is compiled and not linked to atlas it is 'found'.
| I am wondering if there is a problem octave-3.3.53 has with libraries
| already linked to atlas and lapack (compiled with gfortan) and if there is
| whether a fix upstream exists or otherwise.
|
| I very much want to have octave compiled with umfpack and arpack
| functionality and linked to BLAS and LAPACK libraries so advice would be
| appreciasted.
The following works for me:
ARPACK (http://www.caam.rice.edu/software/ARPACK)
In ARmake.inc set the following variables:
home=path to directory ARPACK
FC=gfortran
FFLAGS=-fPIC -O
MAKE=make
ARPACKLIB=$(home)/libarpack.a
DIRS=$(UTILdir) $(SRCdir)
Edit the file UTIL/second.f and change the line
EXTERNAL ETIME
to
INTRINSIC ETIME
After building .a library, you can make a shared version with
mkdir tmp
cd tmp
ar x ../libarpack.a
gcc -shared -o ../libarpack.so *.o -L$prefix64/lib -llapack -lblas
cd ..
rm -rf tmp
Copy the library libarpack.so to $prefix/lib/libarpack.a.
SUITESPARSE (http://www.cise.ufl.edu/research/sparse/SuiteSparse)
In UFconfig/UFconfig.mk use the following options for CFLAGS and F77FLAGS:
CC = gcc
CFLAGS = -fPIC -O
F77 = gfortran
F77FLAGS = -fPIC -O
BLAS = -lblas -lgfortran
LAPACK = -llapack
Disable the GPL-incompatible METIS library:
CHOLMOD_CONFIG = -DNPARTITION
SPQR_CONFIG = -DNPARTITION
METIS_PATH =
METIS =
Run make to build the libraries.
The SuiteSparse Makefile does not have an install target so you must
install the files by hand:
cp {AMD,BTF,CAMD,CCOLAMD,CHOLMOD,COLAMD,CXSparse,UMFPACK}/Lib/lib*a
$prefix/lib
mkdir $prefix/include/suitesparse
cp {AMD,BTF,CAMD,CCOLAMD,CHOLMOD,COLAMD,CXSparse,UMFPACK}/Include/*h
UFconfig/UFconfig.h $prefix64/include/suitesparse
You can generate shared versions of these libraries by doing the
following in the $prefix64/lib directory:
top=$(pwd)
for f in *.a; do
mkdir tmp
cd tmp
ar vx ../$f
gcc -shared -o ../${f%%.a}.so *.o
cd $top
rm -rf tmp
done
I did the above and put the suitesparse libraries in
/tmp/suitesparse/lib and the suitesparse include files in
/tmp/suitesparse/include/suitesparse and the arpack library in
/tmp/arpack. Then I configured Octave with
./configure CPPFLAGS=-I/tmp/suitesparse/include \
LDFLAGS="-L/tmp/suitesparse/lib -L/tmp/arpack"
and it worked for me. I also tried
./configure --with-amd-includedir=/tmp/suitesparse/include \
--with-amd-libdir=/tmp/suitesparse/lib \
--with-camd-includedir=/tmp/suitesparse/include \
--with-camd-libdir=/tmp/suitesparse/lib \
--with-colamd-includedir=/tmp/suitesparse/include \
--with-colamd-libdir=/tmp/suitesparse/lib \
--with-ccolamd-includedir=/tmp/suitesparse/include \
--with-ccolamd-libdir=/tmp/suitesparse/lib \
--with-cholmod-includedir=/tmp/suitesparse/include \
--with-cholmod-libdir=/tmp/suitesparse/lib \
--with-cxsparse-includedir=/tmp/suitesparse/include \
--with-cxsparse-libdir=/tmp/suitesparse/lib \
--with-umfpack-includedir=/tmp/suitesparse/include \
--with-umfpack-libdir=/tmp/suitesparse/lib \
--with-arpack-libdir=/tmp/arpack
and it also worked for me.
Note that if you use the --with-X-libdir and --with-X-includedir
options and you installed the suitesparse libraries and header files
in a location where the compiler will not find them by default, then
you must specify all the --with options for all the libraries since
some of them depend on others. Currently there are no options like
--with-suitesparse-{include,lib}dir options that will set all the
other variables.
jwe
- octave, arpack, umfpack, sibu xolo, 2010/11/16
- Re: octave, arpack, umfpack, Ananda Murthy R S, 2010/11/17
- Re: octave, arpack, umfpack, sibu xolo, 2010/11/17
- Re: octave, arpack, umfpack,
John W. Eaton <=
- Re: octave, arpack, umfpack, sibu xolo, 2010/11/18
- Re: octave, arpack, umfpack, John W. Eaton, 2010/11/18
- Re: octave, arpack, umfpack, sibu xolo, 2010/11/19
- Re: octave, arpack, umfpack, John W. Eaton, 2010/11/19
- Re: octave, arpack, umfpack, sibu xolo, 2010/11/20