# StaticArrayInterface does not have LinearAlgebra in its dependencies

**URL:** <https://discourse.julialang.org/t/staticarrayinterface-does-not-have-linearalgebra-in-its-dependencies/95548>\
**Category:** General Usage\
**Tags:** package, staticarrays\
**Created:** [March 4, 2023, 4:56pm UTC](https://discourse.julialang.org/t/staticarrayinterface-does-not-have-linearalgebra-in-its-dependencies/95548 "2023-03-04T16:56:50Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [March 4, 2023, 4:56pm UTC](https://discourse.julialang.org/t/staticarrayinterface-does-not-have-linearalgebra-in-its-dependencies/95548/1 "2023-03-04T16:56:51Z")

</div>

When running the script `bin/create_sys_image` from the package [GitHub - aenarete/KiteControllers.jl: Controllers for airborne wind energy systems](https://github.com/aenarete/KiteControllers.jl) I get the following error:

```julia
✔ [07m:06s] PackageCompiler: compiling incremental system image
┌ Warning: Error requiring `StaticArrays` from `StaticArrayInterface`
│ exception =
│ LoadError: ArgumentError: Package StaticArrayInterface does not have LinearAlgebra in its dependencies:
│ - You may have a partially installed environment. Try `Pkg.instantiate()`
│ to ensure all packages in the environment are installed.
│ - Or, if you have StaticArrayInterface checked out for development and have
│ added LinearAlgebra as a dependency but haven't updated your primary
│ environment's manifest file, try `Pkg.resolve()`.
│ - Otherwise you may need to report an issue with StaticArrayInterface
│ Stacktrace:
│ [1] macro expansion
│ @ ./loading.jl:1167 [inlined]
│ [2] macro expansion
│ @ ./lock.jl:223 [inlined]
│ [3] require(into::Module, mod::Symbol)
│ @ Base ./loading.jl:1144
│ [4] include(mod::Module, _path::String)
│ @ Base ./Base.jl:419
│ [5] include(x::String)
│ @ StaticArrayInterface ~/.julia/packages/StaticArrayInterface/IzhAV/src/StaticArrayInterface.jl:1
│ [6] macro expansion
│ @ ~/.julia/packages/Requires/Z8rfN/src/Requires.jl:40 [inlined]
│ [7] top-level scope
│ @ ~/.julia/packages/StaticArrayInterface/IzhAV/src/StaticArrayInterface.jl:488
│ [8] eval
│ @ ./boot.jl:368 [inlined]
│ [9] eval
│ @ ~/.julia/packages/StaticArrayInterface/IzhAV/src/StaticArrayInterface.jl:1 [inlined]
│ [10] (::StaticArrayInterface.var"#55#61")()
│ @ StaticArrayInterface ~/.julia/packages/Requires/Z8rfN/src/require.jl:101
│ [11] macro expansion
│ @ ./timing.jl:382 [inlined]
│ [12] err(f::Any, listener::Module, modname::String, file::String, line::Any)
│ @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:47
│ [13] (::StaticArrayInterface.var"#54#60")()
│ @ StaticArrayInterface ~/.julia/packages/Requires/Z8rfN/src/require.jl:100
│ [14] withpath(f::Any, path::String)
│ @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:37
│ [15] (::StaticArrayInterface.var"#53#59")()
│ @ StaticArrayInterface ~/.julia/packages/Requires/Z8rfN/src/require.jl:99
│ [16] listenpkg(f::Any, pkg::Base.PkgId)
│ @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:20
│ [17] macro expansion
│ @ ~/.julia/packages/Requires/Z8rfN/src/require.jl:98 [inlined]
│ [18] __init__ ()
│ @ StaticArrayInterface ~/.julia/packages/StaticArrayInterface/IzhAV/src/StaticArrayInterface.jl:488
│ in expression starting at /home/ufechner/.julia/packages/StaticArrayInterface/IzhAV/ext/StaticArrayInterfaceStaticArraysExt.jl:1
└ @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:51
┌ Warning: Error requiring `OffsetArrays` from `StaticArrayInterface`
│ exception =
│ LoadError: ArgumentError: Package StaticArrayInterface does not have Static in its dependencies:
│ - You may have a partially installed environment. Try `Pkg.instantiate()`
│ to ensure all packages in the environment are installed.
│ - Or, if you have StaticArrayInterface checked out for development and have
│ added Static as a dependency but haven't updated your primary
│ environment's manifest file, try `Pkg.resolve()`.
│ - Otherwise you may need to report an issue with StaticArrayInterface
│ Stacktrace:
│ [1] macro expansion
│ @ ./loading.jl:1167 [inlined]
│ [2] macro expansion
│ @ ./lock.jl:223 [inlined]
│ [3] require(into::Module, mod::Symbol)
│ @ Base ./loading.jl:1144
│ [4] include(mod::Module, _path::String)
│ @ Base ./Base.jl:419
│ [5] include(x::String)
│ @ StaticArrayInterface ~/.julia/packages/StaticArrayInterface/IzhAV/src/StaticArrayInterface.jl:1
│ [6] macro expansion
│ @ ~/.julia/packages/Requires/Z8rfN/src/Requires.jl:40 [inlined]
│ [7] top-level scope
│ @ ~/.julia/packages/StaticArrayInterface/IzhAV/src/StaticArrayInterface.jl:489
│ [8] eval
│ @ ./boot.jl:368 [inlined]
│ [9] eval
│ @ ~/.julia/packages/StaticArrayInterface/IzhAV/src/StaticArrayInterface.jl:1 [inlined]
│ [10] (::StaticArrayInterface.var"#58#64")()
│ @ StaticArrayInterface ~/.julia/packages/Requires/Z8rfN/src/require.jl:101
│ [11] macro expansion
│ @ ./timing.jl:382 [inlined]
│ [12] err(f::Any, listener::Module, modname::String, file::String, line::Any)
│ @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:47
│ [13] (::StaticArrayInterface.var"#57#63")()
│ @ StaticArrayInterface ~/.julia/packages/Requires/Z8rfN/src/require.jl:100
│ [14] withpath(f::Any, path::String)
│ @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:37
│ [15] (::StaticArrayInterface.var"#56#62")()
│ @ StaticArrayInterface ~/.julia/packages/Requires/Z8rfN/src/require.jl:99
│ [16] listenpkg(f::Any, pkg::Base.PkgId)
│ @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:20
│ [17] macro expansion
│ @ ~/.julia/packages/Requires/Z8rfN/src/require.jl:98 [inlined]
│ [18] __init__ ()
│ @ StaticArrayInterface ~/.julia/packages/StaticArrayInterface/IzhAV/src/StaticArrayInterface.jl:489
│ in expression starting at /home/ufechner/.julia/packages/StaticArrayInterface/IzhAV/ext/StaticArrayInterfaceOffsetArraysExt.jl:1
└ @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:51

```

This is the code that gets executed:

```julia
# activate the test environment if needed
using Pkg
if ! ("Plots" ∈ keys(Pkg.project().dependencies))
    using TestEnv; TestEnv.activate()
    Pkg.resolve()
end

@info "Loading packages ..."
using BenchmarkTools, Plots, KiteUtils, NLsolve, Parameters, StaticArrays, WinchModels, PackageCompiler, KiteViewers, 
      KiteModels, KitePodModels, StructTypes, YAML

@info "Creating sysimage ..."
push!(LOAD_PATH,joinpath(pwd(),"src"))

PackageCompiler.create_sysimage(
    [:BenchmarkTools, :Plots, :KiteUtils, :NLsolve, :Parameters, :StaticArrays, :WinchModels, :KiteViewers, 
     :KiteModels, :KitePodModels, :StructTypes, :YAML];
    sysimage_path="kps-image_tmp.so",
    precompile_execution_file=joinpath("test", "test_for_precompile.jl")
)

```

Any idea what is going wrong?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [March 4, 2023, 5:08pm UTC](https://discourse.julialang.org/t/staticarrayinterface-does-not-have-linearalgebra-in-its-dependencies/95548/2 "2023-03-04T17:08:05Z")

</div>

Interesting, it’s definitely in there: [StaticArrayInterface.jl/Project.toml at master · JuliaArrays/StaticArrayInterface.jl · GitHub](https://github.com/JuliaArrays/StaticArrayInterface.jl/blob/master/Project.toml#L9)

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [March 4, 2023, 5:11pm UTC](https://discourse.julialang.org/t/staticarrayinterface-does-not-have-linearalgebra-in-its-dependencies/95548/3 "2023-03-04T17:11:09Z")

</div>

Well, I am not using the latest version of StaticArrays…

```julia
(jl_rLyQaR) pkg> st
Status `/tmp/jl_rLyQaR/Project.toml`
  [6e4b80f9] BenchmarkTools v1.3.2
  [d0351b0e] InspectDR v0.4.3
  [82f05805] Joysticks v0.1.4
  [b19fd437] KiteControllers v0.1.7 `~/repos/KiteControllers`
  [b94af626] KiteModels v0.4.7
  [9de5dc81] KitePodModels v0.2.1
  [90980105] KiteUtils v0.4.8
  [2e593061] KiteViewers v0.2.4
  [2774e3e8] NLsolve v4.5.1
⌅ [510215fc] Observables v0.4.0
  [9b87118b] PackageCompiler v2.1.5
  [d96e819e] Parameters v0.12.3
⌃ [91a5bcdd] Plots v1.32.0
⌅ [90137ffa] StaticArrays v1.5.12
  [856f2bd8] StructTypes v1.10.0
⌅ [1e6cf692] TestEnv v1.9.3
  [21f18d07] Timers v0.1.5
  [7dcfa46b] WinchModels v0.1.1
  [ddb6d928] YAML v0.4.8
  [de0858da] Printf `@stdlib/Printf`
  [8dfed614] Test `@stdlib/Test`

```

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [March 4, 2023, 5:17pm UTC](https://discourse.julialang.org/t/staticarrayinterface-does-not-have-linearalgebra-in-its-dependencies/95548/4 "2023-03-04T17:17:30Z")

</div>

It’s saying StaticArrayInterface, and every release of the package has had it as a dep.

> <https://github.com/JuliaArrays/StaticArrayInterface.jl/blob/v1.0.0/Project.toml#L9>

My guess is that it’s a bad interaction between Requires and system image building. Using v1.9 with its extensions might be the right thing to do here.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [March 4, 2023, 7:00pm UTC](https://discourse.julialang.org/t/staticarrayinterface-does-not-have-linearalgebra-in-its-dependencies/95548/5 "2023-03-04T19:00:04Z")

</div>

Adding StaticArrayInterface to Project.toml, to the “using” statement and to `PackageCompiler.create_sysimage` solved the issue. Is this to be expected, or is it a bug in PackageCompiler?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [March 5, 2023, 5:51am UTC](https://discourse.julialang.org/t/staticarrayinterface-does-not-have-linearalgebra-in-its-dependencies/95548/6 "2023-03-05T05:51:10Z")

</div>

It must be some interaction between Requires and PackageCompiler

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [March 5, 2023, 6:14am UTC](https://discourse.julialang.org/t/staticarrayinterface-does-not-have-linearalgebra-in-its-dependencies/95548/7 "2023-03-05T06:14:37Z")

</div>

Files loaded by `Requires` should only load packages via `using ..Package` if it wants to be relocatable (and compatible with sysimages). That’s because these files are loaded at runtime.

So here it should use `using ..LinearAlgebra`.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [March 5, 2023, 6:27am UTC](https://discourse.julialang.org/t/staticarrayinterface-does-not-have-linearalgebra-in-its-dependencies/95548/8 "2023-03-05T06:27:58Z")

</div>

What do you mean with `Requires` ? Is it a package or a function? I am not aware that I am using `Requires`.

EDIT: Ok, now I see that it is a package used by StaticArrayInterface.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [March 5, 2023, 10:04am UTC](https://discourse.julialang.org/t/staticarrayinterface-does-not-have-linearalgebra-in-its-dependencies/95548/9 "2023-03-05T10:04:20Z")

</div>

Is this what you’re saying? [Fix Requires.jl fallback by ChrisRackauckas · Pull Request #22 · JuliaArrays/StaticArrayInterface.jl · GitHub](https://github.com/JuliaArrays/StaticArrayInterface.jl/pull/22)

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [March 5, 2023, 7:22pm UTC](https://discourse.julialang.org/t/staticarrayinterface-does-not-have-linearalgebra-in-its-dependencies/95548/10 "2023-03-05T19:22:52Z")

</div>

Yes, I think that should improve things.
