Mercurial > hg > octave-lojdl
changeset 9572:ab8a163f2052
use OCTAVE_CHECK_LIB to check for UMFPACK
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 26 Aug 2009 16:41:38 -0400 |
parents | 263a8ed419b0 |
children | be3ee885739b |
files | ChangeLog Makeconf.in configure.in octave-bug.cc.in octave-bug.in src/ChangeLog src/oct-conf.h.in src/toplev.cc |
diffstat | 8 files changed, 59 insertions(+), 37 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-08-26 John W. Eaton <jwe@octave.org> + + * configure.in: Use OCTAVE_CHECK_LIBRARY to check for UMFPACK. + * octave-bug.in, octave-bug.cc.in: Substitute UMFPACK_CPPFLAGS and + UMFPACK_LDFLAGS. + * Makeconf.in (UMFPACK_CPPFLAGS, UMFPACK_LDFLAGS): New variables. + (do-subst-config-vals): Substitute them. + 2009-08-26 John W. Eaton <jwe@octave.org> * configure.in: Use OCTAVE_CHECK_LIBRARY to check for qrupdate.
--- a/Makeconf.in +++ b/Makeconf.in @@ -286,6 +286,8 @@ CXSPARSE_LDFLAGS = @CXSPARSE_LDFLAGS@ CXSPARSE_LIBS = @CXSPARSE_LIBS@ +UMFPACK_CPPFLAGS = @UMFPACK_CPPFLAGS@ +UMFPACK_LDFLAGS = @UMFPACK_LDFLAGS@ UMFPACK_LIBS = @UMFPACK_LIBS@ OPENGL_LIBS = @OPENGL_LIBS@ @@ -674,6 +676,8 @@ -e "s|%OCTAVE_CONF_STATIC_LIBS%|\"${STATIC_LIBS}\"|" \ -e "s|%OCTAVE_CONF_TERM_LIBS%|\"${TERM_LIBS}\"|" \ -e "s|%OCTAVE_CONF_UGLY_DEFS%|\"${UGLY_DEFS}\"|" \ + -e "s|%OCTAVE_CONF_UMFPACK_CPPFLAGS%|\"${UMFPACK_CPPFLAGS}\"|" \ + -e "s|%OCTAVE_CONF_UMFPACK_LDFLAGS%|\"${UMFPACK_LDFLAGS}\"|" \ -e "s|%OCTAVE_CONF_UMFPACK_LIBS%|\"${UMFPACK_LIBS}\"|" \ -e "s|%OCTAVE_CONF_USE_64_BIT_IDX_T%|\"${USE_64_BIT_IDX_T}\"|" \ -e "s|%OCTAVE_CONF_VERSION%|\"${version}\"|" \
--- a/configure.in +++ b/configure.in @@ -878,46 +878,37 @@ # Check for UMFPACK library. -UMFPACK_LIBS= -AC_SUBST(UMFPACK_LIBS) - -AC_ARG_WITH(umfpack, - [AS_HELP_STRING([--without-umfpack], - [don't use UMFPACK, disable some sparse functionality])], - with_umfpack=$withval, with_umfpack=yes) - -warn_umfpack="UMFPACK not found. This will result in some lack of functionality for sparse matrices." -if test "$with_umfpack" = yes && test "$with_amd" = yes; then - with_umfpack=no - AC_CHECK_HEADERS([suitesparse/umfpack.h ufsparse/umfpack.h umfpack/umfpack.h umfpack.h], [ - AC_CHECK_LIB(umfpack, umfpack_zi_get_determinant, [ - UMFPACK_LIBS="-lumfpack"; with_umfpack=yes], [ - ## Invalidate the cache. - $as_unset ac_cv_lib_umfpack_umfpack_zi_get_determinant - AC_CHECK_LIB(umfpack, umfpack_zi_get_determinant, [ - UMFPACK_LIBS="-lumfpack"; with_umfpack=yes], [ +save_LIBS="$LIBS" +LIBS="$AMD_LDFLAGS $AMD_LIBS $BLAS_LIBS $FLIBS $LIBS" +OCTAVE_CHECK_LIBRARY(umfpack, UMFPACK, + [UMFPACK not found. This will result in some lack of functionality for sparse matrices.], + [suitesparse/umfpack.h ufsparse/umfpack.h umfpack/umfpack.h umfpack.h], + [umfpack_zi_get_determinant], + [], [don't use UMFPACK, disable some sparse functionality]) +LIBS="$save_LIBS" - ## Invalidate the cache. - $as_unset ac_cv_lib_umfpack_umfpack_zi_get_determinant - AC_CHECK_LIB(umfpack, umfpack_zi_get_determinant, [ - 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 - AC_DEFINE(HAVE_UMFPACK, 1, [Define if the UMFPACK library is used.]) - OLD_LIBS=$LIBS - LIBS="$LIBS $UMFPACK_LIBS $AMD_LIBS $BLAS_LIBS $FLIBS" - OCTAVE_UMFPACK_SEPERATE_SPLIT - LIBS=$OLD_LIBS - TEXINFO_UMFPACK="@set HAVE_UMFPACK" - warn_umfpack= - fi - break]) -fi -if test -n "$warn_umfpack"; then - AC_MSG_WARN($warn_umfpack) +if test -z "$UMFPACK_LIBS"; then + ## Invalidate the cache and try again with -lcblas. + $as_unset ac_cv_lib_umfpack_umfpack_zi_get_determinant + save_LIBS="$LIBS" + LIBS="-lcblas $AMD_LDFLAGS $AMD_LIBS $BLAS_LIBS $FLIBS $LIBS" + OCTAVE_CHECK_LIBRARY(umfpack, UMFPACK, + [UMFPACK not found. This will result in some lack of functionality for sparse matrices.], + [suitesparse/umfpack.h ufsparse/umfpack.h umfpack/umfpack.h umfpack.h], + [umfpack_zi_get_determinant], + [], [don't use UMFPACK, disable some sparse functionality]) + if test -n "$UMFPACK_LIBS"; then + UMFPACK_LIBS="$UMFPACK_LIBS -lcblas" + fi + LIBS="$save_LIBS" fi -AC_SUBST(TEXINFO_UMFPACK) +if test -n "$UMFPACK_LIBS"; then + save_LIBS="$LIBS"; + LIBS="$UMFPACK_LIBS $AMD_LIBS $BLAS_LIBS $FLIBS $LIBS" + OCTAVE_UMFPACK_SEPERATE_SPLIT + LIBS="$save_LIBS" +fi save_LIBS="$LIBS" LIBS="$LAPACK_LIBS $BLAS_LIBS $FLIBS $LIBS"
--- a/octave-bug.cc.in +++ b/octave-bug.cc.in @@ -153,6 +153,8 @@ vars["READLINE_LIBS"] = %OCTAVE_CONF_READLINE_LIBS%; vars["REGEX_LIBS"] = %OCTAVE_CONF_REGEX_LIBS%; vars["TERM_LIBS"] = %OCTAVE_CONF_TERM_LIBS%; + vars["UMFPACK_CPPFLAGS"] = %OCTAVE_CONF_UMFPACK_CPPFLAGS%; + vars["UMFPACK_LDFLAGS"] = %OCTAVE_CONF_UMFPACK_LDFLAGS%; vars["UMFPACK_LIBS"] = %OCTAVE_CONF_UMFPACK_LIBS%; vars["X11_INCFLAGS"] = %OCTAVE_CONF_X11_INCFLAGS%; vars["X11_LIBS"] = %OCTAVE_CONF_X11_LIBS%;
--- a/octave-bug.in +++ b/octave-bug.in @@ -105,6 +105,8 @@ READLINE_LIBS=%OCTAVE_CONF_READLINE_LIBS% REGEX_LIBS=%OCTAVE_CONF_REGEX_LIBS% TERM_LIBS=%OCTAVE_CONF_TERM_LIBS% +UMFPACK_CPPFLAGS=%OCTAVE_CONF_UMFPACK_CPPFLAGS% +UMFPACK_LDFLAGS=%OCTAVE_CONF_UMFPACK_LDFLAGS% UMFPACK_LIBS=%OCTAVE_CONF_UMFPACK_LIBS% X11_INCFLAGS=%OCTAVE_CONF_X11_INCFLAGS% X11_LIBS=%OCTAVE_CONF_X11_LIBS%
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-08-26 John W. Eaton <jwe@octave.org> + + * oct-conf.h.in: New defines for UMFPACK_CPPFLAGS and UMFPACK_LDFLAGS. + * toplev.cc (octave_config_info): Include them in the list. + 2009-08-26 John W. Eaton <jwe@octave.org> * oct-conf.h.in: New defines for QRUPDATE_CPPFLAGS and QRUPDATE_LDFLAGS.
--- a/src/oct-conf.h.in +++ b/src/oct-conf.h.in @@ -485,6 +485,14 @@ #define OCTAVE_CONF_UGLY_DEFS %OCTAVE_CONF_UGLY_DEFS% #endif +#ifndef OCTAVE_CONF_UMFPACK_CPPFLAGS +#define OCTAVE_CONF_UMFPACK_CPPFLAGS %OCTAVE_CONF_UMFPACK_CPPFLAGS% +#endif + +#ifndef OCTAVE_CONF_UMFPACK_LDFLAGS +#define OCTAVE_CONF_UMFPACK_LDFLAGS %OCTAVE_CONF_UMFPACK_LDFLAGS% +#endif + #ifndef OCTAVE_CONF_UMFPACK_LIBS #define OCTAVE_CONF_UMFPACK_LIBS %OCTAVE_CONF_UMFPACK_LIBS% #endif
--- a/src/toplev.cc +++ b/src/toplev.cc @@ -1302,6 +1302,8 @@ { false, "STATIC_LIBS", OCTAVE_CONF_STATIC_LIBS }, { false, "TERM_LIBS", OCTAVE_CONF_TERM_LIBS }, { false, "UGLY_DEFS", OCTAVE_CONF_UGLY_DEFS }, + { false, "UMFPACK_CPPFLAGS", OCTAVE_CONF_UMFPACK_CPPFLAGS }, + { false, "UMFPACK_LDFLAGS", OCTAVE_CONF_UMFPACK_LDFLAGS }, { false, "UMFPACK_LIBS", OCTAVE_CONF_UMFPACK_LIBS }, { false, "USE_64_BIT_IDX_T", OCTAVE_CONF_USE_64_BIT_IDX_T }, { false, "X11_INCFLAGS", OCTAVE_CONF_X11_INCFLAGS },