Вы находитесь на странице: 1из 10

GE ET T-ST TA AR RT TE ED DW WI IT TH H MITSIMLA AB B

(devel-version.10.10)

Installation Instructions (tested in Ubuntu 10.04 - 32bit)

Installation instructions for MITSIMLab under a Ubuntu 9.10. Commands that need to be typed at the console are perpended by a dollar sign ($).

Part 1 Preparation of Ubuntu


1) Prior requirements:
MITSIMLab requires the graphics library GNOME. In the initial installation of Linux, choose GNOME among the options present for Graphics Library.

2) Install PVM:
Go to: System > Administration > Synaptic Package Manager Mark pvm and libpvm3 for installation, and apply the changes.

3) This installation guide is valid for gcc version 4.4.1. If you have a newer version, some errors may
occur. To check your gcc version type:
$ gcc -version

4) Installation of packages from online repositories: g++, autoconf, automake, make, openmotiff, libxt-dev,
x11proto-print-dev, libxpm-dev , libXext-dev, patch, xmkmf, libxmu-dev:

$ sudo apt-get install g++ autoconf automake make libmotif3 libmotif-dev libxtdev x11proto-print-dev libxpm-dev libXext-dev patch xmkmf libxmu-dev

5) Download the package libstdc++2.10-glibc2.2_2.95.4-24_i386.deb from one of the mirrors at:


http://packages.ubuntu.com/dapper/i386/libstdc++2.10-glibc2.2/download Install package by double clicking it

Part 2 MITSIMLab installation


1) Download
the file MITSIMLab.tar.gz from http://sourceforge.net/projects/mitsim/ to

/home/username/

$ tar zxvf MITSIMLab.tar.gz $ cd MITSIMLab/

2) Untar the downloadeed file MITSIMLab.tar.gz and go to the new created folder /MITSIMLab
You should see the following directories/files: /bin which has two directories /ad and /linux (which contains the executables) GUI_libs.tar the archive that contains the installation files pvmprofile .pvm_hosts (hidden file, to see it type $ ls la) /view contains an example for application of MITSIMLab in /data/brunnsviken Manual.pdf the user manual for MITSIMLab and Road Network Editor (RNE) MITSIMLab_OSLicense_092005.pdf and OtherCopyrights.pdf

3) Untar the GUI_Libs.tar.gz and go to the new created folder GUI_Libs


$ tar zxvf GUI_Libs.tar.gz $ cd GUI_Libs

4) For this step you need to run the installation script a root by typing sudo before the command.
At the password prompt type in the root password when asked: 2

$ sudo -s $ sudo -s ./Install

NOTE: If you ran into the "! You have to be root to run this script " error during the installation process, when running sudo -s ./Install you will have to edit the script ./Install, by typing:
$ sudo gedit ./Install

And replace the first line:


#!/bin/sh

by
#!/bin/bash

Part 3 Configuring the system for MITSIMLab

$ sudo gedit /etc/ld.so.conf

1) Edit the file /etc/ld.so.conf


Add the following line at the end of the file, save and exit the text editor:
/usr/local/lib

$ sudo /sbin/ldconfig $ exit

Type to load the saved file and exit the user root:

2) Set the XENVIRONMENT and PATH variables to direct to the directory in which the executables are
present (/bin/Linux). This can be done by editing the .bashrc file in the directory of the user

$ gedit .bashrc

(/home/username/) Add the lines at the end of the file:


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

Save the file and exit the text editor. To load the saved file, type:
$source .bashrc

3) PVM facilitates communication between the packages MITSIMLab and TMS. After installing pvm, the
pvm_hosts file in the /MITSIMLab directory needs to be copied to the home folder:
$cp ~/MITSIMLab/.pvm_hosts ~/

$gedit ~/.pvm_hosts

4) The copied file must be edited. This can be done using a text editor:
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:


<your computer name> ep=$SIMLAB_Linux wd=$SIMLAB_DAT

Congratulations!! You are now ready to run MITSIMLab!

Part 5 - Running MITSIMLab


1) Prepare the data files
This involves the creation of the various input files, such as master.mitsim, network.dat and demand.dat files. Note: Do not forget to check the defined paths of each input file of MITSIMLab. For the Bruinsviken example provided in the installation package, the master.mitsim file should be configured as: [Default Parameter Directory] [Input Directory] [Output Directory] = "~/MITSIMLab/view/data/Common" = "~/MITSIMLab/view/data/brunnsviken" = "~/MITSIMLab/view/data/brunnsviken/Output"

[Working Directory] 2) Change to the Input file directory 3) Execute MITSIM

= "~/MITSIMLab/view/data/brunnsviken/Output"

MITSIM can be used in two modes: with and without traffic control and gives the option of being run with or without graphics also.

$ xmitsim m master.mitsim

To execute MITSIM alone (i.e. without traffic control), enter the following command:
$ mitsim m master.mitsim

or, without graphics: Complete the following steps to execute MITSIMLab (i.e. with traffic control):

$ rm fr /tmp/pvm*

Remove the existing PVM files by typing the following:

$ pvm ~/.pvm_hosts

Execute PVM

$ conf

Verify that the host server has been added to the PVM repository by typing the following:

$ quit

Push PVM to the background:

$ xsmc m master.smc

Execute MITSIMLab by typing the following:


$ smc m master.smc

or, without graphics:

4) MITSIMLabs graphical interface pops up on the screen. If executing MITSIM in standalone mode,
click on the red rectangle at the bottom right hand corner of the screen to start the simulation.

5) The MITSIMLab window disappears automatically at the end of the simulation. Change to the Output
directory to view MITSIMLabs output files. 5

6) If you use the smc version of MITSIMLab, stop running PVM:


$ pvm

Go into PVM

$ halt

Stop running PVM

Compiling Instructions (tested in Ubuntu 8.04 - 32bit)

Compiling instructions for MITSIMLab under Ubuntu 8.04, with g++ version 4.2.4. Commands that need to be typed at the console are perpended by a dollar sign ($). Commands with sudo requires the access the password to root user.

Part 1 Library Installation


1) Install bison++
$ sudo apt-get install bison++

2) Install flex-old Notice: The default version of flex with Ubuntu 8.04 is flex (2.5.34-2.1) which will cause errors when compiling, make sure the flex version is flex 2.5.4. To check the version of flex:
$ flex --version

Install flex:
$ sudo apt-get install flex-old

3) Install libxtst-dev
$ sudo apt-get install libxtst-dev

4) Install pvm3 Download pvm3 package pvm3.4.6.tgz from http://www.netlib.org/pvm3/. Put the package under 6

/home/usrname folder.
$ tar zxvf pvm3.4.6.tgz $ gedit .bashrc

Add line
export PVM_ROOT=$HOME/pvm3

Save and exit gedit.


$ source .bashrc $ cd pvm3 $ make

Part 2 Compiling Settings


1) Download view_8.04.tar.gz on Sourceforge http://sourceforge.net/projects/mitsim/. 2) Locate it to a directory you like, here take /home/username as example.
$ tar zxvf view_8.04.tar.gz

3) Set environment parameter


$ cd $ gedit .bashrc

Add line
export OSTYPE=linux

Save and exit gedit.


$ source .bashrc

4) Set compile paths If the folder is not located under /home/username, the compile path should be revised. Go to the view_8.04 folder.

$ cd simlab $ gedit general.tmpl

Revise the paths to the paths you selected in the lines like:
BASE_DIR INSTALL_DIR =$(HOME)/view_8.04/simlab = /$(HOME)/view_8.04/bin/$(OSTYPE)_CL

OBJ_BASE_DIR= $(BASE_DIR) INSTALL_AD_DIR = /$(HOME)/view_8.04/lib/ad

You are ready to compile MITSIMLab! Part 3 Compiling MITSIMLab


1) Go to the folder that locate view_8.04
$ cd simlab $ make clean $ make

2) Youll get the binaries in /view_8.04/simlab/bin/linux_CL, and you are ready to use your own binary to run the simulation.

Appendix 1: Bug solution for errors may occur during compiling


1. /Tools/Reader.h:66: error: default argument for parameter of type std::_Ios_Iostate has type int Orignal at line 66: void clear(std::_Ios_Iostate i =0) { isp->clear(i); } Change to: void clear(std::_Ios_Iostate i) { isp->clear(i);}

2. complaining some friend class is not declared Solution: define the class outsid the definition branket Example: Origninal: Class A: 8

{ friend class B; friend class C; ..... } complaining class B and C are not declared.

Change to: Class B; Class C;

Class A: { friend class B; friend class C; ...... } 3. /GRN/RN_BusSchedule.h:87: error: extra qualification RN_BusSchedule:: on member tripRoute Original: RN_BusRoute* RN_BusSchedule::tripRoute(); Change to: RN_BusRoute* tripRoute();

4. EOF was not declared in this scope Solution: add #include <cstdio>

Appendix 2: Dependency problems when install g++ and libstdc++6


When installing the g++ packages via Synaptic Package Manager, it usually complains that dependency not satisfied with libstdc++6. Then when install libstdc++6, it circles the dependency problem with complaining dependency not satisfied with g++.

Solution:

Download compatible versions of g++ and libstdc++ packages from http://packages.ubuntu.com/ Than do the following:
$ sudo dpkg i /path/to/g++.deb $ sudo dpkg i /path/to/libstdc++.deb $ sudo apt-get install -f

10

Вам также может понравиться