cesaraustralia / Dispersal.jl

Tools for simulating organism dispersal
Other
21 stars 3 forks source link

Precompile failed #9

Closed virgile-baudrot closed 4 years ago

virgile-baudrot commented 4 years ago

Dear Rafael,

I wanted to test Dispersal, but I had the following issue when precompiling the package. I'm new using Julia, so maybe it's not linked to your package.

Best

julia> using Dispersal
[ Info: Precompiling Dispersal [8797f018-3445-11e9-3969-c13eb94a0661]
WARNING: Method definition similar(DimensionalData.AbstractDimensionalArray{T, N, D} where D<:Tuple where N where T, Type{T}, Tuple{Int64, Vararg{Int64, N} where N}) where {T} in module DimensionalData at /home/vbaudrot/.julia/packages/DimensionalData/RX4n2/src/array.jl:47 overwritten at /home/vbaudrot/.julia/packages/DimensionalData/RX4n2/src/array.jl:61.
  ** incremental compilation may be fatally broken for this module **

WARNING: Method definition similar(DimensionalData.AbstractDimensionalArray{T, N, D} where D<:Tuple where N where T, Type{T}, Tuple{Union{Integer, Base.OneTo{T} where T<:Integer}, Vararg{Union{Integer, Base.OneTo{T} where T<:Integer}, N}}) where {T, N} in module DimensionalData at /home/vbaudrot/.julia/packages/DimensionalData/RX4n2/src/array.jl:49 overwritten at /home/vbaudrot/.julia/packages/DimensionalData/RX4n2/src/array.jl:63.
  ** incremental compilation may be fatally broken for this module **

WARNING: Method definition similar(DimensionalData.AbstractDimensionalArray{T, N, D} where D<:Tuple where N where T, Type{T}, Tuple{Int64, Vararg{Int64, N} where N}) where {T} in module DimensionalData at /home/vbaudrot/.julia/packages/DimensionalData/RX4n2/src/array.jl:61 overwritten at /home/vbaudrot/.julia/packages/DimensionalData/RX4n2/src/array.jl:47.
  ** incremental compilation may be fatally broken for this module **

WARNING: Method definition similar(DimensionalData.AbstractDimensionalArray{T, N, D} where D<:Tuple where N where T, Type{T}, Tuple{Int64, Vararg{Int64, N} where N}) where {T} in module DimensionalData at /home/vbaudrot/.julia/packages/DimensionalData/RX4n2/src/array.jl:47 overwritten at /home/vbaudrot/.julia/packages/DimensionalData/RX4n2/src/array.jl:61.
  ** incremental compilation may be fatally broken for this module **

WARNING: Method definition similar(DimensionalData.AbstractDimensionalArray{T, N, D} where D<:Tuple where N where T, Type{T}, Tuple{Union{Integer, Base.OneTo{T} where T<:Integer}, Vararg{Union{Integer, Base.OneTo{T} where T<:Integer}, N}}) where {T, N} in module DimensionalData at /home/vbaudrot/.julia/packages/DimensionalData/RX4n2/src/array.jl:63 overwritten at /home/vbaudrot/.julia/packages/DimensionalData/RX4n2/src/array.jl:49.
  ** incremental compilation may be fatally broken for this module **

WARNING: Method definition similar(DimensionalData.AbstractDimensionalArray{T, N, D} where D<:Tuple where N where T, Type{T}, Tuple{Union{Integer, Base.OneTo{T} where T<:Integer}, Vararg{Union{Integer, Base.OneTo{T} where T<:Integer}, N}}) where {T, N} in module DimensionalData at /home/vbaudrot/.julia/packages/DimensionalData/RX4n2/src/array.jl:49 overwritten at /home/vbaudrot/.julia/packages/DimensionalData/RX4n2/src/array.jl:63.
  ** incremental compilation may be fatally broken for this module **

WARNING: could not import DynamicGrids.applyinteraction into Dispersal
WARNING: could not import DynamicGrids.applyinteraction! into Dispersal
WARNING: could not import DynamicGrids.neighborhood into Dispersal
WARNING: could not import DynamicGrids.setneighbor! into Dispersal
WARNING: could not import DynamicGrids.mapreduceneighbors into Dispersal
WARNING: could not import DynamicGrids.currenttimestep into Dispersal
WARNING: could not import DynamicGrids.starttime into Dispersal
WARNING: could not import DynamicGrids.stoptime into Dispersal
WARNING: could not import DynamicGrids.tspan into Dispersal
ERROR: LoadError: LoadError: UndefVarError: starttime not defined
rafaqz commented 4 years ago

Lol no that error is in my other package DimensionalData.jl. These are all changing quite a lot still. But you probably just need to run Pkg.update(). The tests are actually passing (except building docs) so the package should be working with the latest builds of its dependencies.

Also as Dispersal.jl hasn't been released yet, but is pretty close... what is your specific use-case if you don't mind me asking?

You might also look at DynamicGrids.jl if you need a lower-level spatial simulation engine (Dispersal.jl is mostly just formulations that run in DynamicGrids.jl simulations). DynamicGridsGtk.jl and DynamicGridsInteract.jl are also useful for generic interfaces to view and manipulate simulations.

Edit: This is actually a good reminder to set dependency version bounds, which I will do now to stop this happening again.

rafaqz commented 4 years ago

Ok pulling the latest master here and running ] update should fix the problem, and force you to use compatible versions of the other packages.

virgile-baudrot commented 4 years ago

