| Installing Opus & UrbanSim > Installing on Linux | |
This following instructions are for installing Opus & UrbanSim on Linux. These installation directions have been tested with Ubuntu Linux and Intel processors.
Opus and UrbanSim are implemented in Python, making heavy use of numerical Python packages and other software. For Linux we recommend using Python version 2.5.1. The official Python website includes documentation, downloads, and much else. Depending on your distribution, you may also be able to download and install Python using a package manager such as Synaptic.
In addition, some additional Python libraries are required, recommended, or optional for use with Opus. You must have the required libraries to run Opus. The recommended libraries are not necessary to run Opus, but certain functionality will be unavailable without them. The optional libraries are Python modules that are needed only in special cases.
Caution! There will be different binaries of these libraries for Python 2.4 and Python 2.5 - make sure you download the correct version for the Python you are using.
Download the required, recommended and optional Python packages and install them. For most packages, you should be able to use Easy Install as described on the Python packages page, except that in many cases running the commands will require superuser privileges. Note that installing some packages may require you to update your versions of gcc or other compilers. Alternatively, you can do the following (this may still require compiler updates):
tar xvfz filename
sudo python setup.py installThis will compile the package and install it in the site-packages directory. (The “sudo” part performs the command as the superuser. You’ll probably need superuser permissions to install into site-packages.)
If you do not have superuser permissions, you need to install python to a place where you do have write permission and then use that version of python to invoke the setup.py command. For instance, if you installed python 2.5 to /homes/me/bin/python2.5 issuing the following command will install the package into the site-packages directory of that version of python:/homes/me/bin/python2.5 setup.py install
MySQL is an efficient, open-source SQL database. You don't need it to run the basic Eugene tutorial, although for serious use with your own dataset you will want a database of some sort. (We are steadily reducing the dependencies on the particular database used, however, with the goal of allowing Opus and UrbanSim to be used with any SQL database.) If you use MySQL you can either have a local copy or run on a shared server.
If you don't install MySQL right away, you can return and install it later if you discover you need it.>
In Ubuntu, you can download MySQL using the Synaptic package manager. Be sure to also install packages mysql-devel and mysql-shared. If MySQL is not installed, or to install a different version of MySQL, follow the instructions on http://dev.mysql.com/downloads/.
Opus works with MySQL 4.1 and 5.0.
MySQL runs as a server. The server can be started from the command line (read the manual pages for mysqld) or, more conveniently, through a system manager, such as YaST’s System Services (Runlevel).
In addition to MySQL itself, you might get the MySQL Query Browser (for prowling around in UrbanSim databases using a graphical interface), and the MySQL Administrator. These are both available as binaries, and may be available through a package manager in your version of Linux.
Follow the directions on the Downloading the Opus/UrbanSim sample data and source code page.
UrbanSim requires the following environment variables. The first tells the Python interpreter where to find the Opus/UrbanSim code. The others tell the system where to find your cached data and configurations.
The most convenient way is to set the environment variables in your .bashrc/.cshrc file. The syntax depends on the type of shell you use. For example you would insert the following lines into .bashrc:
export OPUS_HOME=~/opus
Follow these instructions to test your installation.