# \[ANN\] Makie Update: Figures And Integrated Layouts

**URL:** <https://discourse.julialang.org/t/ann-makie-update-figures-and-integrated-layouts/52800>\
**Category:** Package Announcements\
**Created:** [January 3, 2021, 10:14pm UTC](https://discourse.julialang.org/t/ann-makie-update-figures-and-integrated-layouts/52800 "2021-01-03T22:14:06Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [January 7, 2021, 12:18pm UTC](https://discourse.julialang.org/t/ann-makie-update-figures-and-integrated-layouts/52800/21 "2021-01-07T12:18:55Z")

</div>

@jules the rename to `Text` came with a problem:

```julia
WARNING: both AbstractPlotting and Base export "Text"; uses of it in module InteractiveChaos must be qualified
UndefVarError: Text not defined

```

---

<div class="post-metadata">

**Author:** ![yha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yha/32/3502_2.png) [@yha](https://discourse.julialang.org/u/yha)\
**Post date:** [January 7, 2021, 12:21pm UTC](https://discourse.julialang.org/t/ann-makie-update-figures-and-integrated-layouts/52800/22 "2021-01-07T12:21:47Z")

</div>

Apparently `LText` is called `Label` now. `AbstractPlotting.Text` is a plot type related to the `text` function (like `Lines` and `lines`).

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [January 7, 2021, 1:15pm UTC](https://discourse.julialang.org/t/ann-makie-update-figures-and-integrated-layouts/52800/23 "2021-01-07T13:15:50Z")

</div>

Exactly, because of the Text collision 🙂 Same for LRect =\> Box, because Rect has a meaning from GeometryBasics already

---

<div class="post-metadata">

**Author:** ![kragol](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kragol/32/10204_2.png) [@kragol](https://discourse.julialang.org/u/kragol)\
**Post date:** [January 7, 2021, 2:40pm UTC](https://discourse.julialang.org/t/ann-makie-update-figures-and-integrated-layouts/52800/24 "2021-01-07T14:40:57Z")

</div>

I have successfully compiled a sysimage using the following files. This is quite a big hack and the set of functions covered is probably not ideal but it does reduce the time to first plot very nicely for me.

have not experienced any serious issue with that sysimage so far. (I do seem to have a bug with `Revise` coming up sporadically where the REPL freezes whenever an error should be displayed but I am not sure if it is related.)

The `precompile_execution_file` is basically the `runtests.jl` file from `AbstractPlotting` minus the `reference_tests` which I thought were pulling too many packages I do not need.

`precompile_Makie.jl`

```julia
using GLMakie

using Pkg
pkg"add PackageCompiler"

using PackageCompiler

create_sysimage(
    :GLMakie; 
    sysimage_path="MakieSys.so", 
    precompile_execution_file=joinpath("./AbstractPlotting_runtests_stripped.jl")
)

```

`AbstractPlotting_runtests_stripped.jl` (based on `AbstractPlotting/test/runtests.jl`)

```julia
using Pkg
using Test
using MeshIO
using StaticArrays
using AbstractPlotting
using ImageMagick

using AbstractPlotting.Observables
using AbstractPlotting.GeometryBasics
using AbstractPlotting.PlotUtils
using AbstractPlotting.FileIO
using AbstractPlotting.IntervalSets
using GeometryBasics: Pyramid

# ImageIO seems broken on 1.6 ... and there doesn't
# seem to be a clean way anymore to force not to use a loader library?
filter!(x-> x !== :ImageIO, FileIO.sym2saver[:PNG])
filter!(x-> x !== :ImageIO, FileIO.sym2loader[:PNG])

# include("reference_tests.jl")
# include("unit_tests/runtests.jl")
include(joinpath(pkgdir(AbstractPlotting), "test", "unit_tests","runtests.jl"))

```

Edit: fixed wrong package name in call to `create_sysimage`

---

<div class="post-metadata">

**Author:** ![airpmb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/airpmb/32/7826_2.png) [@airpmb](https://discourse.julialang.org/u/airpmb)\
**Post date:** [January 7, 2021, 3:58pm UTC](https://discourse.julialang.org/t/ann-makie-update-figures-and-integrated-layouts/52800/25 "2021-01-07T15:58:59Z")

</div>

> [@kragol](#):
>
> ```julia
> create_sysimage(
> :Makie; 
> sysimage_path="MakieSys.so", 
> precompile_execution_file=joinpath("./AbstractPlotting_runtests_stripped.jl")
> )
> 
> ```

Thanks, but unfortunately this gets me the same error message I’ve been hitting:

```julia
julia> create_sysimage(
           :Makie; 
           sysimage_path="MakieSys.so", 
           precompile_execution_file=joinpath("./AbstractPlotting_runtests_stripped.jl")
       )
ERROR: AssertionError: sourcepath !== nothing
Stacktrace:
 [1] is_package_downloaded at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/Operations.jl:1670 [inlined]
 [2] #12 at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/Operations.jl:113 [inlined]
 [3] _all(::Pkg.Operations.var"#12#13"{Pkg.Types.Context}, ::Array{Pkg.Types.PackageSpec,1}, ::Colon) at ./reduce.jl:828
 [4] #all#638 at ./reducedim.jl:735 [inlined]
 [5] all at ./reducedim.jl:735 [inlined]
 [6] is_instantiated at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/Operations.jl:113 [inlined]
 [7] instantiate(::Pkg.Types.Context; manifest::Nothing, update_registry::Bool, verbose::Bool, platform::Pkg.BinaryPlatforms.MacOS, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/API.jl:828
 [8] instantiate(::Pkg.Types.Context) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/API.jl:795
 [9] create_sysimage(::Symbol; sysimage_path::String, project::String, precompile_execution_file::String, precompile_statements_file::Array{String,1}, incremental::Bool, filter_stdlibs::Bool, replace_default::Bool, cpu_target::String, script::Nothing, base_sysimage::Nothing, isapp::Bool) at /Users/patrick/.julia/packages/PackageCompiler/KeZOk/src/PackageCompiler.jl:420
 [10] top-level scope at REPL[3]:1

```

I’ve [asked](https://julialang.zulipchat.com/#narrow/stream/225542-helpdesk/topic/Error.20during.20instantiation.20%28trying.20to.20precompile.20Makie%29/near/221826445) over on the Zulip #helpdesk channel about this but haven’t heard any replies yet.

Would you mind sharing your Project.toml and Manifest.toml?

---

<div class="post-metadata">

**Author:** ![kragol](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kragol/32/10204_2.png) [@kragol](https://discourse.julialang.org/u/kragol)\
**Post date:** [January 7, 2021, 5:44pm UTC](https://discourse.julialang.org/t/ann-makie-update-figures-and-integrated-layouts/52800/26 "2021-01-07T17:44:07Z")

</div>

Hmmm, I think the problem might be that I specified `Makie` as the package to include in the sysimage but current `Makie` is not compatible with `AbstractPlotting` \>=0.15. (I forgot that I had a locally modified `Makie` package that _is_ compatible with `AbstractPlotting` \>=0.15)

When I remove `Makie` from the environment, I get a different error than yours but then again I do have a downloaded version of `Makie` in my `.julia/packages` folder. It looks like maybe you do not have any? (wild guess based on the stack trace)

In any case, you really should put `:GLMakie` instead of `:Makie` in the call to `create_sysimage`. (original post has been edited)

`Project.toml` and `Manifest.toml` files can be found there: [https://gist.github.com/kragol/ddbb92b31f004e13cd7dff1b7fb8acb0](https://gist.github.com/kragol/ddbb92b31f004e13cd7dff1b7fb8acb0)

---

<div class="post-metadata">

**Author:** ![airpmb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/airpmb/32/7826_2.png) [@airpmb](https://discourse.julialang.org/u/airpmb)\
**Post date:** [January 8, 2021, 6:16pm UTC](https://discourse.julialang.org/t/ann-makie-update-figures-and-integrated-layouts/52800/27 "2021-01-08T18:16:30Z")

</div>

Hmm, still getting the `sourcepath !== nothing` error. I created a new package and placed your .toml files in it. The entry for MakieGallery pointed to a local dev path of yours so I replaced it with `] dev MakieGallery`. Then from the package folder I’m running `julia --project precompile_Makie.jl`.

I put the package repo here, maybe you could take a peek: [Patrick Bouffard / MakieBuild · GitLab](https://gitlab.com/pbouffard/MakieBuild.jl)

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [January 8, 2021, 6:45pm UTC](https://discourse.julialang.org/t/ann-makie-update-figures-and-integrated-layouts/52800/28 "2021-01-08T18:45:42Z")

</div>

> [@airpmb](#):
>
> MakieGallery

MakieGallery must not be in the project! I think i even know that error and it was introduced by MakieGallery.  
MakieGallery is deprecated (should archieve it), and you should use something like [kragol](https://discourse.julialang.org/u/kragol) …  
I may want to take a look at precompilation this weekend. Ideally, all deps have precompile files already, and then you should be able to just run `create_sysimage(:GLMakie)`

---

<div class="post-metadata">

**Author:** ![kragol](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kragol/32/10204_2.png) [@kragol](https://discourse.julialang.org/u/kragol)\
**Post date:** [January 14, 2021, 11:45pm UTC](https://discourse.julialang.org/t/ann-makie-update-figures-and-integrated-layouts/52800/29 "2021-01-14T23:45:29Z")

</div>

Looking at your zulip post, it seems your problem is not really with the precompilation of `GLMakie` but with the package manager. The fact that you get an error when calling `instantiate` has nothing to do with the sysimage compilation. It is more likely due to some issue with your julia configuration or package cache.

I’d suggest maybe removing (or just renaming) your `.julia` folder (where julia stores all downloaded packages and default environments) and try rebuilding the environment from a basic `Project.toml` containing only `GLMakie` at first. If that works you can add `PackageCompiler`, `Test` and the other modules I put in my precompilation script.

Alternatively, you may want to consider these slightly simpler precompilation instructions [https://github.com/JuliaPlots/Makie.jl/issues/799#issuecomment-752599938](https://github.com/JuliaPlots/Makie.jl/issues/799#issuecomment-752599938) which require fewer packages in the environment (but might also precompile less stuff).

Finally, do follow @sdanisch’s advice and make sure you do not add `MakieGallery` to the environment. It is not compatible with the recent `AbstractPlotting` changes and will hold it back to an old version. The version I have in my dev dir was modified to test if it might be compatible with little modification (not the case). Sorry for the confusion. I have modified the environment files on github.

---

<div class="post-metadata">

**Author:** ![kragol](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kragol/32/10204_2.png) [@kragol](https://discourse.julialang.org/u/kragol)\
**Post date:** [January 14, 2021, 11:52pm UTC](https://discourse.julialang.org/t/ann-makie-update-figures-and-integrated-layouts/52800/30 "2021-01-14T23:52:16Z")

</div>

Sorry, replied to myself instead of you. Here is a link.

> [@\[ANN\] Makie Update: Figures And Integrated Layouts](https://discourse.julialang.org/t/ann-makie-update-figures-and-integrated-layouts/52800/29):
>
> Looking at your zulip post, it seems your problem is not really with the precompilation of GLMakie but with the package manager. The fact that you get an error when calling instantiate has nothing to do with the sysimage compilation. It is more likely due to some issue with your julia configuration or package cache. I’d suggest maybe removing (or just renaming) your .julia folder (where julia stores all downloaded packages and default environments) and try rebuilding the environment from a basi…

---

<div class="post-metadata">

**Author:** ![airpmb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/airpmb/32/7826_2.png) [@airpmb](https://discourse.julialang.org/u/airpmb)\
**Post date:** [January 15, 2021, 12:06am UTC](https://discourse.julialang.org/t/ann-makie-update-figures-and-integrated-layouts/52800/31 "2021-01-15T00:06:46Z")

</div>

> [@kragol](#):
>
> Sorry, replied to myself instead of you. Here is a link.

Thanks. I’ll give that a try when I get a chance but meanwhile I tried just simply

```julia
using GLMakie

using PackageCompiler

create_sysimage(
    [:GLMakie, :AbstractPlotting, :MeshIO]; sysimage_path="MakieSys.so")

```

Which actually speeds things up quite a bit without any precompile file.

---

<div class="post-metadata">

**Author:** ![bicepjai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bicepjai/32/18158_2.png) [@bicepjai](https://discourse.julialang.org/u/bicepjai)\
**Post date:** [March 4, 2021, 5:59am UTC](https://discourse.julialang.org/t/ann-makie-update-figures-and-integrated-layouts/52800/32 "2021-03-04T05:59:24Z")

</div>

Were you able to use makie plots ?

[Previous page](https://discourse.julialang.org/t/ann-makie-update-figures-and-integrated-layouts/52800.md?page=1)
