Downloading and installing software for this class

The basic software needed for this course is: git, python (and a number of additional packages), gfortran, openmpi, and lapack. Software installation is straightforward if you are on a Unix-like machine (e.g Linux or Mac OS X). For some flavors of Unix it is easy to download and install some of the required packages using apt-get (see Installing software with apt-get (Debian or Ubuntu Linux)), or your system’s package manager.

If you are using a Mac and want to install the necessary software, you also need to install Xcode developer tools, which includes necessary compilers and make, for example. See Installing software on Mac OS X for further details.

If you must use a Windows PC, then you should download and install [VirtualBox] for Windows and then run the VM to provide a Linux environment (see Installing software for Windows).

Some of this software may already be available on your machine. The which command in Unix will tell you if a command is found on your search path, e.g.:

$ which gfortran

tells me that when I type the gfortran command it runs the program located in the file listed. Often executables are stored in directories named bin, which is short for binary, since they are often binary machine code files.

If which doesn’t print anything, or says something like:

$ which xyz
/usr/bin/which: no xyz in (/usr/bin:/usr/local/bin)

then the command cannot be found on the search path. So either the software is not installed or it has been installed in a directory that isn’t searched by the shell program (see shells) when it tries to interpret your command. See unix_path for more information.

Installing software with apt-get (Debian or Ubuntu Linux)

On a recent Debian or Ubuntu Linux system, most of the software for this class can be installed through apt-get. To install, type the command:

$ sudo apt-get install PACKAGE

where the appropriate PACKAGE to install comes from the list below.

NOTE: You will only be able to do this on your own machine or a computer on which you have super user privileges to install software in the system files. (See sudo)

You can also install these packages using a graphical package manager such as Synaptic instead of apt-get.

Software Package
Python3 python3
IPython ipython3
NumPy python3-numpy
SciPy python3-scipy
Matplotlib python3-matplotlib
Python development files python3-dev
Pyside python3-pyside
Pyqt python3-pyqt5
Pip python3-pip
Git git
gfortran gfortran
OpenMPI libraries libopenmpi-dev
OpenMPI executables openmpi-bin
LAPack liblapack-dev

Many of these packages depend on other packages; answer “yes” when apt-get asks you if you want to download them. Some of them may already be installed on your system, in which case apt-get will tell you that they are already installed and do nothing. The Jupyter package (which includes qtconsole and jupyter notebook) should be installed with pip, while nose should be installed with easy_install. It is also recommened to use the atom text editor. The script below can be used to install atom and all of the aforementioned software:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install ipython3
sudo apt-get install python3-numpy
sudo apt-get install python3-scipy
sudo apt-get install python3-matplotlib
sudo apt-get install python3-dev
sudo apt-get install python3-setuptools
sudo apt-get install python3-pyqt5
sudo apt-get install python3-pyside
sudo apt-get install python3-pip
sudo pip3 install --upgrade pip
sudo pip3 install jupyter
sudo pip3 install qtconsole
sudo pip3 install networkx
sudo easy_install3 nose                  # unit testing framework
sudo apt-get install git
sudo apt-get install gfortran
sudo apt-get install libopenmpi-dev
sudo apt-get install openmpi-bin
sudo apt-get install liblapack-dev
sudo add-apt-repository ppa:webupd8team/atom
sudo apt update; sudo apt install atom

For other versions of Linux, apt-get will not be available, and you will need to use the appropriate native package manager (e.g. yum install for Red Hat Linux). If you are using a new installation of Linux (say, on a virtual machine), you may want to install a text editor like gedit: sudo apt-get install gedit.

Installing software on Mac OS X

Installing atom Go to which will direct you to download a zip file. Double click the file to extract the atom application.

Installing python

it is recommended that you install either the free Canopy or Anaconda distribution.

Anaconda: Installation instructions are available here.

Canopy: The free express version is available here

Either of these will give you all of the packages needed for this course, and it is recommended you install Python 3.5 (or higher).

Everything else

