comparison configure.ac @ 26991:c188513f5496

configure: disable building with SUNDIALS when the API is too old (bug #55937) * acinclude.m4 (OCTAVE_CHECK_SUNDIALS_COMPATIBLE_API): New macro to test for sets of required SUNDIALS functions. * configure.ac: Use it to determine whether to disable SUNDIALS.
author Mike Miller <mtmiller@octave.org>
date Wed, 27 Mar 2019 13:48:50 -0700
parents 8f819b00b28e
children 05f389459461
comparison
equal deleted inserted replaced
26990:4612f8a71e47 26991:c188513f5496
2205 [ida/ida.h ida.h], [IDAInit], 2205 [ida/ida.h ida.h], [IDAInit],
2206 [], [don't use SUNDIALS IDA library, solvers ode15i and ode15s will be disabled], 2206 [], [don't use SUNDIALS IDA library, solvers ode15i and ode15s will be disabled],
2207 [warn_sundials_ida= 2207 [warn_sundials_ida=
2208 OCTAVE_CHECK_SUNDIALS_SIZEOF_REALTYPE 2208 OCTAVE_CHECK_SUNDIALS_SIZEOF_REALTYPE
2209 OCTAVE_CHECK_SUNDIALS_SUNLINSOL_DENSE 2209 OCTAVE_CHECK_SUNDIALS_SUNLINSOL_DENSE
2210 OCTAVE_CHECK_SUNDIALS_SUNLINSOL_KLU]) 2210 OCTAVE_CHECK_SUNDIALS_SUNLINSOL_KLU
2211 OCTAVE_CHECK_SUNDIALS_COMPATIBLE_API])
2211 LIBS="$save_LIBS" 2212 LIBS="$save_LIBS"
2212 2213
2213 dnl Define this way instead of with an #if in oct-conf-post.h so that 2214 dnl Define this way instead of with an #if in oct-conf-post.h so that
2214 dnl the build features script will get the correct value. 2215 dnl the build features script will get the correct value.
2215 dnl 2216 dnl
2218 dnl any tests fail, or can we fix __ode15__.cc so that it still partially 2219 dnl any tests fail, or can we fix __ode15__.cc so that it still partially
2219 dnl works when some things are missing (for example, KLU)? 2220 dnl works when some things are missing (for example, KLU)?
2220 if test -n "$SUNDIALS_IDA_LIBS" \ 2221 if test -n "$SUNDIALS_IDA_LIBS" \
2221 && test -n "$SUNDIALS_NVECSERIAL_LIBS" \ 2222 && test -n "$SUNDIALS_NVECSERIAL_LIBS" \
2222 && test $octave_cv_sundials_sunlinsol_dense = yes \ 2223 && test $octave_cv_sundials_sunlinsol_dense = yes \
2223 && test $octave_cv_sundials_realtype_is_double = yes; then 2224 && test $octave_cv_sundials_realtype_is_double = yes \
2225 && test $octave_have_sundials_compatible_api = yes; then
2224 AC_DEFINE(HAVE_SUNDIALS, 1, [Define to 1 if SUNDIALS is available.]) 2226 AC_DEFINE(HAVE_SUNDIALS, 1, [Define to 1 if SUNDIALS is available.])
2225 2227
2226 ## Collections of options needed to build with SUNDIALS and its dependencies. 2228 ## Collections of options needed to build with SUNDIALS and its dependencies.
2227 SUNDIALS_XCPPFLAGS="$SUNDIALS_IDA_CPPFLAGS $SUNDIALS_SUNLINSOLKLU_CPPFLAGS $SUNDIALS_NVECSERIAL_CPPFLAGS $KLU_CPPFLAGS" 2229 SUNDIALS_XCPPFLAGS="$SUNDIALS_IDA_CPPFLAGS $SUNDIALS_SUNLINSOLKLU_CPPFLAGS $SUNDIALS_NVECSERIAL_CPPFLAGS $KLU_CPPFLAGS"
2228 SUNDIALS_XLDFLAGS="$SUNDIALS_IDA_LDFLAGS $SUNDIALS_SUNLINSOLKLU_LDFLAGS $SUNDIALS_NVECSERIAL_LDFLAGS $KLU_LDFLAGS" 2230 SUNDIALS_XLDFLAGS="$SUNDIALS_IDA_LDFLAGS $SUNDIALS_SUNLINSOLKLU_LDFLAGS $SUNDIALS_NVECSERIAL_LDFLAGS $KLU_LDFLAGS"
2231 SUNDIALS_IDA_CPPFLAGS= 2233 SUNDIALS_IDA_CPPFLAGS=
2232 SUNDIALS_IDA_LDFLAGS= 2234 SUNDIALS_IDA_LDFLAGS=
2233 SUNDIALS_IDA_LIBS= 2235 SUNDIALS_IDA_LIBS=
2234 SUNDIALS_SUNLINSOLKLU_CPPFLAGS= 2236 SUNDIALS_SUNLINSOLKLU_CPPFLAGS=
2235 SUNDIALS_SUNLINSOLKLU_LDFLAGS= 2237 SUNDIALS_SUNLINSOLKLU_LDFLAGS=
2236 SUNDIALS_SUNLINSOLKLU_LIBS 2238 SUNDIALS_SUNLINSOLKLU_LIBS=
2237 SUNDIALS_NVECSERIAL_CPPFLAGS= 2239 SUNDIALS_NVECSERIAL_CPPFLAGS=
2238 SUNDIALS_NVECSERIAL_LDFLAGS= 2240 SUNDIALS_NVECSERIAL_LDFLAGS=
2239 SUNDIALS_NVECSERIAL_LIBS= 2241 SUNDIALS_NVECSERIAL_LIBS=
2240 SUNDIALS_XCPPFLAGS= 2242 SUNDIALS_XCPPFLAGS=
2241 SUNDIALS_XLDFLAGS= 2243 SUNDIALS_XLDFLAGS=
2245 fi 2247 fi
2246 2248
2247 AC_SUBST(SUNDIALS_XCPPFLAGS) 2249 AC_SUBST(SUNDIALS_XCPPFLAGS)
2248 AC_SUBST(SUNDIALS_XLDFLAGS) 2250 AC_SUBST(SUNDIALS_XLDFLAGS)
2249 AC_SUBST(SUNDIALS_XLIBS) 2251 AC_SUBST(SUNDIALS_XLIBS)
2250
2251 save_LIBS="$LIBS"
2252 LIBS="$SUNDIALS_XLIBS $LIBS"
2253 ## Current interface:
2254 AC_CHECK_FUNCS([IDASetJacFn IDASetLinearSolver SUNLinSol_Dense SUNLinSol_KLU])
2255 ## Deprecated interface:
2256 AC_CHECK_HEADERS([ida/ida_direct.h ida_direct.h])
2257 AC_CHECK_FUNCS([IDADlsSetJacFn IDADlsSetLinearSolver SUNDenseLinearSolver SUNKLU])
2258 LIBS="$save_LIBS"
2259 2252
2260 ### Check for ARPACK library. 2253 ### Check for ARPACK library.
2261 2254
2262 save_LIBS="$LIBS" 2255 save_LIBS="$LIBS"
2263 LIBS="$LAPACK_LIBS $BLAS_LIBS $FLIBS $LIBS" 2256 LIBS="$LAPACK_LIBS $BLAS_LIBS $FLIBS $LIBS"