Skip to content

Commit 3d14b7a

Browse files
Fix Julia 1.10 (LTS) compatibility: conditional import of calc_rosenbrock_differentiation
On Julia 1.10, [sources] in Project.toml is not supported, so OrdinaryDiffEqDifferentiation resolves from the registry which doesn't have the new calc_rosenbrock_differentiation OOP function. This caused module loading failure for OrdinaryDiffEqRosenbrock, cascading to all test suites (BDF, RKN, etc.) that import the top-level OrdinaryDiffEq. Fix: conditionally import calc_rosenbrock_differentiation on Julia 1.11+, and define a simple fallback (calc_tderivative + calc_W, no J reuse) on Julia 1.10. This means Julia 1.10 users don't get Jacobian reuse optimization but everything works correctly. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
1 parent 3ab8fe0 commit 3d14b7a

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lib/OrdinaryDiffEqRosenbrock/src/OrdinaryDiffEqRosenbrock.jl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,23 @@ using OrdinaryDiffEqDifferentiation: TimeDerivativeWrapper, TimeGradientWrapper,
3232
wrapprecs, calc_tderivative, build_grad_config,
3333
build_jac_config, issuccess_W, jacobian2W!,
3434
resize_jac_config!, resize_grad_config!,
35-
calc_W, calc_rosenbrock_differentiation!, calc_rosenbrock_differentiation, build_J_W,
35+
calc_W, calc_rosenbrock_differentiation!, build_J_W,
3636
UJacobianWrapper, dolinsolve, WOperator, resize_J_W!
3737

38+
# On Julia 1.11+, [sources] in Project.toml provides the local OrdinaryDiffEqDifferentiation
39+
# which has calc_rosenbrock_differentiation (OOP version with J reuse).
40+
# On Julia 1.10, [sources] is not supported, so the registry version is used which
41+
# doesn't have this function. Define a simple fallback without J reuse.
42+
@static if VERSION >= v"1.11-"
43+
using OrdinaryDiffEqDifferentiation: calc_rosenbrock_differentiation
44+
else
45+
function calc_rosenbrock_differentiation(integrator, cache, dtgamma, repeat_step)
46+
dT = calc_tderivative(integrator, cache)
47+
W = calc_W(integrator, cache, dtgamma, repeat_step)
48+
return dT, W
49+
end
50+
end
51+
3852
using Reexport
3953
@reexport using SciMLBase
4054

0 commit comments

Comments
 (0)