# HG changeset patch # User Carlo de Falco # Date 1552460590 -3600 # Node ID d94876e7a0aa3770e1bfd3c691222eab036a3786 # Parent ba0c9e84f6a86c7101df3680c66ea5afc590e86c Remove calls to deprecated sundials functions. * libinterp/dldfcn/__ode15__.cc : Simplify list of includes and remove use of deprecated functions. * m4/acinclude.m4 : do not check for headers that are not actually included diff -r ba0c9e84f6a8 -r d94876e7a0aa libinterp/dldfcn/__ode15__.cc --- a/libinterp/dldfcn/__ode15__.cc Wed Mar 13 05:54:28 2019 +0000 +++ b/libinterp/dldfcn/__ode15__.cc Wed Mar 13 08:03:10 2019 +0100 @@ -41,31 +41,18 @@ #if defined (HAVE_SUNDIALS) -# if defined (HAVE_IDA_IDA_H) -# include +# if defined (HAVE_NVECTOR_NVECTOR_SERIAL_H) +# include # endif -# if defined (HAVE_SUNDIALS_SUNDIALS_MATRIX_H) -# include -# endif - -# if defined (HAVE_SUNDIALS_SUNDIALS_LINEARSOLVER_H) -# include +# if defined (HAVE_IDA_IDA_H) +# include # endif # if defined (HAVE_SUNLINSOL_SUNLINSOL_DENSE_H) # include # endif -# if defined (HAVE_IDA_IDA_DIRECT_H) -# include -# endif - -# if defined (HAVE_SUNDIALS_SUNDIALS_SPARSE_H) -# include -# endif - - # if defined (HAVE_SUNLINSOL_SUNLINSOL_KLU_H) # if defined (HAVE_KLU_H) # include @@ -82,10 +69,6 @@ # include # endif -# if defined (HAVE_NVECTOR_NVECTOR_SERIAL_H) -# include -# endif - static inline realtype * nv_data_s (N_Vector& v) { @@ -263,7 +246,7 @@ void jacsparse_impl (realtype t, realtype cj, N_Vector& yy, N_Vector& yyp, SUNMatrix& Jac); -#endif +# endif void set_maxstep (realtype maxstep); @@ -366,7 +349,7 @@ if (havejacsparse) { -#if defined (HAVE_SUNDIALS_SUNLINSOL_KLU) +# if defined (HAVE_SUNDIALS_SUNLINSOL_KLU) // FIXME : one should not allocate space for a full Jacobian // when using a sparse format. Consider allocating less space // then possibly using SUNSparseMatrixReallocate to increase it. @@ -374,14 +357,14 @@ if (! sunJacMatrix) error ("Unable to create sparse Jacobian for Sundials"); - sunLinearSolver = SUNKLU (yy, sunJacMatrix); + sunLinearSolver = SUNLinSol_KLU (yy, sunJacMatrix); if (! sunLinearSolver) error ("Unable to create KLU sparse solver"); - if (IDADlsSetLinearSolver (mem, sunLinearSolver, sunJacMatrix)) + if (IDASetLinearSolver (mem, sunLinearSolver, sunJacMatrix)) error ("Unable to set sparse linear solver"); - IDADlsSetJacFn (mem, IDA::jacsparse); + IDASetJacFn (mem, IDA::jacsparse); # else error ("SUNDIALS SUNLINSOL KLU is not available in this version of Octave"); @@ -395,14 +378,14 @@ if (! sunJacMatrix) error ("Unable to create dense Jacobian for Sundials"); - sunLinearSolver = SUNDenseLinearSolver (yy, sunJacMatrix); + sunLinearSolver = SUNLinSol_Dense (yy, sunJacMatrix); if (! sunLinearSolver) error ("Unable to create dense linear solver"); - if (IDADlsSetLinearSolver (mem, sunLinearSolver, sunJacMatrix)) + if (IDASetLinearSolver (mem, sunLinearSolver, sunJacMatrix)) error ("Unable to set dense linear solver"); - if (havejac && IDADlsSetJacFn (mem, IDA::jacdense) != 0) + if (havejac && IDASetJacFn (mem, IDA::jacdense) != 0) error ("Unable to set dense Jacobian function"); } @@ -470,7 +453,7 @@ END_INTERRUPT_WITH_EXCEPTIONS; } -#endif +# endif ColumnVector IDA::NVecToCol (N_Vector& v, long int n) diff -r ba0c9e84f6a8 -r d94876e7a0aa m4/acinclude.m4 --- a/m4/acinclude.m4 Wed Mar 13 05:54:28 2019 +0000 +++ b/m4/acinclude.m4 Wed Mar 13 08:03:10 2019 +0100 @@ -2239,16 +2239,13 @@ dnl enabled. dnl AC_DEFUN([OCTAVE_CHECK_SUNDIALS_SUNLINSOL_KLU], [ - AC_CHECK_HEADERS([sundials/sundials_sparse.h sunlinsol/sunlinsol_klu.h]) + AC_CHECK_HEADERS([sunlinsol/sunlinsol_klu.h]) AC_CACHE_CHECK([whether SUNDIALS IDA is configured with SUNLINSOL_KLU enabled], [octave_cv_sundials_sunlinsol_klu], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #if defined (HAVE_IDA_IDA_H) #include #endif - #if defined (HAVE_SUNDIALS_SUNDIALS_SPARSE_H) - #include - #endif #if defined (HAVE_KLU_H) #include #endif @@ -2283,21 +2280,16 @@ dnl The IDADENSE API was removed in SUNDIALS version 3.0.0. dnl AC_DEFUN([OCTAVE_CHECK_SUNDIALS_SUNLINSOL_DENSE], [ - AC_CHECK_HEADERS([sunlinsol/sunlinsol_dense.h sundials/sundials_matrix.h sundials/sundials_linearsolver.h ida/ida_direct.h]) + AC_CHECK_HEADERS([sunlinsol/sunlinsol_dense.h]) AC_CACHE_CHECK([whether SUNDIALS IDA includes the SUNLINSOL_DENSE linear solver], [octave_cv_sundials_sunlinsol_dense], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #if defined (HAVE_IDA_IDA_H) #include #endif - #if defined (HAVE_SUNDIALS_SUNDIALS_MATRIX_H) - #include + #if defined (HAVE_SUNLINSOL_SUNLINSOL_DENSE_H) + #include #endif - #if defined (HAVE_SUNDIALS_SUNDIALS_LINEARSOLVER_H) - #include - #endif - #if defined (HAVE_IDA_IDA_DIRECT_H) - #include #endif ]], [[ void *mem = 0;