ReactiveBayes / GraphPPL.jl

DSL for probabilistic models specification and probabilistic programming.
MIT License
27 stars 4 forks source link

GraphPPL does not work for Julia <1.10 #230

Closed abpolym closed 2 months ago

abpolym commented 2 months ago

I encountered this error when trying to compile RxInfer v3.0.2 (which uses GraphPPL v4.0.2) for Julia 1.9.4:

$ julia --version
julia version 1.9.4

$ cat Project.toml
[deps]
RxInfer = "86711068-29c9-4ff7-b620-ae75d7495b3d"

$ julia --project=.
julia> using Pkg
julia> Pkg.activate(".")
julia> Pkg.instantiate()
Updating registry at `~/.julia/registries/General.toml`
[...]
  [b3f8163a] + GraphPPL v4.0.2
[...]
Precompiling project...
  ✗ GraphPPL
  ✗ GraphPPL → GraphPPLDistributionsExt
  ✗ RxInfer
  9 dependencies successfully precompiled in 27 seconds. 121 already precompiled.
  3 dependencies errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the packages
julia> using RxInfer
[ Info: Precompiling RxInfer [86711068-29c9-4ff7-b620-ae75d7495b3d]
ERROR: LoadError: UndefVarError: `@Kwargs` not defined
Stacktrace:
 [1] top-level scope
   @ :0
 [2] include(mod::Module, _path::String)
   @ Base ./Base.jl:457
 [3] include(x::String)
   @ GraphPPL ~/.julia/packages/GraphPPL/BYCRJ/src/GraphPPL.jl:1
 [4] top-level scope
   @ ~/.julia/packages/GraphPPL/BYCRJ/src/GraphPPL.jl:8
 [5] include
   @ ./Base.jl:457 [inlined]
 [6] 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::String)
   @ Base ./loading.jl:2049
 [7] top-level scope
   @ stdin:3
in expression starting at /Users/<redacted>/.julia/packages/GraphPPL/BYCRJ/src/graph_engine.jl:497
in expression starting at /Users/<redacted>/.julia/packages/GraphPPL/BYCRJ/src/graph_engine.jl:497
in expression starting at /Users/<redacted>/.julia/packages/GraphPPL/BYCRJ/src/GraphPPL.jl:1
in expression starting at stdin:3

@Kwargs does not seem to exist before Julia 1.10, but is used in the graph_engine of GraphPPL. Compiling RxInfer for Julia 1.10 works, however.

bvdmitri commented 2 months ago

Ah, we should update our [compat] entry. It still says Julia v1.6 but that is not true. The error with v1.9 is expected, we don't support Julia < 1.10 for the new version (RxInfer and ReactiveMP also should set minimum required version to 1.10).