OMNeT++ and Oversim on Ubuntu Maverick
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
OMNeT++
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
Oversim
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 !
Just spotted a tiny typo: “ln -s /bin/bas /bin/sh”
Shouldn’t that be “ln -s /bin/bash /bin/sh” instead?
You are right , thanks for spotting it 🙂 I ll fix that
Great Stuff! Very useful!
I am trying Omnet++4.2b2 on Fedora 15. This post has helped a lot. However, ./configure says PATH is good.
but when I run make … that gives same error. Saying the bin path was not found.
I have checked .has_profile … it lists the path.
Can’t solve this issue
Restart your pc
You ‘ll get it inshahallah
It is not required to set /bin/sh to point to /bin/bash. It is generally considered awful to tinker with the inside of the OS like that, and Ubuntu has good reasons to set /bin/sh this way (boot speed as they say, but who knows. See https://wiki.ubuntu.com/DashAsBinSh.
Instead for building Akaroa it suffices to use:
$ make SHELL=/bin/bash
my 2 cents,
Eric
Another complement, if Akaroa is installed in a non-standard location e.g. /opt/akaroa (using the –prefix argument to configure), you have to configure Omnet in this way:
export AKAROA_CFLAGS=”-I/opt/akaroa/include”
export AKAROA_LIBS=”-L/opt/akaroa/lib -lakaroa -lfl”
./configure
Thanks for the comments Eric. I will update the post to include the suggestions for those who ( for any reason ) want to stick with dash.
thank you!!
Nice Post, very useful
I have already installed omnet 4.6 in home directory also placed inet in the workspace now what shoud I do to make Oversim work, where should I place it and how to run it afterwards