xzackli / Bolt.jl

differentiable boltzmann code
MIT License
42 stars 5 forks source link

Code not working with Julia 1.10 #90

Open franyancr opened 6 months ago

franyancr commented 6 months ago

It seems that recent updates to Julia and some of its common packages have broken some part of the code, rendering it unusable. I encountered the error while running basic_usage.jl. It seems that the error is originating from the DiffEqBase package, with error:


ERROR: LoadError: MethodError: anyeltypedual(::Type{Union{}}) is ambiguous.

Candidates: anyeltypedual(::Type{T}) where T<:ForwardDiff.Dual @ DiffEqBase ~/.julia/packages/DiffEqBase/4084R/src/forwarddiff.jl:147 anyeltypedual(x::Type{T}) where T<:ForwardDiff.AbstractConfig @ DiffEqBase ~/.julia/packages/DiffEqBase/4084R/src/forwarddiff.jl:120 anyeltypedual(::Type{T}) where T<:(Tuple{Vararg{T, N}} where {N, T}) @ DiffEqBase ~/.julia/packages/DiffEqBase/4084R/src/forwarddiff.jl:166 anyeltypedual(::Type{T}) where T<:Union{Set, AbstractArray} @ DiffEqBase ~/.julia/packages/DiffEqBase/4084R/src/forwarddiff.jl:151

Possible fix, define anyeltypedual(::Type{Union{}})

Two of my students are getting the same exact error, so it is not something special about my local installation. I am running julia 1.10.1 on MacOS 11.7.4. Reverting to Julia 1.8 fixes the issue, so it indicates that it has to do with some recent updates.

jmsull commented 6 months ago

Hi @franyancr - thanks for pointing this out! I'll take a look at this in the next few days and see if I can't get this working for 1.10.1 on my laptop

xzackli commented 6 months ago

Thanks @franyancr, I'll get this sorted soon. I've been on 1.10 for a while, but @jmsull and I have been tinkering in a separate repository for some reverse-mode AD work.

jmsull commented 5 months ago

I am not able to reproduce this error in v1.10.1 - on my laptop I am able to run basic_usage.jl with no problems on the main branch on Julia v1.10.1. Later will try v1.10.0 to see if I can reproduce it, but you might just try upgrading?

jmsull commented 4 months ago

Sorry @franyancr, I made a versioning mistake before, but can reproduce this now, we have identified the problem (with the Forward-mode AD in the RECFAST solver) and are working on fixing it