changeset 26909:5042a568771a

don't disable all of sundials if including sunlinsol_klu.h fails (bug #55911) * configure.ac (HAVE_SUNDIALS): Don't disable sundials if sunlinsol_klu.h is missing or unusable. * acinclude.m4 (OCTAVE_CHECK_SUNDIALS_SUNLINSOL_KLU): Don't define HAVE_SUNDIALS_SUNLINSOL_KLU if sunlinsol_klu.h is missing or unusable. * __ode15__.cc: Make inline definition of replacement for SUNLinSol_KLU conditional.
author John W. Eaton <jwe@octave.org>
date Thu, 14 Mar 2019 07:05:22 +0000
parents 6bd408bde569
children 075c4d3bf1de
files configure.ac libinterp/dldfcn/__ode15__.cc m4/acinclude.m4
diffstat 3 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Thu Mar 14 06:25:42 2019 +0000
+++ b/configure.ac	Thu Mar 14 07:05:22 2019 +0000
@@ -2219,7 +2219,6 @@
 dnl works when some things are missing (for example, KLU)?
 if test -n "$SUNDIALS_IDA_LIBS" \
     && test -n "$SUNDIALS_NVECSERIAL_LIBS" \
-    && test "x$ac_cv_header_sunlinsol_sunlinsol_klu_h" = xyes \
     && test $octave_cv_sundials_sunlinsol_dense = yes \
     && test $octave_cv_sundials_realtype_is_double = yes; then
   AC_DEFINE(HAVE_SUNDIALS, 1, [Define to 1 if SUNDIALS is available.])
--- a/libinterp/dldfcn/__ode15__.cc	Thu Mar 14 06:25:42 2019 +0000
+++ b/libinterp/dldfcn/__ode15__.cc	Thu Mar 14 07:05:22 2019 +0000
@@ -100,12 +100,14 @@
 }
 #  endif
 
-#  if ! defined (HAVE_SUNLINSOL_KLU) && defined (HAVE_SUNKLU)
+#  if defined (HAVE_SUNDIALS_SUNLINSOL_KLU)
+#    if ! defined (HAVE_SUNLINSOL_KLU) && defined (HAVE_SUNKLU)
 static inline SUNLinearSolver
 SUNLinSol_KLU (N_Vector y, SUNMatrix A)
 {
   return SUNKLU (y, A);
 }
+#    endif
 #  endif
 
 static inline realtype *
--- a/m4/acinclude.m4	Thu Mar 14 06:25:42 2019 +0000
+++ b/m4/acinclude.m4	Thu Mar 14 07:05:22 2019 +0000
@@ -2269,11 +2269,12 @@
       octave_cv_sundials_sunlinsol_klu=yes,
       octave_cv_sundials_sunlinsol_klu=no)
     ])
-  if test $octave_cv_sundials_sunlinsol_klu = yes; then
+  if test $octave_cv_sundials_sunlinsol_klu = yes \
+     && test "x$ac_cv_header_sunlinsol_sunlinsol_klu_h" = xyes; then
     AC_DEFINE(HAVE_SUNDIALS_SUNLINSOL_KLU, 1,
       [Define to 1 if SUNDIALS IDA is configured with SUNLINSOL_KLU enabled.])
   else
-    warn_sundials_sunlinsol_klu="SUNDIALS IDA library not configured with SUNLINSOL_KLU, ode15i and ode15s will not support the sparse Jacobian feature"
+    warn_sundials_sunlinsol_klu="SUNDIALS IDA library not configured with SUNLINSOL_KLU or sunlinksol_klu.h is not usable; ode15i and ode15s will not support the sparse Jacobian feature"
     OCTAVE_CONFIGURE_WARNING([warn_sundials_sunlinsol_klu])
   fi
 ])