The goal of this recipe is to present how to install and configure the Julia environment with the development toolbox. We show basic installation instructions for Linux and Windows.
Installing Julia from binaries
Getting ready
In this recipe, we present how to install and configure Julia on Windows and Linux.
All Linux examples in this book have been tested on Linux Ubuntu 18.04.1 LTS and Windows 10. All Linux Ubuntu commands have been run as the user ubuntu. Please note that users of other Linux distributions will need to update their scripts (for example, Linux distributions from the Red Hat family use yum instead of apt).
For Windows examples in this book, we use Windows 10 Professional.
How to do it...
For most users, the recommended way to start with Julia is to use a binary version.
In this section, we present the following options:
- Installing Julia on Linux Ubuntu
- Installing Julia on Windows
Installing Julia on Linux Ubuntu
Installing the binary release is the easiest way to proceed with Julia on Linux. Here, we show how to install Julia on Ubuntu, although the steps will be very similar for other Linux distributions.
Before the installation and use of Julia, we recommend installing a standard set of build tools for the Linux platform. Although this is not required for running Julia itself, several Julia package installers assume that the standard build tools set is present on the operating system. Hence, run the following commands in bash:
$ sudo apt update
$ sudo apt -y install build-essential
In order to install Julia, simply download the binary archive from julialang.org, uncompress it, and finally create a symbolic link named Julia. These steps are shown in the following three bash commands (we assume that these commands are run in the /home/ubuntu folder):
$ wget https://julialang-s3.julialang.org/bin/linux/x64/1.0/julia-1.0.1-linux-x86_64.tar.gz
$ tar xvfz julia-1.0.1-linux-x86_64.tar.gz
$ sudo ln -s /home/ubuntu/julia-1.0.1/bin/julia /usr/local/bin/julia
Please note that the last command creates a symbolic link to the Julia binaries. After this installation, it is sufficient to run the julia command in the OS shell to start working with Julia.
Please note that on the Julia web page (https://julialang.org/downloads/), a newer version of the installer could be available. You can update the preceding script accordingly by simply updating the filename. Additionally, nightly build Julia versions are available on the preceding website. These versions are only recommended for testing new language features.
Installing Julia on Windows
The most convenient way to install Julia on Windows is by using the binary version installer available from the JuliaLang website.
The following steps are required to install Julia on a Windows system:
- Download the Windows Self-Extracting Archive (.exe) from https://julialang.org/downloads/. It is recommended to select the 64-bit version.
- Run the downloaded *.exe file to unpack Julia. We recommend extracting Julia into a directory path that does not contain any spaces, for example, C:\Julia-1.0.1.
- After a successful installation, a Julia shortcut will be added to your start menu—at this point, you can select the shortcut to see whether Julia loads correctly.
- Add julia.exe to your system path, as follows:
- Open Windows Explorer, right-click on the This PC computer icon, and select Properties.
- Click Advanced system settings and go to Environment Variables....
- Select the Path variable and click Edit....
- To the variable value, add C:\Julia-1.0.1\bin (in this instruction, we assume that Julia has been installed to C:\Julia-1.0.1). Please note that, depending on your Windows version, there is either one Path value per line or a semicolon ; is used to separate values in the Path list.
- Click OK to confirm. Now, Julia can be run anywhere from the console.
When adding julia.exe to your system path, please note that there are two variable groups on this screen, User variables and System variables. We recommend using User variables. Please note that adding julia.exe to the system Path makes it possible for other tools, such as Juno, to automatically locate Julia (Juno also allows for manual Julia path configuration—this can be found in the option marked Packages | Julia client | Settings).
The steps to install ConEmu on your Windows system are as follows:
- Go to the ConEmu website (http://conemu.github.io/) and click the Download link. Select Download ConEmu Stable Installer.
- Once you download the *.exe file, run it to install ConEmu. Select the 64-bit version in the installer; other settings can keep their default values.
- Once ConEmu is installed, a new link in the start menu and on the desktop will be created.
- During the first application run, ConEmu asks about color settings—just stay with the defaults. Run ConEmu, type julia, and press Enter, and you should see a Julia prompt.
There's more...
Those users who want to try Julia without the installation process should try JuliaBox.
JuliaBox is a ready-made pre-installed Julia environment accessible from the web browser. It is available at https://juliabox.com/. You can use this version to play with a preconfigured and installed version of the Julia environment. Julia is available in a web browser via the Jupyter Notebook environment. The website is free to use, though it does require registration. JuliaBox comes with a set of pre-configured popular Julia libraries and is therefore ready for immediate use. This is an ideal solution for people wanting to try out the language or for using Julia inside a classroom.
See also
Excellent documentation on how to install Julia on various systems can be found on the JuliaLang website: https://julialang.org/downloads/platform.html.