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

Can't precompile on Julia v1.11.0-beta1 #47

Closed
frankebel opened this issue Apr 15, 2024 · 3 comments
Closed

Can't precompile on Julia v1.11.0-beta1 #47

frankebel opened this issue Apr 15, 2024 · 3 comments

Comments

@frankebel
Copy link

If I try to load the package with include SparseIR on Julia v1.11.0-beta1, I get an error that the package does not precompile. Looking at the stacktrace, it comes from:

Stacktrace:
  [4] cosh(x::MultiFloats.MultiFloat{Float64, 2})
    @ SparseIR src/SparseIR.jl:21
 [12] segments_x(hints::SparseIR.SVEHintsLogistic{Float64}, ::Type{MultiFloats.MultiFloat{Float64, 2}})
    @ SparseIR src/kernel.jl:204

Problem seems to this block.

@shinaoka
Copy link
Member

Thank you for the report. I have quickly reproduced the error on my Macbook Air M1.

PkgPrecompileError: The following 1 direct dependency failed to precompile:

SparseIR

Failed to precompile SparseIR [4fe2279e-80f0-4adb-8463-ee114ff56b7d] to "/Users/hiroshi/.julia/compiled/v1.11/SparseIR/jl_DTRTGY".
ERROR: LoadError: MethodError: no method matching _precision_with_base_2(::Type{MultiFloats.MultiFloat{Float64, 2}})
The function `_precision_with_base_2` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  _precision_with_base_2(::BigFloat)
   @ Base mpfr.jl:957
  _precision_with_base_2(::Type{BigFloat})
   @ Base mpfr.jl:962
  _precision_with_base_2(::Type{Float64})
   @ Base float.jl:859
  ...

Stacktrace:
  [1] _precision(x::Type, base::Int64)
    @ Base ./float.jl:862
  [2] precision(::Type{MultiFloats.MultiFloat{Float64, 2}}; base::Int64)
    @ Base ./float.jl:865
  [3] precision(::Type{MultiFloats.MultiFloat{Float64, 2}})
    @ Base ./float.jl:865
  [4] cosh(x::MultiFloats.MultiFloat{Float64, 2})
    @ SparseIR ~/.julia/packages/SparseIR/RfK9H/src/SparseIR.jl:21
  [5] _broadcast_getindex_evalf
    @ ./broadcast.jl:673 [inlined]
  [6] _broadcast_getindex
    @ ./broadcast.jl:646 [inlined]
  [7] _getindex
    @ ./broadcast.jl:670 [inlined]
  [8] _broadcast_getindex
    @ ./broadcast.jl:645 [inlined]
  [9] getindex
    @ ./broadcast.jl:605 [inlined]
 [10] copy
    @ ./broadcast.jl:906 [inlined]
 [11] materialize
    @ ./broadcast.jl:867 [inlined]
 [12] segments_x(hints::SparseIR.SVEHintsLogistic{Float64}, ::Type{MultiFloats.MultiFloat{Float64, 2}})
    @ SparseIR ~/.julia/packages/SparseIR/RfK9H/src/kernel.jl:204
 [13] segments_x(hints::SparseIR.SVEHintsReduced{SparseIR.SVEHintsLogistic{Float64}}, ::Type{MultiFloats.MultiFloat{Float64, 2}})
    @ SparseIR ~/.julia/packages/SparseIR/RfK9H/src/kernel.jl:395
 [14] SparseIR.SamplingSVE(kernel::SparseIR.ReducedKernel{SparseIR.LogisticKernel}, ε::Float64, ::Type{MultiFloats.MultiFloat{Float64, 2}}; n_gauss::Nothing)
    @ SparseIR ~/.julia/packages/SparseIR/RfK9H/src/sve.jl:42
 [15] SparseIR.CentrosymmSVE(kernel::SparseIR.LogisticKernel, ε::Float64, ::Type{MultiFloats.MultiFloat{Float64, 2}}; InnerSVE::Type{SparseIR.SamplingSVE}, n_gauss::Nothing)
    @ SparseIR ~/.julia/packages/SparseIR/RfK9H/src/sve.jl:85
 [16] SparseIR.SVEResult(kernel::SparseIR.LogisticKernel; Twork::Nothing, cutoff::Nothing, ε::Nothing, lmax::Int64, n_gauss::Nothing, svd_strat::Symbol, SVEstrat::Type{SparseIR.CentrosymmSVE})
    @ SparseIR ~/.julia/packages/SparseIR/RfK9H/src/sve.jl:158
 [17] SparseIR.FiniteTempBasis(statistics::SparseIR.Fermionic, β::Float64, ωmax::Float64, ε::Nothing)
    @ SparseIR ~/.julia/packages/SparseIR/RfK9H/src/basis.jl:67
 [18] macro expansion
    @ ~/.julia/packages/SparseIR/RfK9H/src/SparseIR.jl:50 [inlined]
 [19] macro expansion
    @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:78 [inlined]
 [20] top-level scope
    @ ~/.julia/packages/SparseIR/RfK9H/src/SparseIR.jl:49
 [21] include
    @ ./Base.jl:558 [inlined]
 [22] 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::Nothing)
    @ Base ./loading.jl:2721
 [23] top-level scope
    @ stdin:4
in expression starting at /Users/hiroshi/.julia/packages/SparseIR/RfK9H/src/SparseIR.jl:1
in expression starting at stdin:

@shinaoka
Copy link
Member

@SamuelBadr @mwallerb

The function _precision_with_base_2 in base/float.jl was introduced recently.

Can we work around this by overwriting the function precision here?

https://github.com/SpM-lab/SparseIR.jl/blob/main/src/SparseIR.jl#L21

@SamuelBadr
Copy link
Collaborator

Thanks both!

The new version 1.0.18 fixes this.

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

No branches or pull requests

3 participants