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 Jul 16, 2024
1 parent 06cc892 commit d533661
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/scikits-odes-sundials/setup_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,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
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
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,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 @@ -1593,7 +1593,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
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,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 @@ -1709,7 +1709,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

0 comments on commit d533661

Please sign in to comment.