This lesson is in the early stages of development (Alpha version)

Programming with Julia: Setup

This lesson requires a terminal emulator (“shell”), a text editor (“nano”), and Julia. Please make sure that all three are installed.

The Bash Shell

Bash is a commonly-used shell that gives you the power to do tasks more quickly.

  1. Download the Git for Windows installer.
  2. Run the installer and follow the steps below:
    1. Click on "Next" four times (two times if you've previously installed Git). You don't need to change anything in the Information, location, components, and start menu screens.
    2. From the dropdown menu select "Use the Nano editor by default" (NOTE: you will need to scroll up to find it) and click on "Next".
    3. On the page that says "Adjusting the name of the initial branch in new repositories", ensure that "Let Git decide" is selected. This will ensure the highest level of compatibility for our lessons.
    4. Ensure that "Git from the command line and also from 3rd-party software" is selected and click on "Next". (If you don't do this Git Bash will not work properly, requiring you to remove the Git Bash installation, re-run the installer and to select the "Git from the command line and also from 3rd-party software" option.)
    5. Ensure that "Use the native Windows Secure Channel Library" is selected and click on "Next".
    6. Ensure that "Checkout Windows-style, commit Unix-style line endings" is selected and click on "Next".
    7. Ensure that "Use Windows' default console window" is selected and click on "Next".
    8. Ensure that "Default (fast-forward or merge) is selected and click "Next".
    9. Ensure that "Git Credential Manager Core" is selected and click on "Next".
    10. Ensure that "Enable file system caching" is selected and click on "Next".
    11. Click on "Install".
    12. Click on "Finish" or "Next".
  3. If your "HOME" environment variable is not set (or you don't know what this is):
    1. Open command prompt (click on the Start Menu then type cmd and press Enter)
    2. Type the following line into the command prompt window exactly as shown:

      setx HOME "%USERPROFILE%"

    3. Press Enter, you should see SUCCESS: Specified value was saved.
    4. Quit command prompt by typing exit then pressing Enter

This will provide you with both Git and Bash in the Git Bash program.

Video Tutorial

The default shell in some versions of macOS is Bash, and Bash is available in all versions, so no need to install anything. You access Bash from the Terminal (found in /Applications/Utilities). See the Git installation video tutorial for an example on how to open the Terminal. You may want to keep Terminal in your dock for this workshop.

To see if your default shell is Bash type echo $SHELL in Terminal and press the Return key. If the message printed does not end with '/bash' then your default is something else and you can run Bash by typing bash

If you want to change your default shell, see this Apple Support article and follow the instructions on "How to change your default shell".

Video Tutorial

The default shell is usually Bash and there is usually no need to install anything.

To see if your default shell is Bash type echo $SHELL in a terminal and press the Enter key. If the message printed does not end with '/bash' then your default is something else and you can run Bash by typing bash.

Text Editor

When you're writing code, it's nice to have a text editor that is optimized for writing code, with features like automatic color-coding of key words.

The default text editor on macOS and Linux is usually set to Vim, which is not famous for being intuitive. If you accidentally find yourself stuck in it, hit the Esc key, followed by :+Q+! (colon, lower-case 'q', exclamation mark), then hitting Return to return to the shell.

We will use nano, a simpler editor that is more forgiving to newcomers. It will be familiar to you from The Carpentries' lessons on the Unix Shell and Git.

nano is a basic editor and the default that instructors use in the workshop. It is installed along with Git.

nano is a basic editor and the default that instructors use in the workshop. See the Git installation video tutorial for an example on how to open nano. It should be pre-installed.

Video Tutorial

nano is a basic editor and the default that instructors use in the workshop. It should be pre-installed.

Julia

Julia is a scientific programming language. You can find the latest version, along with installation instructions for your operating system, on the Julia download page. Alternatively you can use juliaup to install julia and manage julia installations.

    1. Open a web browser (Firefox, Chrome, etc.) and visit the Julia download page.
    2. Download the Current stable release for Windows by clicking the 64-bit (installer) link.
    3. Run the installer once it finishes downloading.
    4. Click on Next to accept the default directory (or after specifying your preferred installation location).
    5. On the Select Additional Tasks screen under Other, check the box to Add Julia to PATH.
    6. Click Next.
    7. Click on Finish.

We will run Julia through the Git-Bash interface. Once you have it installed:

    1. Open the Start menu and click on the Git folder.
    2. Click on Git Bashnot Git Cmd!
    3. A warning message might pop up about a missing icon: click "I see," and continue.
    4. Once the terminal window loads, type julia and enjoy the lesson!

using juliaup

Run curl -fsSL https://install.julialang.org | sh or brew install juliaup when you want to use homebrew.

Manual

Download the current stable release from the Julia download page and follow the installation instructions.

using juliaup

Run curl -fsSL https://install.julialang.org | sh.

Manual

Download the current stable release from the Julia download page and unpack the folder to any location that is in your PATH or link the binary in the bin folder to such a location.