zenna / Omega.jl

Causal, Higher-Order, Probabilistic Programming
MIT License
164 stars 17 forks source link

Compilations errors & julia version compatibility #204

Open elliottower opened 2 years ago

elliottower commented 2 years ago

Is there a recommended way to install/set up the environment for the current version of Omega?

Using julia 1.0.5 I am able to get Omega working, but unfortunately some of the example model notebooks do not work with this version of julia due to dependencies (e.g., LearnTimeSeries, which requires DifferentialEquations which does not work with julia 1.0).

Using julia 1.6 (LTS) or 1.7 (stable) I encountered similar issues to this previous issue, although with 1.7 I was finally able to precompile Omega using the workaround stated there of first installing an older version of Flux (0.9 led to errors for me so I did 0.8). However, when testing the built in distributions, I encountered this error:

julia> using Omega
[ Info: Precompiling Omega [1af16e33-887a-59b3-8344-18f1671b3ade]

(@v1.7) pkg> status
      Status `~/.julia/environments/v1.7/Project.toml`
  [fb24a613] AndTraits v0.1.0 `https://github.com/zenna/AndTraits.jl#main`
  [31c24e10] Distributions v0.23.12
  [1af16e33] Omega v0.2.0 `~/.julia/dev/Omega`

julia> a = normal(0,1)
ERROR: UndefVarError: normal not defined
Stacktrace:
 [1] top-level scope
   @ REPL[14]:1

My working environment for julia 1.0 is as follows (conda & IJulia are not necessary, just for ease of use to work with jupyter hub)

(v1.0) pkg> status
    Status `~/.julia/environments/v1.0/Project.toml`
  [fb24a613] AndTraits v0.1.0 #main (https://github.com/zenna/AndTraits.jl)
  [8f4d0f93] Conda v1.5.2
  [587475ba] Flux v0.8.3
  [7073ff75] IJulia v1.23.3
  [1af16e33] Omega v0.1.1

In order to get julia 1.0 and Omega 0.1 to work I had to delete all of the registries using this command rm(joinpath(homedir(), ".julia", "registries"); recursive=true), and then ] add Omega rather than develop. If I remember correctly v0.2 caused issues with julia 1.0, I just ran ] update and it is still using v0.1.1.

I actually was not able to get it to work using the workaround posted here either, seems to be a versioning issue

(@v1.7) pkg> add Omega#master
    Updating git-repo `https://github.com/zenna/Omega.jl.git`
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package OmegaDistributions [4ee16af8]:
 OmegaDistributions [4ee16af8] log:
 ├─OmegaDistributions [4ee16af8] has no known versions!
 └─restricted to versions * by Omega [1af16e33] — no versions left
   └─Omega [1af16e33] log:
     ├─possible versions are: 0.2.0 or uninstalled
     └─Omega [1af16e33] is fixed to version 0.2.0