Invitation to Julia for scientific computing

We will not spend much time discussing installation during the workshop. Here are some instructions; if you have problems, people at the workshop will help you with installing the software.

For the moment, there are two installation-free solutions:

Installing Julia

Binary install

The simplest way to install Julia is with a binary install: download an installer for your operating system from here.

If you use Windows, you will also want (need) to install git for Windows, which provides a Unix-like shell.

Source install

The install from source (which requires compiling Julia itself) takes around 1 hour. At the prompt in a shell, do


In [ ]:
$ git clone git@github.com:JuliaLang/julia.git
$ cd julia
$ git checkout release-0.3
$ make -j 4

Leave out the line git checkout release-0.3 to have the development v0.4 version.

The number 4 in the last line is the number of processors that will be used for the build. It requires various other tools to be already installed, in particular C, C++ and Fortran compilers, cmake and m4; see full details in the Julia README here.

Juno

Juno is a great IDE (Integrated Development Environment) for Julia. It can also be downloaded from here; see also http://junolab.org.

IJulia

IJulia is a Julia interface for the Jupyter (formerly IPython) notebook that we will use extensively.

These notebooks are written with version 3 of IPython/Jupyter. If you have previously installed IPython, you must check the version of IPython by running it from the command line and checking which version it is, or just using


In [ ]:
> ipython --version

Only versions 2.4 and above can read notebooks produced by IPython. We highly recommend that you install the latest stable version (currently 3.1) of IPython.

Install IPython/Jupyter

First you must install IPython/Jupyter. (Currently, the parts of IPython which are not directly related to Python are in the process of being separated out into a package called Jupyter.) The simplest way to do so is to install the free Anaconda Python distribution, which includes IPython, the matplotlib plotting library, and many other useful Python packages.

If you prefer something more lightweight, you can use pip (an installer for Python packages):


In [ ]:
pip install --upgrade ipython[all]

On Ubuntu, you may [depending which packages you already have installed] first need to do


In [ ]:
sudo apt-get install python-dev
sudo apt-get install python-pip

On Mac OSX you will need to add the two lines


In [ ]:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

to the .bash_profile file in your home directory (or create that file with that content if it does not already exist).

Installing the IJulia package

Once the IPython notebook has been installed, run Julia, and from within Julia add the IJulia package:


In [ ]:
julia> Pkg.add("IJulia")

After several things have been installed, you should see a message saying that IJulia successfully found your IPython installation and has created the necessary files.

If you have problems during the process of building IJulia, you can try rebuilding it using


In [ ]:
julia> Pkg.build("IJulia")