|
From: | Francesco Faccio |
Subject: | Patch for SUNDIALS IDA library |
Date: | Sat, 30 Jul 2016 23:07:38 +0000 |
Dear all, -library klu (already existent in Octave inside SuiteSparse) ### Check for SUNDIALS_IDA library and header.
save_CPPFLAGS="$CPPFLAGS" save_LIBS="$LIBS" CPPFLAGS="$KLU_CPPFLAGS $CPPFLAGS" LIBS="$KLU_LDFLAGS $KLU_LIBS $LIBS" OCTAVE_CHECK_LIB(sundials_ida, SUNDIALS_IDA, [SUNDIALS_IDA library configured with klu not found. Solvers ode15i and ode15s will be disabled.], [ida/ida.h ida.h], [IDAKLU], [], [], [warn_sundials_ida= OCTAVE_CHECK_SIZEOF_SUNDIALS_IDA_REALTYPE]) LIBS="$save_LIBS" CPPFLAGS="$save_CPPFLAGS" I tested if Sundials has been configured with a double precision for realtype with this macro: AC_DEFUN([OCTAVE_CHECK_SIZEOF_SUNDIALS_IDA_REALTYPE], [
AC_CACHE_CHECK([whether sundials_ida is configured with double precision realtype], [octave_cv_sizeof_ida_double], AC_LANG_PUSH(C++) [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #if defined (HAVE_IDA_IDA_H) #include <ida/ida.h> #else #include <ida.h> #endif #include <assert.h> ]], [[ assert (sizeof (double) == sizeof (realtype)); ]])], octave_cv_sizeof_ida_double=yes, octave_cv_sizeof_ida_double=no) ]) if test $octave_cv_sizeof_ida_double = yes; then AC_DEFINE(HAVE_SUNDIALS_IDA_DOUBLE, 1, [Define to 1 if sundials_ida is configured with realtype as double.]) else warn_sundials_ida="sundials_ida library found, but it's not configured with double precision realtype; function ode15i and ode15s will be disabled" fi ]) If variable HAVE_SUNDIALS_IDA_DOUBLE is not set, ode15{i,s} are disabled. Finally I tested for library sundials_nvecserial and if not found printed a warning message and disabled ode15{i,s}. If the user wants to install klu or sundials in non-standard paths, she can specify include and lib flags while configuring Octave. Is this the right approach? Which other events could happen to make me disable ode15{i,s}? If some SuiteSparse library is not installed, a warning message is printed during the configuration of Octave, saying that there is a lack of functionality for sparse matrices. Should I check for amd, colamd (other libraries?) flags and, in case, disable my solver? Thank you, Francesco |
[Prev in Thread] | Current Thread | [Next in Thread] |