Great. I just git clone locally DynamicGrids.jlto install it, because I had an error Unsatisfiable requirements detected for package ConstructionBase. But now everything works.

For your question about using Dispersal.jl, I'm developing an R package briskaR (spatio-temporal exposure model for ecosystem risk assessment), and I would like to try developping it in julia, and the set of packages you're developing looks very interesting for that purpose.

rafaqz commented 4 years ago

That's pretty similar to what we are doing, mostly modelling insect pest incursion risk. Building something on top of DynamicGrids.jl should work for you. Modular high-performance spatial simulations are hard to do in R, that's really why this package exists.

I imagine you would be mostly building on DynamicGrids.jl, but use Dispersal.jl as an example for implementation ideas. The plan is that DynamicGrids.jl does all the computational work and packages like Dispersal.jl are mostly just collections of formulations for specific applications - so the science is easy to understand and the complexity is managed elsewhere.

Learning the subtype of Rule and what they do is probably the most important part to using DynamicGrids (NeighborhoodRule, CellRule etc) - I'm trying to outline the general categories of spatial model components, so they can be handled and performance optimised depending on their type. For example applyrule methods for NeighborhoodRule is passed a buffer holding the neighborhood so you don't have to check bounds or access the main array manually. And they don't run if they're empty.

There is probably still a lot to think about with DynamicGrids.jl, we are really making this up as we go along. So post issues if you have questions or ideas, it's good to have feedback at this stage.

rafaqz commented 4 years ago

Also there are some examples, but currently out of date due to the docs build breaking.

So just look directly ad the latest example markdown, which should mostly work: https://github.com/cesaraustralia/Dispersal.jl/blob/master/docs/src/example.jmd

I'll try to get that fixed later in the week, our tests should really be passing anyway.

You may also be pleasantly surprised by the performance :)

virgile-baudrot commented 4 years ago

thank you for all the information. I'm going to dig into this in the coming week. I'll give you feedbacks.

rafaqz commented 4 years ago

I've pushed some updates, but the docs for loading tif/netcdf data for climate overlays is currently buggy because I haven't finished building the "Raster" style julia package GeoData.jl...

So it will probably be hard to run the full models in the doc examples for another week or three. But you should be able to run the simpler growth models instead. This will all be easier when this package is released, but we are not quite there yet unfortunately.

rafaqz commented 4 years ago

Did you get anywhere with this? Check the readme for https://github.com/cesaraustralia/DynamicGrids.jl.

There is a simple forest fire model that takes you through the basics of getting something running. It also has a performance benchmark :)

virgile-baudrot commented 4 years ago

Hey, great work indeed. Simulation pics look very nice. I've just tried the simple Forest Example, the model runs perfectly. I haven't been able to visualize it (except by REPL array), but I did not take the time to make it working.

rafaqz commented 4 years ago

Thats good to hear! You'll need to install DynamicGridsGtk.jl to get the live simulation output. I try to keep gtk and web dependencies separate. That way you don't have to install them when your just doing simulations, and it keeps the tests separate as they break on windows sometimes...

rafaqz commented 4 years ago

Btw there is an updated version of DynamicGridsGtk in progress, it should be registered in the next few hours.

virgile-baudrot commented 4 years ago

Thank you. Well, I'm still struggling to understand how Julia manage Package versions, at this point, when doing add DynamicGridsGtk, I have this:

ERROR: Unsatisfiable requirements detected for package DynamicGridsGtk [db222a54]:
 DynamicGridsGtk [db222a54] log:
 ├─possible versions are: 0.1.3 or uninstalled
 ├─restricted to versions * by an explicit requirement, leaving only versions 0.1.3
 └─restricted by compatibility requirements with Gtk [4c0ca9eb] to versions: uninstalled — no versions left
   └─Gtk [4c0ca9eb] log:
     ├─possible versions are: [0.16.0-0.16.5, 0.17.0, 0.18.0, 1.0.0, 1.1.0-1.1.2] or uninstalled
     └─restricted to versions 0.18.0 by an explicit requirement, leaving only versions 0.18.0

otherwise, from add https://github.com/cesaraustralia/DynamicGridsGtk.jl.git, I have:

ERROR: Unsatisfiable requirements detected for package Gtk [4c0ca9eb]:
 Gtk [4c0ca9eb] log:
 ├─possible versions are: [0.16.0-0.16.5, 0.17.0, 0.18.0, 1.0.0, 1.1.0-1.1.2] or uninstalled
 ├─restricted to versions 1.0.0-1 by DynamicGridsGtk [db222a54], leaving only versions [1.0.0, 1.1.0-1.1.2]
 │ └─DynamicGridsGtk [db222a54] log:
 │   ├─possible versions are: 0.2.0 or uninstalled
 │   └─DynamicGridsGtk [db222a54] is fixed to version 0.2.0
 └─restricted to versions 0.18.0 by an explicit requirement — no versions left

But don't worry for that.

rafaqz commented 4 years ago

Have you tried to do ] update?

For some reason your Gtk is stuck at 0.18.0. DynamicGridsGtk needs Gtk 1.x

Edit: you may have some other package holding gtk to that version.

The 0.2 master version is the right one to use, but that should be the registered version within a few hours. Apologies there were a few problems that slowed that registration down.

rafaqz commented 4 years ago

Ok that's registered (which means it is tested to install and work with DynamicGrids).

Maybe do:

]
rm DynamicGridsGtk
update
add DynamicGridsGtk