Skip to content

Fix Julia 1.12 compatibility issue with ODEInterface_jll loading#36

Open
ChrisRackauckas-Claude wants to merge 1 commit intoluchr:masterfrom
ChrisRackauckas-Claude:fix-julia-1.12-compatibility
Open

Fix Julia 1.12 compatibility issue with ODEInterface_jll loading#36
ChrisRackauckas-Claude wants to merge 1 commit intoluchr:masterfrom
ChrisRackauckas-Claude:fix-julia-1.12-compatibility

Conversation

@ChrisRackauckas-Claude
Copy link

Summary

Fixes Julia 1.12 compatibility issue where ODEInterface_jll module loading fails with UndefVarError.

Problem

In Julia 1.12, stricter module scoping rules caused ODEInterface_jll to not be accessible after being loaded with @eval inside the loadODESolvers() function. This resulted in all dynamic library loading tests failing with:

UndefVarError(:ODEInterface_jll, 0x00000000000098d4, ODEInterface)

Solution

File modified: src/DLSolvers.jl

  1. Changed from using ODEInterface_jll to import ODEInterface_jll in loadODESolvers() to ensure proper module-level import (lines 166-169)
  2. Updated trytofindjlllib() to access the imported module using @eval with QuoteNode for symbol interpolation (lines 78-81)

Testing

All 481 tests now pass on Julia 1.12.0:

  • ✅ Banded matrices: 27 tests
  • ✅ Options: 9 tests
  • ✅ DLSolvers: 250 tests
  • ✅ Solvers (dopri5, dop853, odex, radau5, radau, seulex, rodas, ddeabm, ddebdf): 72 tests
  • ✅ Mass matrix solvers: 32 tests
  • ✅ Jacobian solvers: 40 tests
  • ✅ RHS time derivative solvers: 2 tests
  • ✅ odecall: 36 tests
  • ✅ BVP solvers (bvpsol, colnew, bvpm2): 12 tests

The fix maintains backward compatibility with Julia versions >= 1.3.

Related

This issue was identified in ModelingToolkit.jl CI runs on Julia 1.12:
https://github.com/SciML/ModelingToolkit.jl/actions/runs/18457125412/job/52580500899?pr=3957#step:6:1803


🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

In Julia 1.12, stricter module scoping rules caused ODEInterface_jll
to not be accessible after being loaded with @eval inside a function.

Changes:
- Changed from 'using ODEInterface_jll' to 'import ODEInterface_jll'
  in loadODESolvers() to ensure proper module-level import
- Updated trytofindjlllib() to access the imported module using @eval
  with QuoteNode for symbol interpolation

This fix ensures all 481 tests pass on Julia 1.12 while maintaining
backward compatibility with earlier Julia versions.

Fixes issues where dynamic library loading would fail with
UndefVarError(:ODEInterface_jll) on Julia 1.12.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@ChrisRackauckas
Copy link

While this works, I would suggest going fully into the JLL route as the older build system has mostly been removed by all packages at this point. A bump to v1.10 and making JLL loading non-dynamic would greatly decrease load latency, precompilation support, and just simplify the code a lot. But this at least keeps the package working.

@ChrisRackauckas
Copy link

Bump

1 similar comment
@ChrisRackauckas
Copy link

Bump

@ChrisRackauckas
Copy link

Bump? This is still causing downstream failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants