Hi there,
just trying to get my first package going, so apologies if this is a newbie question
I have created a package (“] generate”) called MWE with the following content and have added DiffEqBase and ForwardDiff as packages in the local Project.toml (content of that file below).
MWE.jl content (located in MWE/src)
module MWE
using DiffEqBase
using ForwardDiff
struct Data{chunksize}
a::DiffEqBase.DiffCache{Array{Float64,1},Array{ForwardDiff.Dual{nothing,Float64,chunksize},1}}
b::Float64
end
end # module
Content of Project.toml (located in folder MWE):
name = "MWE"
uuid = "c31797ed-9657-413b-8bac-66075bf8aeb3"
authors = ["username"]
version = "0.1.0"
[deps]
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
When I am trying to use this simple package (with the local environment activated), I get an error telling me that DiffCache is not defined, as below:
julia> using MWE
[ Info: Precompiling MWE [c31797ed-9657-413b-8bac-66075bf8aeb3]
ERROR: LoadError: UndefVarError: DiffCache not defined
Stacktrace:
[1] getproperty(x::Module, f::Symbol)
@ Base .\Base.jl:26
[2] top-level scope
@ ~\[folders cut]\MWE\src\MWE.jl:6
[3] include
@ .\Base.jl:386 [inlined]
[4] 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, UInt64}}, source::Nothing)
@ Base .\loading.jl:1213
[5] top-level scope
@ none:1
[6] eval
@ .\boot.jl:360 [inlined]
[7] eval(x::Expr)
@ Base.MainInclude .\client.jl:446
[8] top-level scope
@ none:1
in expression starting at [... etc].
I tried using DiffEqBase: DiffCache at the top of MWE.jl as well (and of course altering the a:: line accordingly), but it also doesn’t work.
Can anyone help? Seems like a really basic problem that is probably caused by me doing something wrong in terms of package management…but what?
When I am c&p-ing the module code into the REPL, it’s working fine.