Fix x86 (32-bit) compatibility issues with Int64 conversions #495
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes x86 (32-bit) compatibility issues by explicitly converting
InttoInt64where needed for Sundials C API calls.Problem
On x86 (32-bit) systems,
IntisInt32, but the Sundials C API expectssunindextypewhich is defined asInt64. This causesMethodError:Solution
Added explicit
Int64()conversions for alllength()calls and integer parameters passed to Sundials C API functions:Files changed:
length(v)toInt64inN_VMake_Serialcalllength(uvec),length(u0), and bandwidth parameters toInt64for matrix constructorslength(y0)and bandwidth parameters toInt64for matrix constructorsFunctions affected:
N_VMake_Serial(length(v), ...)→N_VMake_Serial(Int64(length(v)), ...)SUNDenseMatrix(length(...), length(...), ...)→SUNDenseMatrix(Int64(length(...)), Int64(length(...)), ...)SUNBandMatrix(length(...), upper, lower, ...)→SUNBandMatrix(Int64(length(...)), Int64(upper), Int64(lower), ...)SUNSparseMatrix(length(...), length(...), nnz, ...)→SUNSparseMatrix(Int64(length(...)), Int64(length(...)), Int64(nnz), ...)Test plan
Fixes CI failure: https://github.com/SciML/Sundials.jl/actions/runs/17394622855/job/49374121057?pr=493
🤖 Generated with Claude Code