Skip to content

Conversation

ChrisRackauckas
Copy link
Member

Enzyme Derivative Rules: Error During Test at /home/runner/.julia/packages/SafeTestsets/raUNr/src/SafeTestsets.jl:30
  Got exception outside of a @test
  LoadError: could not load library "/System/Library/Frameworks/Accelerate.framework/Accelerate"
  /System/Library/Frameworks/Accelerate.framework/Accelerate.so: cannot open shared object file: No such file or directory
  Stacktrace:
    [1] fix_ptr_lookup(name::String)
      @ Enzyme.Compiler.JIT ~/.julia/packages/Enzyme/LMVya/src/compiler/orcv2.jl:63
    [2] add!(mod::LLVM.Module)
      @ Enzyme.Compiler.JIT ~/.julia/packages/Enzyme/LMVya/src/compiler/orcv2.jl:251
    [3] _link(job::GPUCompiler.CompilerJob{<:Enzyme.Compiler.EnzymeTarget}, mod::LLVM.Module, edges::Vector{Any}, adjoint_name::String, primal_name::Union{Nothing, String}, TapeType::Any, prepost::String)
      @ Enzyme.Compiler ~/.julia/packages/Enzyme/LMVya/src/compiler.jl:5661
    [4] cached_compilation
      @ ~/.julia/packages/Enzyme/LMVya/src/compiler.jl:5750 

Basically, you can't do option dependencies, but BinaryBuilder just simply sends no binary if the platform isn't supported. So LinearSolve.jl always has a dependency on AppleAccelerate, and if the binary exists it defaults to it (since it's pretty much always the fastest on M-series mac) and otherwise it disables it. Enzyme still seems to want to try to call it, so this should fix that.

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Add any other context about the problem here.

```julia
Enzyme Derivative Rules: Error During Test at /home/runner/.julia/packages/SafeTestsets/raUNr/src/SafeTestsets.jl:30
  Got exception outside of a @test
  LoadError: could not load library "/System/Library/Frameworks/Accelerate.framework/Accelerate"
  /System/Library/Frameworks/Accelerate.framework/Accelerate.so: cannot open shared object file: No such file or directory
  Stacktrace:
    [1] fix_ptr_lookup(name::String)
      @ Enzyme.Compiler.JIT ~/.julia/packages/Enzyme/LMVya/src/compiler/orcv2.jl:63
    [2] add!(mod::LLVM.Module)
      @ Enzyme.Compiler.JIT ~/.julia/packages/Enzyme/LMVya/src/compiler/orcv2.jl:251
    [3] _link(job::GPUCompiler.CompilerJob{<:Enzyme.Compiler.EnzymeTarget}, mod::LLVM.Module, edges::Vector{Any}, adjoint_name::String, primal_name::Union{Nothing, String}, TapeType::Any, prepost::String)
      @ Enzyme.Compiler ~/.julia/packages/Enzyme/LMVya/src/compiler.jl:5661
    [4] cached_compilation
      @ ~/.julia/packages/Enzyme/LMVya/src/compiler.jl:5750 
```

Basically, you can't do option dependencies, but BinaryBuilder just simply sends no binary if the platform isn't supported. So LinearSolve.jl always has a dependency on AppleAccelerate, and if the binary exists it defaults to it (since it's pretty much always the fastest on M-series mac) and otherwise it disables it. Enzyme still seems to want to try to call it, so this should fix that.
@@ -34,6 +34,8 @@ function aa_getrf!(A::AbstractMatrix{<:ComplexF64};
ipiv = similar(A, Cint, min(size(A, 1), size(A, 2))),
info = Ref{Cint}(),
check = false)
__appleaccelerate_isavailable() ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
__appleaccelerate_isavailable() ||
__appleaccelerate_isavailable() ||

@@ -54,6 +56,8 @@
ipiv = similar(A, Cint, min(size(A, 1), size(A, 2))),
info = Ref{Cint}(),
check = false)
__appleaccelerate_isavailable() ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
__appleaccelerate_isavailable() ||
__appleaccelerate_isavailable() ||

@@ -74,6 +78,8 @@
ipiv = similar(A, Cint, min(size(A, 1), size(A, 2))),
info = Ref{Cint}(),
check = false)
__appleaccelerate_isavailable() ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
__appleaccelerate_isavailable() ||
__appleaccelerate_isavailable() ||

@@ -94,6 +100,8 @@
ipiv = similar(A, Cint, min(size(A, 1), size(A, 2))),
info = Ref{Cint}(),
check = false)
__appleaccelerate_isavailable() ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
__appleaccelerate_isavailable() ||
__appleaccelerate_isavailable() ||

@@ -116,6 +124,8 @@
ipiv::AbstractVector{Cint},
B::AbstractVecOrMat{<:ComplexF64};
info = Ref{Cint}())
__appleaccelerate_isavailable() ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
__appleaccelerate_isavailable() ||
__appleaccelerate_isavailable() ||

@@ -140,6 +150,8 @@
ipiv::AbstractVector{Cint},
B::AbstractVecOrMat{<:ComplexF32};
info = Ref{Cint}())
__appleaccelerate_isavailable() ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
__appleaccelerate_isavailable() ||
__appleaccelerate_isavailable() ||

@@ -165,6 +177,8 @@
ipiv::AbstractVector{Cint},
B::AbstractVecOrMat{<:Float64};
info = Ref{Cint}())
__appleaccelerate_isavailable() ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
__appleaccelerate_isavailable() ||
__appleaccelerate_isavailable() ||

@@ -190,6 +204,8 @@
ipiv::AbstractVector{Cint},
B::AbstractVecOrMat{<:Float32};
info = Ref{Cint}())
__appleaccelerate_isavailable() ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
__appleaccelerate_isavailable() ||
__appleaccelerate_isavailable() ||

@@ -236,6 +252,8 @@

function SciMLBase.solve!(cache::LinearCache, alg::AppleAccelerateLUFactorization;
kwargs...)
__appleaccelerate_isavailable() ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
__appleaccelerate_isavailable() ||
__appleaccelerate_isavailable() ||

@ChrisRackauckas ChrisRackauckas merged commit b277456 into main Aug 6, 2025
98 of 102 checks passed
@ChrisRackauckas ChrisRackauckas deleted the ChrisRackauckas-patch-1 branch August 6, 2025 01:59
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.

1 participant