Skip to content

Conversation

@ChrisRackauckas-Claude
Copy link

Summary

This PR moves LinearAlgebra.jl from a direct dependency to a package extension, reducing compilation overhead for users who don't need LinearAlgebra functionality.

Changes

  • Moved LinearAlgebra from deps to weakdeps in Project.toml
  • Created SciMLBaseLinearAlgebraExt extension module
  • Moved all LinearAlgebra-dependent code to the extension:
    • Identity matrix (I) constant and default_identity_matrix()
    • has_non_trivial_mass_matrix() implementation
    • get_initial_values() for CheckInit algorithm
    • calculate_solution_errors!() for ODE, DAE, and RODE solutions
  • Replaced direct LinearAlgebra references with extension-compatible stubs
  • Updated mass_matrix comparisons to use default_identity_matrix()

Benefits

  • Reduced compilation time for users who don't need LinearAlgebra
  • Preserves all existing functionality when LinearAlgebra is loaded
  • Follows Julia's package extension pattern for optional dependencies

Testing

The extension loads correctly and provides LinearAlgebra functionality when the package is loaded. Some tests may need adjustment due to the extension loading mechanism.

Note: SparseArrays.jl was checked but no usage was found in the codebase, so no changes were needed for that package.

- Moved LinearAlgebra dependency to weakdeps in Project.toml
- Created SciMLBaseLinearAlgebraExt extension module
- Moved all LinearAlgebra-dependent code to the extension:
  - Identity matrix (I) constant and default_identity_matrix()
  - has_non_trivial_mass_matrix() implementation
  - get_initial_values() for CheckInit algorithm
  - calculate_solution_errors\!() for ODE, DAE, and RODE solutions
- Replaced direct LinearAlgebra references with extension-compatible stubs
- Updated mass_matrix comparisons to use default_identity_matrix()

This change reduces compilation overhead for users who don't need LinearAlgebra functionality, while preserving all existing functionality when LinearAlgebra is loaded.
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