# HG changeset patch # User jwe # Date 1129897829 0 # Node ID 17682e3fba2a11125e65c0f9cebd35c901e0d7f9 # Parent d0a24bfe4487df313613289d2bae166965261cc3 [project @ 2005-10-21 12:30:29 by jwe] diff -r d0a24bfe4487 -r 17682e3fba2a aclocal.m4 --- a/aclocal.m4 Fri Oct 21 12:25:17 2005 +0000 +++ b/aclocal.m4 Fri Oct 21 12:30:29 2005 +0000 @@ -860,3 +860,57 @@ AC_DEFINE(HAVE_IEEE754_DATA_FORMAT, 1, [Define if your system uses IEEE 754 data format.]) fi ]) +dnl +dnl Check for UMFPACK seperately split complex matrix and RHS. Note +dnl that as umfpack.h can be in three different places, rather than +dnl include it, just declare the functions needed. +dnl +dnl Assumes that +dnl +dnl ACX_CHECK_HEADER_IN_DIRS(umfpack.h, [umfpack ufsparse]) +dnl +dnl has already been called. +dnl +AC_DEFUN([OCTAVE_UMFPACK_SEPERATE_SPLIT], +[AC_MSG_CHECKING([for UMFPACK seperate complex matrix and rhs split]) +AC_CACHE_VAL(octave_cv_umfpack_seperate_split, +[AC_TRY_RUN([ +#include +#include <$acx_umfpack_h_include_file> +int n = 5; +int Ap[] = {0, 2, 5, 9, 10, 12}; +int Ai[] = {0, 1, 0, 2, 4, 1, 2, 3, 4, 2, 1, 4}; +double Ax[] = {2., 0., 3., 0., 3., 0., -1., 0., 4., 0., 4., 0., + -3., 0., 1., 0., 2., 0., 2., 0., 6., 0., 1., 0.}; +double br[] = {8., 45., -3., 3., 19.}; +double bi[] = {0., 0., 0., 0., 0.}; +int main (void) +{ + double *null = (double *) NULL ; + double *x = (double *)malloc (2 * n * sizeof(double)); + int i ; + void *Symbolic, *Numeric ; + (void) umfpack_zi_symbolic (n, n, Ap, Ai, Ax, null, &Symbolic, null, null) ; + (void) umfpack_zi_numeric (Ap, Ai, Ax, null, Symbolic, &Numeric, null, null) ; + umfpack_zi_free_symbolic (&Symbolic) ; + (void) umfpack_zi_solve (0, Ap, Ai, Ax, null, x, null, br, bi, + Numeric, null, null) ; + umfpack_zi_free_numeric (&Numeric) ; + for (i = 0; i < n; i++, x+=2) + if (fabs(*x - i - 1.) > 1.e-13) + return (1); + return (0) ; +} +], + octave_cv_umfpack_seperate_split=yes, + octave_cv_umfpack_seperate_split=no, + octave_cv_umfpack_seperate_split=no)]) +if test "$cross_compiling" = yes; then + AC_MSG_RESULT([$octave_cv_umfpack_seperate_split assumed for cross compilation]) +else + AC_MSG_RESULT($octave_cv_umfpack_seperate_split) +fi +if test "$octave_cv_umfpack_seperate_split" = yes; then + AC_DEFINE(UMFPACK_SEPARATE_SPLIT, 1, [Define if the UMFPACK Complex solver allow matrix and RHS to be split independently]) +fi +]) diff -r d0a24bfe4487 -r 17682e3fba2a acx_include_dirs.m4 --- a/acx_include_dirs.m4 Fri Oct 21 12:25:17 2005 +0000 +++ b/acx_include_dirs.m4 Fri Oct 21 12:30:29 2005 +0000 @@ -6,7 +6,7 @@ dnl dnl This macro requires autoconf 2.50 or later. dnl -dnl @version $Id: acx_include_dirs.m4,v 1.2 2005-09-15 19:52:50 jwe Exp $ +dnl @version $Id: acx_include_dirs.m4,v 1.3 2005-10-21 12:30:29 jwe Exp $ dnl @author David Bateman dnl AC_DEFUN([ACX_CHECK_HEADER_IN_DIRS], [ @@ -26,10 +26,21 @@ # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_include_ok" = xyes; then - acx_header=HEADER_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + acx_header=HEADER_`echo $1 | sed -e 's/[[^a-zA-Z0-9_]]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - ifelse([$3],,AC_DEFINE(${acx_header},$acx_include_dir/$1,[$5]),[$3]) + acx_header_name_for_variable=`echo $1 | sed -e 's/[[^a-zA-Z0-9_]]/_/g'` + eval acx_${acx_header_name_for_variable}_include_dir=$acx_include_dir + if test -n "$acx_include_dir"; then + eval acx_${acx_header_name_for_variable}_include_file=$acx_include_dir/$1 + else + eval acx_${acx_header_name_for_variable}_include_file=$1 + fi + ifelse([$3],,AC_DEFINE(${acx_header}, + [`eval echo '${'acx_${acx_header_name_for_variable}_include_file'}'`/$1], + [$5]),[$3]) +ifelse([$4],,,[ else $4 +]) fi ])dnl ACX_CHECK_HEADER_IN_DIRS diff -r d0a24bfe4487 -r 17682e3fba2a configure.in --- a/configure.in Fri Oct 21 12:25:17 2005 +0000 +++ b/configure.in Fri Oct 21 12:30:29 2005 +0000 @@ -29,7 +29,7 @@ EXTERN_CXXFLAGS="$CXXFLAGS" AC_INIT -AC_REVISION($Revision: 1.485 $) +AC_REVISION($Revision: 1.486 $) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([src/octave.cc]) AC_CONFIG_HEADER(config.h) @@ -755,21 +755,14 @@ UMFPACK_LIBS="-lumfpack -lcblas"; with_umfpack=yes], [], $AMD_LIBS -lcblas $BLAS_LIBS)], $AMD_LIBS $BLAS_LIBS $FLIBS)], $AMD_LIBS) if test "$with_umfpack" = yes; then - # For now the code needed for this is not in umfpack, will add - # a test later that will probably have to be based on version - # numbers as there is no interface changes that are visible at - # compile time. - with_umfpack_split=no - fi - - if test "$with_umfpack" = yes; then AC_DEFINE(HAVE_UMFPACK, 1, [Define if the UMFPACK library is used.]) if test x"$acx_include_dir" != x; then UMFPACK_INCLUDE=$acx_include_dir/umfpack.h fi - if test "$with_umfpack_split" = yes; then - AC_DEFINE(UMFPACK_SEPARATE_SPLIT, 1, [Define if the UMFPACK Complex solver allow matrix and RHS to be split independently]) - fi + OLD_LIBS=$LIBS + LIBS="$LIBS $UMFPACK_LIBS $AMD_LIBS $BLAS_LIBS $FLIBS" + OCTAVE_UMFPACK_SEPERATE_SPLIT + LIBS=$OLD_LIBS else warn_umfpack="UMFPACK not found. This will result in some lack of functionality for sparse matrices." fi],[