Julia on a cluster using SLURM, dependencies

Run this once with a script that installs the packages you want (or maybe even do it from an interactive slurm job so you can play around and double check everything). That would create a bunch of precompiled julia-related caches in the ~/.julia folder.

Then just run your julia work (with the same project file). The packages will be available because you are using the same project file.

If you want to be extremely careful, you can even print Pkg.status() and InteractiveUtils.versioninfo() at the start of your jobs so you have proof in your log files that everything you cared about is indeed pre-installed.

If you want to run the script script.jl, just add it to the end of your last line, i.e. julia --project="..." script.jl

EDIT: If you want to, you can edit the Project.toml file by hand (but NOT the Manifest file). You will need to use the instantiate command if you edit it by hand. But just using Pkg.add would perform the edits for you as well and it probably more convenient. You can press the ] button to enter the pkg management mode.

1 Like