Skip to contents

Instantiate the Julia environment for sdbuildR to run stock-and-flow models using Julia. For more guidance, see this vignette.

Usage

install_julia_env(remove = FALSE, force = FALSE, quiet = FALSE)

Arguments

remove

If TRUE, remove the Julia environment for sdbuildR by deleting its environment directory (containing Project.toml and Manifest.toml). All other Julia packages and environments remain untouched. The packages themselves stay in your Julia depot, so reinstalling is quick; run Pkg.gc() in Julia if you want to reclaim that disk space.

force

If TRUE, rebuild the environment from scratch even when it is already up to date. By default an environment that is already installed, built from the same dependencies, and resolved by a compatible version of Julia is left alone, since rebuilding re-resolves every package and forces Julia to precompile them all again. Defaults to FALSE.

quiet

If TRUE, suppress informational messages such as progress and status updates. Warnings and errors are always shown. Defaults to FALSE.

Value

Invisibly returns NULL after instantiating the Julia environment.

Details

install_julia_env() will:

  • Start a Julia session

  • Activate a Julia environment using sdbuildR's Project.toml

  • Install SystemDynamicsBuildR.jl from GitHub (https://github.com/kcevers/SystemDynamicsBuildR.jl)

  • Install all other required Julia packages

  • Create Manifest.toml

  • Precompile packages for faster subsequent loading

  • Stop the Julia session

Note that this may take 10-25 minutes the first time as Julia downloads and compiles packages.

See also

Examples

if (FALSE) { # \dontrun{
install_julia_env()

# Remove Julia environment
install_julia_env(remove = TRUE)
} # }