Julia: Cannot export symbols with `using` of a package added to a custom system image

Created on 19 Sep 2018  路  3Comments  路  Source: JuliaLang/julia

Hi!

I am trying to create a new system image with a package inside. I am building it with:

julia build_sysimg.jl /tmp/test core2 userimg.jl

in which userimg.jl contains:

using SatelliteToolbox

The image is build correctly, but, when I run Julia with julia -J /tmp/test.so and try to use my package, I get the error:

julia> using SatelliteToolbox
ERROR: ArgumentError: Package SatelliteToolbox not found in current path:
- Run `Pkg.add("SatelliteToolbox")` to install the SatelliteToolbox package.

Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:817

All the functions are available using SatelliteToolbox. like:

julia> SatelliteToolbox.igrf12(2012, 700, 0,0, Val{:geodetic})
3-element StaticArrays.SArray{Tuple{3},Float64,1,3}:
  27528.815473061582 
  -2815.9294028897752
 -15580.51499405477  

Most helpful comment

using Foo means to detect the package UUID of Foo based on the LOAD_PATH (and project file in them) and then load the package with that uuid. Without having the package in the LOAD_PATH we can't know what UUID it has and thus can't load it.

using .Foo just means to bring the exports from the module Foo in out scope into this scope.

Not sure if this explanation is very good...

All 3 comments

using .SatelliteToolbox?

@KristofferC it works perfectly! Is it documented? Did I miss something?

using Foo means to detect the package UUID of Foo based on the LOAD_PATH (and project file in them) and then load the package with that uuid. Without having the package in the LOAD_PATH we can't know what UUID it has and thus can't load it.

using .Foo just means to bring the exports from the module Foo in out scope into this scope.

Not sure if this explanation is very good...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arshpreetsingh picture arshpreetsingh  路  3Comments

manor picture manor  路  3Comments

i-apellaniz picture i-apellaniz  路  3Comments

felixrehren picture felixrehren  路  3Comments

Keno picture Keno  路  3Comments