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

Precompilation failure when registering functions that with a vector type #1358

Open
longemen3000 opened this issue Nov 12, 2024 · 0 comments

Comments

@longemen3000
Copy link
Contributor

longemen3000 commented Nov 12, 2024

MWE:
main module:

module TestSymFailure
    abstract type FailureModel end
    f(m::FailureModel,a1,a2,x = [1.0]) = sum(x)*f0(m,a1,a2)
    f0(m::FailureModel,a1,a2) = a1 + a2
    struct Failure <: FailureModel end
end # module

Symbolics Extension:

module SymExt
    using Symbolics
    using TestSymFailure
    @register_symbolic TestSymFailure.f(model::TestSymFailure.FailureModel,a1,a2,x::AbstractVector{<:Number})
    @register_symbolic TestSymFailure.f(model::TestSymFailure.FailureModel,a1,a2,x::Symbolics.Arr{Num,1}) false
end 

when precompiling:

Precompiling project...
  ? TestSymFailure → SymExt
  40 dependencies successfully precompiled in 103 seconds. 111 already precompiled.
  1 dependencies failed but may be precompilable after restarting julia
  1 dependency had output during precompilation:
┌ TestSymFailure → SymExt
│  WARNING: Method definition f(SymbolicUtils.Symbolic{var"#s82"} where var"#s82"<:TestSymFailure.FailureModel, Real, Real, Symbolics.Arr{Symbolics.Num, 1}) in module SymExt at C:\Users\user\.julia\packages\Symbolics\8MbnV\src\wrapper-types.jl:158 overwritten on the same line (check for duplicate calls to `include`).
│  ERROR: Method overwriting is not permitted during Module precompilation. Use `__precompile__(false)` to opt-out of precompilation.
└  

Symbolics v6.15.3, julia 1.11.1.

@longemen3000 longemen3000 changed the title Precompilation failure when registering functions: Precompilation failure when registering functions that with a vector type Nov 12, 2024
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

1 participant