Archive for the ‘thesis’ Category

OMNeT++ and Oversim on Ubuntu Maverick

February 9, 2011 10 comments

OMNeT++ is a C++ simulation library and framework, primarily for building network simulators and oversim is an open-source overlay and peer-to-peer network simulation framework for OMNeT++ . I will be using it for simulations related to my MSc thesis , so I tried to install it and get everything working a while back. There were some small problems with the installation flow which , however easily solvable in the end, caused a couple of lost hours. So I wanted to note it down for future reference and in case anyone else finds it useful .

The goal is to install OMNeT++, the patched INET framework needed by oversim and oversim itself. So let’s start with


create a dir to hold all the programs .i.e ~/simulations

Grab the tar.gz from the website , and unpack it to ~/simulations. The documentation is pretty straight forward regarding dependencies and other details. Install the required packets with :

sudo apt-get install build-essential gcc g++ bison flex perl \
tcl-dev tk-dev blt libxml2-dev zlib1g-dev openjdk-6-jre \
doxygen graphviz openmpi-bin libopenmpi-dev libpcap-dev \
 tk8.4-dev libgmp3-dev blt-dev

Now before compiling omnet++ you will need akaroa . Register and download it, unpacking it to ~/simulations also. The problem with gcc 4.4.4 that was mentioned in omnet++ install guide seems to be fixed with gcc 4.4.5 but still if you try to compile you will get errors like the following :

/bin/sh: pushd: not found

This has to do with /bin/sh being linked to /bin/dash instead of /bin/bash in ubuntu’s latest releases. To fix it once and for all do the following:

# rm -f /bin/sh
# ln -s /bin/bash /bin/sh

Now cd to the akaroa dir , and compile it with ./configure && make && make install as usual.

NOTICE that if you are on x86_64 you need to add -fPIC to the compile options for akaroa, otherwise omnet++ compilation will fail later. To do that , go to the file src/Makefile.main and add -fPIC to the options on lines 110 and 114 so that it becomes like this

%.o:    %.C
 @echo Compiling $<
 @$(CPLUS) $(CPLUS_FLAGS) -c $(INCLUDE) -fPIC $< -o $@

%.o:    %.c
 @echo Compiling $<
 @$(CC) $(CC_FLAGS) -c $(INCLUDE) -fPIC $< -o $@

Next go back to the omnet++ unpackaged dir. You need to add omnet’s bin dir to your path, the way to do it permanently is to add the following line to your ~/.bashrc file (assuming you followed the file structure I suggested , if not edit accordingly)

export PATH=$PATH:$HOME/simulations/omnetpp-4.1/bin

Now compile omnet++ with ./configure && make && make install . To verify that it was successful , go to samples , run the demo and choose any of the available ones.

Patched version of INET framework

Grab the archive from here and unpack it in the ~/simulations directory.

run make in the directory


Grab the archive from here and unpack it in the ~/simulations directory.

run make in the directory

That’s it, you should be ready now !

Categories: thesis Tags: , , , , , ,