Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package fails for Julia 1.6 #4

Closed
adknudson opened this issue Feb 18, 2024 · 5 comments
Closed

Package fails for Julia 1.6 #4

adknudson opened this issue Feb 18, 2024 · 5 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@adknudson
Copy link
Owner

Currently the package fails for Julia 1.6.

ERROR: LoadError: DimensionMismatch("cannot broadcast array to have fewer dimensions")
Stacktrace:
  [1] check_broadcast_shape(#unused#::Tuple{}, Ashp::Tuple{Base.OneTo{Int64}})
    @ Base.Broadcast .\broadcast.jl:518
  [2] check_broadcast_shape(shp::Tuple{Base.OneTo{Int64}}, Ashp::Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}})
    @ Base.Broadcast .\broadcast.jl:521
  [3] check_broadcast_axes
    @ .\broadcast.jl:523 [inlined]
  [4] instantiate
    @ .\broadcast.jl:269 [inlined]
  [5] materialize!
    @ .\broadcast.jl:894 [inlined]
  [6] materialize!
    @ .\broadcast.jl:891 [inlined]
  [7] _precondition_matrix!(c::Vector{Float32}, Ω₀::Matrix{Float32}, P::Matrix{Float32})
@adknudson adknudson added bug Something isn't working good first issue Good for newcomers labels Feb 18, 2024
@peteristhegreat
Copy link

Here's the fix to use vec in newton.jl to satisfy the Julia 1.6 compiler. This resolves the error (at least for precompiling and going through its runtests).

@@ -267,7 +267,7 @@ function _precondition_matrix!(
         c .= transpose(sum(H₁, dims=1)).^2 + 2 * sum(H12 .* transpose(H₂), dims=2)
     else
         H12 = (1.0 .- Ω₀) * H₂
-        c .= transpose(sum(H, dims=1)).^2 - transpose(sum(H₂, dims=1)).^2 - 2 * transpose(sum(H₁ .* H12, dims=1))
+        c .= vec(sum(H, dims=1)).^2 - vec(sum(H₂, dims=1)).^2 - 2 * vec(sum(H₁ .* H12, dims=1))
     end

     ϵ = T(1e-8)
@@ -346,7 +346,7 @@ function _jacobian!(
         HT₁ = P₂ * transpose(Ω)
         HT₂ = P₂ * transpose(H₂) * P₂ + P₁ * Ω

-        w .= x .* (1 + perturbation) - sum(P .* [HT₁ HT₂], dims=2)
+        w .= x .* (1 + perturbation) - vec(sum(P .* [HT₁ HT₂], dims=2))
         return w
     end
 end

@adknudson adknudson self-assigned this Oct 3, 2024
@adknudson
Copy link
Owner Author

Thank you for the suggested fix! I will reopen this issue and try out your suggestion as it would be nice to support the LTS version of Julia.

@adknudson adknudson reopened this Oct 3, 2024
@peteristhegreat
Copy link

peteristhegreat commented Oct 3, 2024 via email

@adknudson
Copy link
Owner Author

@peteristhegreat Now that 1.11 is released and 1.10 is the new LTS version, do you still plan to have a 1.6 environment?

@peteristhegreat
Copy link

peteristhegreat commented Oct 14, 2024 via email

@adknudson adknudson added wontfix This will not be worked on and removed bug Something isn't working good first issue Good for newcomers labels Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants