Monday, August 22, 2011

Installing MITSIMLab on Ubuntu 8.10


Captain’s Log, Stardate 65097.3

The mission was to find out how earthlings react to external visual stimuli while operating their motorized ground transportation devices. Doing a simulation would help, I thought. So I hunted around for an open source (read: free) traffic simulation softwares, since my spending limit was as low as a Ferengi pirate's moral standards.

MITSIMLab looked like a good candidate. It is an open source microscopic traffic simulator developed by the brains at MIT sometime in the late 90's or early this century. You can download it here. It took me almost two weeks to get it to work on my computer running Ubuntu 8.10. I'm running 8.10 because the instruction that comes with the downloaded files was written for this particular release. Keep in mind that I can count single handedly how many times I've used Linux before this mission, so it'll probably take you much less time.

I've summarized what I did and hopefully this can help those of you out there pulling your hair out trying to get it to run. The way I did it may not be the most efficient. If you think you can make the process better, please don't hesitate to make suggestions.

Part 1: Prepare your computer

If you are running Ubuntu 8.10, you'll probably want to make a few changes to the sources.list file so you can download the needed packages. This can be done using the following command (it’ll ask you for your password):

$ sudo gedit /etc/apt/sources.list

Then replace us.archive.ubuntu.com, and security.ubuntu.com with old-releases.ubuntu.com. I like to use gedit because I'm still struggling with editors w/o a GUI such as Vim or Emacs. After replacing the text, save the file and run

$ sudo apt-get update

to update your sources for apt-get. When the update is finished, follow the list below to proceed with the installation.



1.   Check your gcc version to see if it’s compatible with 4.3. Mine was 4.3.2.

$ gcc –version



 
2.   Check if you have PVM installed already

$ dpkg --get-selections | grep pvm

If your terminal returns nothing, install PVM

$ sudo apt-get install pvm

3.   Install the following packages with apt-get:

g++
autoconf
automake
make
libmotif3
libmotif-dev
libxt-dev
x11proto-print-dev
libxpm-dev
libXext-dev
patch
xmkmf
libxmu-dev

with command

$ sudo apt-get install ‘package name here’

4.   Download the package
libstdc++2.10-glibc2.2_2.95.4-24_i385.deb
from
if this mirror doesn’t work, go to here and pick one that works. Chances are most of them doesn’t work anymore, but you might be able to find one if you are lucky.
After download is finished, browse to the downloaded file and double click to install it using Package Installer.

Part 2: Install MITSIMLab

1.   Download the MITSIMLab.tar.gz file found here to a directory of your choice. I just tossed it right under my home folder (~/) for easy access. In your terminal, go to the directory where you saved the tar file and run the following command to unzip it:

$ tar zxvf MITSIMLab.tar.gz

Then enter the newly created folder by doing

$ cd MITSIMLab

2.   Unzip the GUI_Libs.tar.gz file inside of your MITSIMLab directory

$ tar.zxvf GUI_Libs.tar.gz

Then enter the newly created folder by doing

$ cd GUI_Libs

3.   Open the Install script inside of the GUI_Libs folder in an editor

$ gedit Install

and replace the #!/bin/sh with #!/bin/bash, save and exit.


4.   Run the install script as root (your computer may ask you for password)

$ sudo -s ./Install
Your computer should take a minute or two here, and you should see a “All done” after the process is finished. If it stops shortly after you hit “enter” and you can see warning messages, repeat Part 1 and Part 2.

Congratulations! You have successfully installed MITSIMLab on your Ubuntu 8.10. However before we can run MITSIMLab, you’ll need to configure your system to work with it.

Part 3: Configuring your system for MITSIMLab

1.   Edit the file /etc/ld.so.conf
$ sudo gedit /etc/ld.so.conf
and add the line
/usr/local/lib
at the end of the file, save and exit.
Then type
$ sudo ldconfig

2.   Set the XENVIRONMEN with

$ gedit ~/.bashrc

and add the following lines at the end of the file

export XENVIRONMENT=~/MITSIMLab/bin/ad/xmitsim.ad
export PATH=$PATH:~/MITSIMLab/bin/Linux

save and exit.

Then type

$ source .bashrc

to reload the newly changed .bashrc file.

Note: I unzipped the MITSIMLab folder into my home directory. If you unzipped yours elsewhere, then you need to change the line you add to point to the location on your computer.

3.   In your terminal, go to your /MITSIMLab directory and edit the .pmv_hosts file

$ gedit .pvm_hosts

The file will look something like: 
# Configuration file used for starting PVM for SIMLAB programs 
localhost.localdomain ep=$SIMLAB_Linux wd=$SIMLAB_DAT 

You need to add a line which says: 
<computer name> ep=$SIMLAB_Linux wd=$SIMLAB_DAT 
(where computer name is for example: bass.mit.edu) 

My added line was

VMUbuntuOnHappy ep=$SIMLAB_Linux wd=$SIMLAB_DAT

because my computer name is VMUbuntuOnHappy and I didn’t have a domain name.

Part 4: Running MITSIMLab
To run the examples included in the downloaded file, navigate to /MITSIMLab folder and run PVM
$ pvm .pvm_hosts
Type conf to verify your that HOST is indeed your host name, and quit to exit the PVM interface but leave PVM running. (If you want to stop PVM, type halt)
Finally, to run the brunnsviken example of MITSIMLab in GUI, go into /MITSIMLab/view/data/brunnsviken and type
$ xmitsim master.mitsim