@jules the rename to Text
came with a problem:
WARNING: both AbstractPlotting and Base export "Text"; uses of it in module InteractiveChaos must be qualified
UndefVarError: Text not defined
@jules the rename to Text
came with a problem:
WARNING: both AbstractPlotting and Base export "Text"; uses of it in module InteractiveChaos must be qualified
UndefVarError: Text not defined
Apparently LText
is called Label
now. AbstractPlotting.Text
is a plot type related to the text
function (like Lines
and lines
).
Exactly, because of the Text collision Same for LRect => Box, because Rect has a meaning from GeometryBasics already
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
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
)
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
Thanks, but unfortunately this gets me the same error message I’ve been hitting:
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 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?
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
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
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 …
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)
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 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.
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
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.
Were you able to use makie plots ?