Julia-related procedures#
In this section, we will show you a few things related specifically to running code reproducibly with Julia. For more general debugging tips for Julia and other computer languages, see our wiki.
The following instructions are primarily for Linux.
You may need to use Conda on our Windows systems.
Managing multiple Julia versions#
Julia has a native version manager. Follow instructions at JuliaLang/juliaup to install it - it will be installed in your personal directory (so is not shared). Then, to add a particular Julia version,
juliaup add 1.9.2
juliaup default 1.9.2
and your next call to Julia will launch 1.9.2.
Julia is picky about how environments are passed to workers#
julia --project=julia16 -p 4
should start with the project installed in folder julia16
and 4 worker processes. In fact, the worker processes ignore the project packages, and the whole thing fails (see this link).
Workaround:
export JULIA_PROJECT=julia16
julia -p 4
seems to work.
Importing someone else’s Julia environment#
An author using Julia may have included Project.toml
and/or Manifest.toml
, which specify Julia version and dependencies. To activate this environment (one time action):
julia --project=project/path -e 'using Pkg; Pkg.instantiate()'
where project/path
contains Project.toml
and Manifest.toml
(typically, the code directory). (more information here).
Alternatively, you can add
using Pkg
Pkg.instantiate()
at the top of the main file (if there is one), and invoke this
export JULIA_PROJECT=project/path
julia -p 4 main.jl
In many cases, project/path
will be .
, i.e., main.jl
and the TOML files are in the same directory.