Skip to content

Commit

Permalink
fixes bmcage#147: SUNDIALS_BLAS_LAPACK not present in sundials 6
Browse files Browse the repository at this point in the history
Signed-off-by: stuart-nolan <[email protected]>
  • Loading branch information
stuart-nolan committed Oct 9, 2023
1 parent 57466a9 commit ca3d3f4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions scikits/odes/sundials/c_sunlinsol.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ IF SUNDIALS_BLAS_LAPACK:
ctypedef _SUNLinearSolverContent_LapackDense *SUNLinearSolverContent_LapackDense

SUNLinearSolver SUNLinSol_LapackDense(N_Vector y, SUNMatrix A, SUNContext sunctx)
SUNLinearSolver SUNLapackDense(N_Vector y, SUNMatrix A) #deprecated

SUNLinearSolver_Type SUNLinSolGetType_LapackDense(SUNLinearSolver S)
SUNLinearSolver_ID SUNLinSolGetID_LapackDense(SUNLinearSolver S)
Expand All @@ -87,7 +86,6 @@ IF SUNDIALS_BLAS_LAPACK:
ctypedef _SUNLinearSolverContent_LapackBand *SUNLinearSolverContent_LapackBand

SUNLinearSolver SUNLinSol_LapackBand(N_Vector y, SUNMatrix A, SUNContext sunctx)
SUNLinearSolver SUNLapackBand(N_Vector y, SUNMatrix A) # deprecated

SUNLinearSolver_Type SUNLinSolGetType_LapackBand(SUNLinearSolver S)
SUNLinearSolver_ID SUNLinSolGetID_LapackBand(SUNLinearSolver S)
Expand Down
4 changes: 2 additions & 2 deletions scikits/odes/sundials/cvode.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ cdef class CVODE:
if SUNDIALS_BLAS_LAPACK:
if linsolver == 'lapackdense':
A = SUNDenseMatrix(N, N, self.sunctx)
LS = SUNLapackDense(self.y0, A)
LS = SUNLinSol_LapackDense(self.y0, A, self.sunctx)
# check if memory was allocated
if (A == NULL or LS == NULL):
raise ValueError('Could not allocate matrix or linear solver')
Expand All @@ -1591,7 +1591,7 @@ cdef class CVODE:
.format(flag))
elif linsolver == 'lapackband':
A = SUNBandMatrix(N, <int> opts['uband'], <int> opts['lband'], self.sunctx)
LS = SUNLapackBand(self.y0, A)
LS = SUNLinSol_LapackBand(self.y0, A, self.sunctx)
if (A == NULL or LS == NULL):
raise ValueError('Could not allocate matrix or linear solver')
flag = CVodeSetLinearSolver(cv_mem, LS, A)
Expand Down
4 changes: 2 additions & 2 deletions scikits/odes/sundials/ida.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1691,7 +1691,7 @@ cdef class IDA:
if SUNDIALS_BLAS_LAPACK:
if linsolver == 'lapackdense':
A = SUNDenseMatrix(N, N, self.sunctx)
LS = SUNLapackDense(self.y0, A)
LS = SUNLinSol_LapackDense(self.y0, A, self.sunctx)
# check if memory was allocated
if (A == NULL or LS == NULL):
raise ValueError('Could not allocate matrix or linear solver')
Expand All @@ -1707,7 +1707,7 @@ cdef class IDA:
.format(flag))
elif linsolver == 'lapackband':
A = SUNBandMatrix(N, <int> opts['uband'], <int> opts['lband'], self.sunctx);
LS = SUNLapackBand(self.y0, A)
LS = SUNLinSol_LapackBand(self.y0, A, self.sunctx)
if (A == NULL or LS == NULL):
raise ValueError('Could not allocate matrix or linear solver')
flag = IDASetLinearSolver(ida_mem, LS, A)
Expand Down
2 changes: 1 addition & 1 deletion setup_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def get_sundials_config_pxi(include_dirs, dist):
# Check for blas/lapack
if check_macro_def(
config_cmd,
"SUNDIALS_BLAS_LAPACK", headers=[SUNDIALS_CONFIG_H],
"SUNDIALS_BLAS_LAPACK_ENABLED", headers=[SUNDIALS_CONFIG_H],
include_dirs=include_dirs
):
has_lapack = True
Expand Down

0 comments on commit ca3d3f4

Please sign in to comment.