1234567891011121314151617181920212223242526272829303132333435363738 |
- using Pkg; Pkg.activate(@__DIR__); Pkg.instantiate()
- using PackageCompiler
-
- using Scratch
-
- Pkg.activate(joinpath(@__DIR__, ".."))
- using JLD2View
- scratchdir = get_scratch!(JLD2View, "sysimages")
-
- # List of packages to include in the sysimage
- packages = :JLD2View #Symbol.(keys(Pkg.project().dependencies))
-
- # Sysimage base name
- sysimage_name = "sysimage"
-
- # Sysimage extension
- sysimage_ext = if Sys.iswindows()
- ".dll"
- elseif Sys.isapple()
- ".dylib"
- else
- ".so"
- end
-
- sysimage_path = joinpath(scratchdir, sysimage_name * sysimage_ext)
-
- @info("Creating system image",
- name=sysimage_path,
- packages)
-
- create_sysimage(
- packages,
- sysimage_path = sysimage_path,
- precompile_execution_file = joinpath(@__DIR__, "precomp.jl"),
-
- # Optional: generate a "portable" sysimage on x86-64 architectures
- cpu_target = "generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)",
- )
|