Error Importing `OptimalTransport`: `UndefVarError: _iszero` Not Defined in `LinearAlgebra`

Hello Julia Community,

I’m encountering an error when trying to import the OptimalTransport package, and I’m not sure how to resolve it. Below is the error message I receive:

Failed to precompile OptimalTransport [7e02d93a-ae51-4f58-b602-d97af76e3b33] to "/Users/jmfrutos/.julia/compiled/v1.11/OptimalTransport/jl_MlitRc".
ERROR: LoadError: UndefVarError: `_iszero` not defined in `LinearAlgebra`
Stacktrace:
 [1] getproperty(x::Module, f::Symbol)
   @ Base ./Base.jl:42
 [2] top-level scope
   @ ~/.julia/packages/MutableArithmetics/mgg9J/src/dispatch.jl:287
 [3] include(mod::Module, _path::String)
   @ Base ./Base.jl:557
 [4] include(x::String)
   @ MutableArithmetics ~/.julia/packages/MutableArithmetics/mgg9J/src/MutableArithmetics.jl:7
 [5] top-level scope
   @ ~/.julia/packages/MutableArithmetics/mgg9J/src/MutableArithmetics.jl:92
 [6] include
   @ ./Base.jl:557 [inlined]
 [7] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)

What I’ve Tried:

  • Verified that OptimalTransport does not declare _iszero; it consistently uses iszero, which is defined in LinearAlgebra.
  • Noticed that the same issue occurs with the MutableArithmetics package.

Additional Information:

  • Julia version: 1.11
  • Operating System: macOS

Question:

Has anyone experienced this error before or can provide insights into why _iszero might be causing issues during the precompilation of OptimalTransport? Any suggestions on how to fix this would be greatly appreciated!

Thank you!

The error is likely related to MutableArithmetics.jl/src/dispatch.jl at d75b9acdffeca53a0419984232546ed9dfa6b0ba · jump-dev/MutableArithmetics.jl · GitHub but that line should execute only in older julia versions. Maybe you have an older version of MutableArithmetics without that if VERSION >= condition? Can you post the output of ]status?