As noted above, you will need to install Xcode developer tools. Then, download the gfortran tarball, gfortran-7.1-bin.tar.gz (72 MB, El Capitan or Sierra). For more information, or to get files for earlier OS X versions, got to The rest of the installation process can be done from the terminal (go to Applications –> Utilities –> Terminal to open a terminal).

Installing gfortran

First, install XCode command-line tools:

$ xcode-select --install

Then, install/extract gfortran:

$ gunzip gfortran-7.1-bin.tar.gz
$ sudo tar -xvf gfortran-7.1-bin.tar -C /

Now, typing:

$ which gfortran

should output:


Installing MPI:

$ curl -o openmpi-3.0.0.tar.gz
$ tar zxf openmpi-3.0.0.tar.gz
$ cd openmpi-3.0.0
$ ./configure --prefix=/opt/openmpi 2>&1 | tee config.out
[...lots of output...]
$ make -j 4 2>&1 | tee make.out
[...lots of output...]
$ sudo make install 2>&1 | tee install.out
[...lots of output...]
$ export PATH=/opt/openmpi/bin:$PATH
$ ompi_info
[...see output from newly-installed Open MPI...]

Now, typing:

$ which mpif90

should output:


You should also open your .profile file in your home directory, and add the location of mpif90 to your path by adding the fllowing line:

export PATH=/opt/openmpi/bin:$PATH


Lapack is included with OS X

Installing software for Windows

The author of these notes does not use windows, so please be aware that you may have to figure some things out for yourself. There are two options. The first, using cygwin, is easier, but will be mostly unsupported by the class instructor. The second is more complicated, but will give you a working linux virtual machine on your computer which you can use for many things outside of this class.

Cygwin Cygwin is available here The gfortran binary can be downloaded here. Openmpi packages can be found here. To obtain lapack and scalapack libraries, see

Virtual Machine The basic steps are:

  1. Download and install virtualbox
  2. Download XUbuntu (linux) operating system (~900mB)
  3. Create a XUbuntu virtual machine within virtual box using the XUbuntu download
  4. Run the XUbuntu vm, open a terminal, and install gfortran, openmpi, etc… using apt-get as described above: Installing software with apt-get (Debian or Ubuntu Linux).

Instructions for steps 1-3 can be found `here <>`_. Note that these instructions direct you towards XUbuntu15 and you can download and install the latest version (XUbuntu 17.04, i386 recommended rather than XUbuntu 16.04 which was originally listed here) instead. Overall, you will need about 6 gB on your hard drive. Once you have completed steps 1-3, you should go to Settings –> System –> Processor for your VM and increase the number of CPUs to at least 2. Then proceed to step 4 to install the needed software within your VM.

Note: If you are having problems installing a 64bit version of Ubuntu, please see this page: Getting 64bit Ubuntu on your Virtual Machine.

Python If you choose the cygwin route, you should install the Enthought Canopy python distribution. The academic version is available here (registration required). There is also a lighter express version here. Either of these will give you all of the packages needed for this course. If you install a VM, you can still use Canopy, but you can also install python within the VM following the instructions above: Installing software with apt-get (Debian or Ubuntu Linux).

Further information on individual packages


We will use python 3.x in this course (where x is some integer). You can check your version of python using:

$ python3 --version
Python 3.5.2


$python --version
Python 2.7.9 --  64-bit

If you are using a mac, it is recommended that you install either the free Canopy or Anaconda distribution.

Anaconda: Installation instructions are available here.

Canopy: The free express version is available here

Either of these will give you all of the packages needed for this course. Canopy and Anaconda als works well on windows, but, if you have set up a VM, you can also install python within the VM following the instructions below: Installing software with apt-get (Debian or Ubuntu Linux).


GNU fortran compiler (see fortran).

You may already have this installed, try:

$ which gfortran


Open MPI

Message Passing Interface software for parallel computing (see mpi).


Some instructions for installing from source on a Mac can be found at <>`_. though it is recommended that you follow the simpler instructions above.


Linear Algebra Package, a standard library of highly optimized linear algebra subroutines. Lapack depends on the BLAS (Basic Linear Algebra Subroutines); it is distributed with a reference BLAS implementation, but more highly optimized BLAS are available for most systems.