Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoadError: UndefVarError: StaticArrays not defined #73

Closed
prbzrg opened this issue Feb 28, 2023 · 2 comments · Fixed by #75
Closed

LoadError: UndefVarError: StaticArrays not defined #73

prbzrg opened this issue Feb 28, 2023 · 2 comments · Fixed by #75

Comments

@prbzrg
Copy link

prbzrg commented Feb 28, 2023

When both AbstractDifferentiation and ForwardDiff get imported. There is a warning!

┌ Warning: Error requiring `ForwardDiff` from `AbstractDifferentiation`
│   exception =
│    LoadError: UndefVarError: StaticArrays not defined
│    Stacktrace:
│      [1] include(mod::Module, _path::String)
│        @ Base .\Base.jl:419
│      [2] include(x::String)
│        @ AbstractDifferentiation C:\Users\Hossein Pourbozorg\.julia\packages\AbstractDifferentiation\o62DE\src\AbstractDifferentiation.jl:1
│      [3] top-level scope
│        @ C:\Users\Hossein Pourbozorg\.julia\packages\Requires\Z8rfN\src\Requires.jl:40
│      [4] eval
│        @ .\boot.jl:368 [inlined]
│      [5] eval
│        @ C:\Users\Hossein Pourbozorg\.julia\packages\AbstractDifferentiation\o62DE\src\AbstractDifferentiation.jl:1 [inlined]
│      [6] (::AbstractDifferentiation.var"#55#70")()
│        @ AbstractDifferentiation C:\Users\Hossein Pourbozorg\.julia\packages\Requires\Z8rfN\src\require.jl:101
│      [7] macro expansion
│        @ timing.jl:382 [inlined]
│      [8] err(f::Any, listener::Module, modname::String, file::String, line::Any)
│        @ Requires C:\Users\Hossein Pourbozorg\.julia\packages\Requires\Z8rfN\src\require.jl:47
│      [9] (::AbstractDifferentiation.var"#54#69")()
│        @ AbstractDifferentiation C:\Users\Hossein Pourbozorg\.julia\packages\Requires\Z8rfN\src\require.jl:100
│     [10] withpath(f::Any, path::String)
│        @ Requires C:\Users\Hossein Pourbozorg\.julia\packages\Requires\Z8rfN\src\require.jl:37
│     [11] (::AbstractDifferentiation.var"#53#68")()
│        @ AbstractDifferentiation C:\Users\Hossein Pourbozorg\.julia\packages\Requires\Z8rfN\src\require.jl:99
│     [12] #invokelatest#2
│        @ .\essentials.jl:729 [inlined]
│     [13] invokelatest
│        @ .\essentials.jl:726 [inlined]
│     [14] foreach(f::typeof(Base.invokelatest), itr::Vector{Function})
│        @ Base .\abstractarray.jl:2774
│     [15] loadpkg(pkg::Base.PkgId)
│        @ Requires C:\Users\Hossein Pourbozorg\.julia\packages\Requires\Z8rfN\src\require.jl:27
│     [16] #invokelatest#2
│        @ .\essentials.jl:729 [inlined]
│     [17] invokelatest
│        @ .\essentials.jl:726 [inlined]
│     [18] run_package_callbacks(modkey::Base.PkgId)
│        @ Base .\loading.jl:869
│     [19] _tryrequire_from_serialized(modkey::Base.PkgId, path::String, sourcepath::String, depmods::Vector{Any})
│        @ Base .\loading.jl:944
│     [20] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt64)
│        @ Base .\loading.jl:1028
│     [21] _require(pkg::Base.PkgId)
│        @ Base .\loading.jl:1315
│     [22] _require_prelocked(uuidkey::Base.PkgId)
│        @ Base .\loading.jl:1200
│     [23] macro expansion
│        @ .\loading.jl:1180 [inlined]
│     [24] macro expansion
│        @ .\lock.jl:223 [inlined]
│     [25] require(into::Module, mod::Symbol)
│        @ Base .\loading.jl:1144
│     [26] include(mod::Module, _path::String)
│        @ Base .\Base.jl:419
│     [27] exec_options(opts::Base.JLOptions)
│        @ Base .\client.jl:303
│     [28] _start()
│        @ Base .\client.jl:522in expression starting at C:\Users\Hossein Pourbozorg\.julia\packages\AbstractDifferentiation\o62DE\src\forwarddiff.jl:1
└ @ Requires C:\Users\Hossein Pourbozorg\.julia\packages\Requires\Z8rfN\src\require.jl:51
@ChrisRackauckas
Copy link
Member

https://github.com/JuliaDiff/AbstractDifferentiation.jl/blob/c04c0338bd5cf31159febbaab9faba65566c6faa/src/forwarddiff.jl this is dangerous. We should require the libraries that are used.

@devmotion can you make sure this is handled in #68 ?

@devmotion
Copy link
Member

#68 should be fine, StaticArrays is not loaded in the ForwardDiff backend in that PR. I had already removed it since it seemed to be unnecessary. I opened #75 as a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants