Table Of Contents

Previous topic

MDAnalysis Tutorial

Next topic

Preparations

This Page

Installing MDAnalysis

Before you can start the tutorial, you need a working installation of MDAnalysis (with its test suite, MDAnalysisTests) on your Linux or Mac OS X machine. The following contains hints and links to further documentation to facilitate installation of the package. In an ideal setting (development tools (gcc tool chain), python development headers, full scientific Python stack with numpy, scipy, matplotlib already installed, working netcdf/HDF5 library), installation will be as simple as

pip install --user MDAnalysis MDAnalysisTests

In a less ideal setting, one typically has to install additional packages through the distribution’s package manager as described in the links under Local installation. Alternatively, for this tutorial one can also set up a Linux Virtual machine that installs itself with everything needed and the most recent release of MDAnalysis.

Installation methods

Local installation

The latest release of MDAnalysis (and the full test suite) can be installed from the python package index with pip or easy_install:

pip install --user MDAnalysis MDAnalysisTests

or

easy_install --user MDAnalysis MDAnalysisTests

(Installation of the test suite is required for this tutorial because we will use some of the data files that are part of the tests.)

If there are problems then please have a closer look at the installation notes and the installation recipes; in particular, installing the netcdf library can become more involved.

If you need help with installation issues, please do not hesitate to ask on the user discussion group.

For this tutorial you can also alternatively use a complete installation inside a Virtual machine.

Virtual machine

You will first need to clone the tutorial git repository with git:

git clone https://github.com/orbeckst/MDAnalysisTutorial.git
cd MDAnalysisTutorial

The directory vm contains configuration files for vagrant virtual machines (VM) (using VirtualBox). The file vm/README.rst describes setup in more detail but provided that vagrant and VirtualBox are installed, the following should provide you with a working VM:

cd vm/Ubuntu/14.04
vagrant up
vagrant ssh

When you are done, just exit the ssh session (exit or Control-D) and halt the VM:

vagrant halt

You can access your real home directory ($HOME) in the virtual machine at the path /myhome. Anything that you do in this directory will be reflected in your real home directory, including deletion of files!

Testing the installation

MDAnalysis comes with over 700 test cases that check its functionality. These test cases can be run with the command

python -c 'from MDAnalysis.tests import test; test(label="full", verbose=3, extra_argv=["--exe"])'

This can take a few minutes. Ideally, you should only get passing tests (“ok” or just a single dot ”.” when using verbose=1) or “KnownFailures”.

Note

The test suite consumes a considerable amount of memory (> 4GB) and thus it might fail or become very slow on machines with insufficient memory such as a Virtual machine. (This is a known problem with the test suite and will be addressed in the future.)