References
PackageCompiler.create_sysimage — Functioncreate_sysimage(packages::Union{Symbol, Vector{Symbol}}; kwargs...)Create a system image that includes the package(s) in packages. An attempt to automatically find a compiler will be done but can also be given explicitly by setting the environment variable JULIA_CC to a path to a compiler
Keyword arguments:
sysimage_path::Union{String,Nothing}: The path to where the resulting sysimage should be saved. If set tonothingthe keyword argumentreplace_defaltneeds to be set totrue.project::String: The project that should be active when the sysimage is created, defaults to the current active project.precompile_execution_file::Union{String, Vector{String}}: A file or list of files that contain code which precompilation statements should be recorded from.precompile_statements_file::Union{String, Vector{String}}: A file or list of files that contains precompilation statements that should be included in the sysimage.incremental::Bool: Iftrue, build the new sysimage on top of the sysimage of the current process otherwise build a new sysimage from scratch. Defaults totrue.filter_stdlibs::Bool: Iftrue, only include stdlibs that are in the project file. Defaults tofalse, only set totrueif you know the potential pitfalls.replace_default::Bool: Iftrue, replaces the default system image which is automatically used when Julia starts. To replace with the one Julia ships with, userestore_default_sysimage()
Advanced keyword arguments
cpu_target::String: The value to use forJULIA_CPU_TARGETwhen building the system image.script::String: Path to a file that gets executed in the--output-oprocess.
PackageCompiler.restore_default_sysimage — Functionrestore_default_sysimage()Restores the default system image to the one that Julia shipped with. Useful after running create_sysimage with replace_default=true.
PackageCompiler.create_app — Functioncreate_app(app_source::String, compiled_app::String; kwargs...)Compile an app with the source in app_source to the folder compiled_app. The folder app_source needs to contain a package where the package include a function with the signature
julia_main()::Cint
# Perhaps do something based on ARGS
...
endThe executable will be placed in a folder called bin in compiled_app and when the executabl run the julia_main function is called.
An attempt to automatically find a compiler will be done but can also be given explicitly by setting the envirnment variable JULIA_CC to a path to a compiler.
Keyword arguments:
app_name::String: an alternative name for the compiled app. If not provided, the name of the package (as specified in Project.toml) is used.precompile_execution_file::Union{String, Vector{String}}: A file or list of files that contain code which precompilation statements should be recorded from.precompile_statements_file::Union{String, Vector{String}}: A file or list of files that contains precompilation statements that should be included in the sysimage for the app.incremental::Bool: Iftrue, build the new sysimage on top of the sysimage of the current process otherwise build a new sysimage from scratch. Defaults tofalse.filter_stdlibs::Bool: Iftrue, only include stdlibs that are in the project file. Defaults tofalse, only set totrueif you know the potential pitfalls.audit::Bool: Warn about eventual relocatability problems with the app, defaults totrue.force::Bool: Remove the foldercompiled_appif it exists before creating the app.
Advanced keyword arguments
cpu_target::String: The value to use forJULIA_CPU_TARGETwhen building the system image.
PackageCompiler.audit_app — Functionaudit_app(app_dir::String)Check for possible problems with regards to relocatability for the project at app_dir.
This cannot guarantee that the project is free of relocatability problems, it can only detect some known bad cases and warn about those.