yt 2.5 documentation

Installing yt

Automated Installation

The recommended method for installing yt is to install an isolated environment, using the installation script. The front yt homepage will always contain a link to the most up to date version, but you should be able to obtain it from a command prompt by executing:

$ wget http://hg.yt-project.org/yt/raw/stable/doc/install_script.sh
$ bash install_script.sh

at a command prompt. This script will download the stable version of the yt, along with all of its affiliated dependencies. It will tell you at the end various variables you need to set in order to ensure that yt works correctly. If you run into any problems with the installation script, that is considered a bug we will fix, and we encourage you to write to yt-users.

Manual Installation

If you choose to install yt yourself, you will have to ensure that the correct dependencies have been met. A few are optional, and one is necessary if you wish to install the latest development version of yt, but here is a list of the various necessary items to build yt.

Installation of the various libraries is a bit beyond the scope of this document; if you run into any problems, your best course of action is to consult with the documentation for the individual projects.

Required Libraries

This is a list of libraries installed by the installation script. The version numbers are those used by the installation script – yt may work with lower versions or higher versions, but these are known to work.

  • Python-2.7.3, but not (yet) 3.0 or higher
  • NumPy-1.6.1 (at least 1.4.1)
  • HDF5-1.8.9 or higher (at least 1.8.7)
  • h5py-2.1.0 (2.0 fixes a major bug)
  • Matplotlib-1.2.0 or higher
  • Mercurial-2.5.1 or higher (anything higher than 1.5 works)
  • Cython-0.17.1 or higher (at least 0.15.1)

Optional Libraries

These libraries are all optional, but they are highly recommended.

  • Forthon-0.8.10 or higher (for halo finding and correlation functions)
  • libpng-1.5.12 or higher (for raw image outputting)
  • FreeType-2.4.4 or higher (for text annotation on raw images)
  • IPython-0.13.1 (0.10 will also work)
  • PyX-0.11.1
  • zeromq-2.2.0 (needed for IPython notebook)
  • pyzmq-2.2.11 (needed for IPython notebook)
  • tornado-2.2 (needed for IPython notebook)
  • sympy-0.7.2
  • nose-1.2.1

If you are attempting to install manually, and you are not installing into a fully-isolated location, you should probably use your system’s package management system as much as possible.

Once you have successfully installed the dependencies, you should clone the primary yt repository.

You can clone the repository with this mercurial command:

$ hg clone http://hg.yt-project.org/yt ./yt-hg
$ cd yt-hg
$ hg up -C stable

This will create a directory called yt-hg that contains the entire version control history of yt. If you would rather use the branch yt, which is the current development version, issue the command hg up -C yt .

To compile yt, you will have to specify the location to the HDF5 libraries, and optionally the libpng and freetype libraries. To do so, put the “prefix” for the installation location into the files hdf5.cfg and (optionally) png.cfg and freetype.cfg. For instance, if you installed into /opt/hdf5/ you would put /opt/hdf5/ into hdf5.cfg. Once you have specified the location to these libraries, you can execute the command:

$ python2.7 setup.py install

from the yt-hg directory. Alternately, you can replace install with develop if you anticipate making any modifications to the code; develop simply means that the source will be read from that directory, whereas install will copy it into the main Python package directory.

That should install yt the library as well as the commands iyt and yt. Good luck!

Package Management System Installation

While the installation script provides a complete stack of utilities, integration into your existing operating system can often be desirable.

Ubuntu PPAs

Mike Kuhlen has kindly provided PPAs for Ubuntu. If you’re running Ubuntu, you can install these easily:

$ sudo add-apt-repository ppa:kuhlen
$ sudo apt-get update
$ sudo apt-get install yt

If you’d like a development branch of yt, you can change yt for yt-devel to get the most recently packaged development branch.

MacPorts

Thomas Robitaille has kindly provided a MacPorts installation of yt, as part of his MacPorts for Python Astronomers. To activate, simply type:

Thanks very much, Thomas!

Community Installations

Recently, yt has been added as a module on several supercomputers. We hope to increase this list through partnership with supercomputer centers. You should be able to load an appropriate yt module on these systems:

  • NICS Kraken
  • NICS Nautilus

Updating yt

Automated Update

The recommended method for updating yt is to run the update tool at a command prompt:

$ yt update

This script will identify which repository you’re using (stable, development, etc.), connect to the yt-project.org server, download any recent changesets for your version and then recompile any new code that needs it (e.g. cython, rebuild). This same behavior is achieved manually by running:

$ cd $YT_DEST/src/yt-hg
$ hg pull
$ python setup.py develop

Note that this automated update will fail if you have made modifications to the yt code base that you have not yet committed. If this occurs, identify your modifications using ‘hg status’, and then commit them using ‘hg commit’, in order to bring the repository back to a state where you can automatically update the code as above. On the other hand, if you want to wipe out your uncommitted changes and just update to the latest version, you can type:

$ cd $YT_DEST/src/yt-hg
$ hg pull
$ hg up -C      # N.B. This will wipe your uncommitted changes!
$ python setup.py develop

If you run into any problems with the update utility, it should be considered a bug, and we would love to hear about it so we can fix it. Please inform us through the bugsubmit utility or through the yt-users mailing list.

Updating yt’s Dependencies

If you used the install script to originally install yt, updating the various libraries and modules yt depends on can be done by running:

$ yt update --all

For custom installs, you will need to update the dependencies by hand.

Switching Between Branches in yt

If you are running the stable version of the code, and you want to switch to using the development version of the code (or vice versa), you can merely follow a few steps (without reinstalling all of the source again):

$ cd $YT_DEST/src/yt-hg
$ hg pull
<commit all changes or they will be lost>
$ hg up -C <branch>     # N.B. This will wipe your uncommitted changes!
$ python setup.py develop

If you want to switch to using the development version of the code, use: “yt” as <branch>, whereas if you want to switch to using the stable version of the code, use: “stable” as <branch>.