CachePath.requireMethod
Base.require(package::AbstractString, depot_path::AbstractString)
Base.require(package::PkgId, depot_path::AbstractString)

Load package and store the cached precompile file in the depot specified by depot_path. If it does not exist, depot_path is created. If the cached precompiled file is found in depot_path, then it is loaded.

Examples

const Example = Base.require("Example", "./a_depot")
CachePath.requireMethod
CachePath.require(into::Module, module::Symbol, depot_path::AbstractString)

This function is modified from Base.require. The precompiled cache (.ji file) for module will only be searched for and stored in depot_path.

Loads a source file, in the context of the Main module, on every active node, searching standard locations for files. require is considered a top-level operation, so it sets the current include path but does not use it to search for files (see help for include). This function is typically used to load library code, and is implicitly called by using to load packages.

When searching for files, require first looks for package code in the global array LOAD_PATH. require is case-sensitive on all platforms, including those with case-insensitive filesystems like macOS and Windows.

For more details regarding code loading, see the manual sections on modules and parallel computing.

CachePath.@cpimportMacro
@cpimport module depot_path::AbstractString

Import module using depot_path to store and retrieve the precompile cache. Precompile caches existing elsewhere are ignored.

The semantics of @cpimport probably differ from those of import in other ways.

Examples:

Import the module Example using "./newdepot" for storing and retrieving the precompile cache.

julia> @cpimport Example "./newdepot"