All Collections
Tips and Tricks
New and additional languages, toolboxes and compilers
Adding Julia to your capsule's environment via the postInstall and run scripts
Adding Julia to your capsule's environment via the postInstall and run scripts

A short postInstall script and a few commands in your run script will take care of it.

Shahar Zaks avatar
Written by Shahar Zaks
Updated over a week ago

Generally, you can access Julia by either starting from a Julia-baed environment or adding it through conda. If you need, say, MATLAB and Julia, or Stata and Julia, you'll need to use the postInstall script:

  1. Choose the appropriate release from https://julialang.org/downloads/ and copy it into your clipboard.

  2. In your postInstall script, write something like:

#!/usr/bin/env bash
set -e

curl -L https://julialang-s3.julialang.org/bin/linux/x64/1.2/julia-1.2.0-linux-x86_64.tar.gz | tar xz

(This will download Julia 1.2.0.)

3. Add a line that adds Julia to the PATH to your run  script . If you are downloading Julia 1.2, your run  script will look like:

#!/usr/bin/env bash
set -ex

export PATH=$PATH:/julia-1.2.0/bin/

You can test that this worked by running julia --version .
For a more thorough overview of writing postInstall scripts, see Tutorial: how to write a postInstall script that downloads and installs research software.

Did this answer your question?