help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Enabling SuiteSparse support during compile (Linux)


From: Stuart Nolan
Subject: Enabling SuiteSparse support during compile (Linux)
Date: Tue, 24 Apr 2007 22:45:49 -0400 (EDT)

Sean,

I might have a solution.  First let me say that I have not fully
tested this solution to make sure I have not broken something ('make
check' after a successful octave-2.9.10 compile returned 3 errors in
from the test_sparse.m routine) nor am I actively involved in the
development of octave, suitesparse, or metis.  Perhaps someone else on
help-octave list could take a look what I've done, make a better
solution, etc...

That being said, I think there are two minor issues with metis:

1) The log2 function defined in metis.h appears to conflict with the
   log2 function found elsewhere (on my system, I think in
   /usr/include/bits/mathcalls.h).  To fix this, apply the patch found
   at 
http://www.aero.polimi.it/~masarati/Download/mbdyn/metis-namespace-cleanup.patch
   e.g. after saving metis-namespace-cleanup.patch in the directory
   containing the metis-4.0 directory, issue the command (in the same
   directory as the patch file):

   patch -p0 <metis-namespace-cleanup.patch

2) In metis.h, several local include files are treated as standard
   include files.  To fix this, save the following text (ending at
   +#include "proto.h") to a file called metis-include.patch:

--- metis-4.0.orig/Lib/metis.h  1998-11-30 11:26:50.000000000 -0500
+++ metis-4.0/Lib/metis.h       2007-04-24 20:17:45.000000000 -0400
@@ -29,9 +29,9 @@
 #include <dmalloc.h>
 #endif
 
-#include <defs.h>
-#include <struct.h>
-#include <macros.h>
-#include <rename.h>
-#include <proto.h>
+#include "defs.h"
+#include "struct.h"
+#include "macros.h"
+#include "rename.h"
+#include "proto.h"
 
   Then in the directory containing metis-4.0, issue the command:

   patch -p0 <metis-include.patch

After applying the patches, recompile metis and suitesparse (after a
'make clean' for metis and suitesparse) and rerun the script refereed
by John Swensen below.  For octave, 'make clean', 'configure', 'make',
'make check', and 'make install' all worked for me on my gentoo box.

hope this helps...

Stu.

PS I've attached the file sptest.log in the hope that someone more
knowledgeable than I can figure out the 3 failed tests in test_sparse.m.


>Yes, I've used rpms on slackware before, but it's always been just
>installing a pre-built rpm.  Thanks for the tip, but in the end, I
>decided to "go with what I know", and use the script John Swensen
>pointed me to on octave-forge.
>
>Things seemed to be going pretty well, and I have all the dependencies
>compiled and installed now.  At least, I think I do.  I am still running
>into a compile problem though.  Here's the error message I'm getting,
>and I hope you all can help me figure out the problem:
>
>gcc -c  -I. -I.. -I../liboctave -I../src -I../libcruft/misc
>-DHAVE_CONFIG_H -mieee-fp -Wall -W -Wshadow -Wcast-align -Wcast-qual
>-Wmissing-prototypes -Wpointer-arith -Wstrict-prototypes -Wwrite-strings
>-g -O2 main.c -o main.o
>g++  -I. -I.. -I../liboctave -I../src -I../libcruft/misc
>-DHAVE_CONFIG_H -mieee-fp -Wall -W -Wshadow -Wold-style-cast
>-Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Weffc++ -g -O2
>-rdynamic \
>        -L..  -fPIC  -o octave \
>        main.o  \
>        -L../liboctave -L../libcruft -L../src -Wl,-rpath
>-Wl,/usr/local/lib/octave-2.9.10 \
>        -loctinterp -loctave  -lcruft    \
>         -lumfpack -lamd -lcamd -lcolamd \
>        -lcholmod -lccolamd -lcxsparse -llapack /usr/local/lib/libgoto.a \
>        -lfftw3 -lreadline  -lncurses -ldl -lhdf5 -lz -lm  -larpack
>-L/usr/lib/gcc/i486-slackware-linux/3.4.6
>-L/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../i486-slackware-linux/lib
>-L/usr/lib/gcc/i486-slackware-linux/3.4.6/../../.. -lhdf5 -lz -lfrtbegin
>-lg2c -lm
>../liboctave/liboctave.so: undefined reference to `METIS_NodeND'
>../liboctave/liboctave.so: undefined reference to
>`METIS_NodeComputeSeparator'
>collect2: ld returned 1 exit status
>make[2]: *** [octave] Error 1
>make[2]: Leaving directory `/pub/src/octave-2.9.10/src'
>make[1]: *** [src] Error 2
>make[1]: Leaving directory `/pub/src/octave-2.9.10'
>make: *** [all] Error 2
>
>
>I am using metis-4.0, and it's files are installed under /usr/local/lib
>and /usr/local/include.
>
>Cheers,
>Sean
>
>David Bateman wrote:
>> Theo. Sean Schulze wrote:
>>> Thanks, I'll try it.  The linux and the Mac OS X files systems are
>>> similar, so it might work.  If it doesn't, a little tuning might do the
>>> trick.
>>>
>> 
>> 
>> I believe slackware can use RPMs. So take the fedora SRPM rebuild it and
>> install it and then rebuild octave. Cut and paste instructions
>> 
>> wget
>> ftp://mirror.switch.ch/mirror/fedora/linux/extras/6/SRPMS/ufsparse-2.1.1-1.fc6.src.rpm
>> rpm -Uvh ufsparse-2.1.1-1.fc6.src.rpm
>> cd /usr/src/RPM/SPECS
>> rpm -ba ufsparse.spec
>> cd ../RPMS/
>> find . -name "ufsparse*" | xargs rpm -Uvh
>> 
>> Rinse and repeat octave build
>> 
>> D.
>> 
>> 
>> 
>>> Sean
>>>
>>> John Swensen wrote:
>>>> There is a simple little script that I used from the wiki to copy
>>>> everything from the SuiteSparse compile directory to /usr/local.  You
>>>> can find it at :
>>>> http://wiki.octave.org/wiki.pl?OctaveForMac
>>>>
>>>> At least on my Mac, this copied everything necessary for Octave to find
>>>> all the sparse libraries.
>>>>
>>>> John Swensen
>>>>
>>>>
>>>>
>>>> Theo. Sean Schulze wrote:
>>>>> Sorry,
>>>>>
>>>>> I had also meant to include this output from ./configure:
>>>>>
>>>>> Octave is now configured for i686-pc-linux-gnu
>>>>>
>>>>>   Source directory:     .
>>>>>   Installation prefix:  /usr/local
>>>>>   C compiler:           gcc  -mieee-fp  -Wall -W -Wshadow -Wcast-align
>>>>> -Wcast-qual -Wmissing-prototypes -Wpointer-arith -Wstrict-prototypes
>>>>> -Wwrite-strings -g -O2
>>>>>   C++ compiler:         g++  -mieee-fp  -Wall -W -Wshadow
>>>>> -Wold-style-cast -Wcast-align -Wcast-qual -Wpointer-arith
>>>>> -Wwrite-strings -Weffc++ -g -O2
>>>>>   Fortran compiler:     g77 -O -mieee-fp
>>>>>   Fortran libraries:     -L/usr/lib/gcc/i486-slackware-linux/3.4.6
>>>>> -L/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../i486-slackware-linux/lib
>>>>>
>>>>> -L/usr/lib/gcc/i486-slackware-linux/3.4.6/../../.. -lz -lfrtbegin
>>>>> -lg2c -lm
>>>>>   BLAS libraries:       -llapack /usr/local/lib/libgoto.a
>>>>>   FFTW libraries:
>>>>>   GLPK libraries:
>>>>>   UMFPACK libraries:
>>>>>   AMD libraries:        -lamd
>>>>>   CAMD libraries:       -lcamd
>>>>>   COLAMD libraries:
>>>>>   CCOLAMD libraries:
>>>>>   CHOLMOD libraries:
>>>>>   CXSPARSE libraries:
>>>>>   ARPACK libraries:
>>>>>   HDF5 libraries:
>>>>>   CURL libraries:       -lcurl
>>>>>   REGEX libraries:      -lpcre
>>>>>   LIBS:                 -lreadline  -lncurses -ldl -lz -lm
>>>>>   Default pager:        less
>>>>>   gnuplot:              gnuplot
>>>>>
>>>>>   Do internal array bounds checking:  false
>>>>>   Build static libraries:             false
>>>>>   Build shared libraries:             true
>>>>>   Dynamic Linking:                    true (dlopen)
>>>>>   Include support for GNU readline:   true
>>>>>   64-bit array dims and indexing:     false
>>>>>
>>>>> configure: WARNING: I didn't find gperf, but it's only a problem if you
>>>>> need to reconstruct oct-gperf.h
>>>>> configure: WARNING: UMFPACK not found.  This will result in some lack of
>>>>> functionality for sparse matrices.
>>>>> configure: WARNING: COLAMD not found. This will result in some lack of
>>>>> functionality for sparse matrices.
>>>>> configure: WARNING: CCOLAMD not found. This will result in some lack of
>>>>> functionality for sparse matrices.
>>>>> configure: WARNING: CHOLMOD not found. This will result in some lack of
>>>>> functionality for sparse matrices.
>>>>> configure: WARNING: CXSparse not found. This will result in some lack of
>>>>> functionality for sparse matrices.
>>>>> configure: WARNING: FFTW library not found.  Octave will use the
>>>>> (slower) FFTPACK library instead.
>>>>> configure: WARNING: HDF5 library not found.  Octave will not be able to
>>>>> save or load HDF5 data files.
>>>>> configure:
>>>>>
>>>>> NOTE: libraries may be skipped if a library is not found OR
>>>>>       if the library on your system is missing required features.
>>>>>
>>>>> Regards,
>>>>> Sean
>>>>>
>>>>> Theo. Sean Schulze wrote:
>>>>>  
>>>>>> Hello,
>>>>>>
>>>>>> I compiled octave 2.9.10 the other day on my slackware linux box, but
>>>>>> when I did the tests, I got a number of failures, many of which were
>>>>>> with sparse matrix functions.  So, I went to the trouble of getting the
>>>>>> SuiteSparce and its dependencies GotoBLAS, LAPACK, and metis.  I
>>>>>> compiled them all.  Install was not really that straight forward for me,
>>>>>> because I am used to software packages that copy the libraries created
>>>>>> to /usr/local/lib/ when I run `make install`.  I ended up copying
>>>>>> several of the lib*.a files to /usr/local/lib by hand, but for the most
>>>>>> part, at least up to compiling SuiteSparse, it seemed to work.
>>>>>>
>>>>>> I am frustrated now though, because despite the fact that I copied every
>>>>>> *.a file I could find in the SuiteSparse package to both directly into
>>>>>> /usr/local/lib and into the /usr/local/lib using the subdirectory
>>>>>> structure that occurs in the SuiteSparse source directory (./AMD/,
>>>>>> ./BTF/, etc.), configure still can not find the libraries or header
>>>>>> files it is looking for.  I have even copied the entire SuiteSparse
>>>>>> source directory into the octave source directory, but that hasn't
>>>>>> worked either.
>>>>>>
>>>>>> Clearly there is something about the compiling and installing process
>>>>>> that I don't understand, and I would be grateful for some pointers on
>>>>>> what I am doing wrong.
>>>>>>
>>>>>> BTW, is it standard among mathematical packages that `make install` just
>>>>>> leaves the files resulting from the compile in the source directory?
>>>>>>
>>>>>> Regards,
>>>>>> Sean
>>>>>>
>>>>>>     
>>>>> _______________________________________________
>>>>> Help-octave mailing list
>>>>> Help-octave at octave.org
>>>>> https://www.cae.wisc.edu/mailman/listinfo/help-octave
>>>>>
>>>>>   
>> 
>> 





_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]