Saturday, 7 March 2015

Real Time Installation of Omnet++ and Castalia on Linux (Ubuntu12.04)

Hello everyone,
 If you are looking for a complete installation reference for omnet++ and Castalia  installation, then you have landed up to absolutely correct place. The procedure is adumbrated below as follows:-

 
Step I: Install the prerequisites packages
Enable universe repository by executing command:
$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu (lsb_release -sc) universe"
Then, execute the following commands to install prerequisite packages:
$ 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
$ sudo apt-get update
$ 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
Step II: Download OMNeT++ source code
You can download omnetpp from here: 
After downloading, extract the package by executing:
$ tar zxvf omnetpp-4.2.2-src.tgz
$ sudo apt-get install bison byacc (or use synaptic package manager for installing these)
$ sudo apt-get install tcl8.4 tk8.4 tcl8.4-dev tk8.4-dev (Or use synaptic package manager for installing these)
Step III: Compile OMNeT++
First setup the environment variables:
$ cd omnetpp-4.2.2

$ . setenv
$ sudo apt-get install zlib1g-dev
$ sudo apt-get install libgcrypt11-dev


For path inclusion execute


$ gedit  ~/.bashrc

Add the following line at the end of the file, then save it:
export PATH=$PATH:$HOME/omnetpp-4.6/bin

export PATH=$PATH:$HOME/omnetpp-4.6/lib

export TCL_LIBRARY=/usr/share/tcltk/tcl8.4


You need to close and re-open the terminal for the changes to take effect


Then run configure:
$ ./configure
Finally, compile the simulator:
$ make
After it's done compiling, you should see the following:















Step IV: Testing the Installation
$ cd samples/dyna
$ ./dyna

After clicking through some options, you should see something like:




















Exit the demo, then start the OMNeT++ 4 IDE:
$ omnetpp


Step V: Install the INET Framework-Castalia
Download  wvsnmodel-v4.tgz from http://cpham.perso.univ-pau.fr/WSN-MODEL/wvsn.html
place it in omnetpp-4.2.2 directory

Automatic Installation Procedure
Open install.bash and copy the content in any editor (notepad, gedit, wordpad, etc). 
In line 21, add - make clean->save as install.bash
Then, execute the following commands:
$ chmod 777 install.bash
$ ./install.bash
[Note:- Don't press 'yes' for Castalia Installation]

Castalia-3.2 Installation
Download Castalia-3.2 from here http://castalia.npc.nicta.com.au/ .
Place it in home directory
 $ tar xvzf Castalia-3.2.tar.gz
$ cd Castalia-3.2
$ ./makemake
$ make

SDL-LIBRARY Installation
Download SDL from here: http://www.libsdl.org/download-2.0.php 
Place it in home directory and execute these commands:
$ sudo apt-get install build-essential xorg-dev libudev-dev libts-dev libgl1-mesa-dev libglu1-mesa-dev libasound2-dev libpulse-dev libopenal-dev libogg-dev libvorbis-dev libaudiofile-dev libpng12-dev libfreetype6-dev libusb-dev libdbus-1-dev zlib1g-dev libdirectfb-dev 

/*** Important Step *****/
$ tar zxvf SDL2-2.0.3.tar.gz
$ cd SDL2-2.0.3/
$  ./configure
$  Make
$ sudo make install


Running the Sample Model:
$ ./install.bash
$ cd vidmodel/wvsn-model-omnetpp-v4/
$ cp coverage-60.ned omnetpp.ini out/gcc-debug/
$ cd out/gcc-debug/
$ ./wvsn-model-omnetpp-v4


The appearance of these two windows will confirm correct installation of Castalia.
All the Best! 


For any doubt please leave your comment below.

Note: Try to use Ubuntu12.04 for this installation of  Omnet++ and Castalia


This work is equally contributed by Author1
For further query please contact Author1  & Author2.








25 comments:

  1. hye. can you help me. i cannot extract the castalia file. it says. "an error occur while rxtracting files. error setting owner: operation not permitted". what can i do? thanks in advance.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. sir/madam, now i stuck at running the sample mode. when i write "./install.bash ". the terminal said "no such file or directory". i don't know why. which one of file in SDL i need to download. thank you.

    ReplyDelete
  4. Hello anish_tnty,
    you need to copy the content of install.bash from website http://cpham.perso.univ-pau.fr/WSN-MODEL/distrib/install.bash and save it as install.bash in your working directory before running ./install.bash. And, regarding SDL installation, download any zip file and install.

    ReplyDelete
    Replies
    1. Hi, I have the same problem. I copied the content of install.bash and add the line 21... bur when I do:
      "chmod 777 install.bash" it doesn't work and I got this message :"chmod: cannot access ‘install.bash’: No such file or directory".
      please help me.

      Delete
  5. Hi
    Please can any one help to simulate a WiMAX network on OMNET++??

    pleaase

    ReplyDelete
  6. Hello everybody,

    I am new to castalia 3.2 and Omnet++ 4.2, I don't know, how can I open files on the Omnet IDE?
    How to start work with ? I have Installed all but I cant open or import them on the IDE.
    I would be thanking you if anyone can help me.

    Thanks

    ReplyDelete
  7. Hello Basma,
    To do that first launch omnetpp IDE by typing - "omnetpp" in the Terminal.
    Later, use import option given in omnetpp IDE to import files and directories of your work.

    ReplyDelete
  8. Hello Rageeni
    first thanks for answering me !!! Please if you have an experience with Castalia could you please say to me how to create a project with it? how can i open castalia and work with it correctly ??

    ReplyDelete
  9. hello Rageeni,
    thank you for your help. now i can run my castalia simulation. i just want to ask you about Guranteed Time slot(GTS) in castalia. does castalia 3.2 have simulation model on GTS? i look for it, but i couldn't find it. i need your help. sorry for troubling you. thanks in advance.

    ReplyDelete
  10. Error during startup: No user interface (Cmdenv, Tkenv, etc.) found.
    OMNeT++ Discrete Event Simulation (C) 1992-2010 Andras Varga, OpenSim Ltd.
    Version: 4.1, build: 100611-4b63c38, edition: Academic Public License -- NOT FOR COMMERCIAL USE
    See the license for distribution terms and warranty disclaimer

    End.

    ReplyDelete
  11. hello rageeni,
    can i install castalia in windows?

    ReplyDelete
    Replies
    1. Hi Anisha,

      Yes, You can install castalia in windows. However, you will have to setup the environment for the same; Which includes installing various software including MinG.

      Delete
  12. When i'am trying to install SDL by executing the given command it shows

    E: Unable to locate package libts-dev

    Now what to do and also in which directory do we have to execute the Running the Sample Mode commands.

    End

    ReplyDelete
    Replies
    1. Hi Vaibhav,

      Kindly see the added information to the blog, this will certainly solve your problem.

      Delete
  13. Also after exwcuting the last command

    ./wvsn-model-omnetpp-v4

    error No such file or directory

    ReplyDelete
  14. Well first you need to download SDL package and unzip it in same directory in which you have all files, may be home directory.

    ReplyDelete
  15. hi i have a problem in castalia's intallation. is it possible for you to solve this ?
    http://8pic.ir/images/ztd5djdf556vg042pcoo.jpg

    ReplyDelete
  16. When i am running the last step in the running the sample i am getting an error which says no such file or directory? What could be the possible cause for that?

    ReplyDelete
    Replies
    1. Hi Pranav,

      The added info. will solve your error.

      Delete
  17. Hello Rageeni,

    I followed installation procedure as given above( On Ubuntu 14.04 to install Omnetpp4.6 and castalia 3.2 )

    I could install successfully omnetpp 4.6, I have executed dyna, I can open omnet from command prompt with omnetpp.

    Also I have followed same steps and installed castalia 3.2.

    But When I tried to execute castalia from shell prompt I get following error

    shailendra@shailendra-Inspiron-5558:~/Castalia-3.2$ ./CastaliaBin
    OMNeT++ Discrete Event Simulation (C) 1992-2014 Andras Varga, OpenSim Ltd.
    Version: 4.6, build: 141202-f785492, edition: Academic Public License -- NOT FOR COMMERCIAL USE
    See the license for distribution terms and warranty disclaimer

    Error during startup: Cannot open ini file `omnetpp.ini'.

    End.


    Also in omnet IDE i was trying to import castalia. But I am getting error like this


    Exception occurred executing command line.
    Cannot run program "/home/shailendra/omnet/castaliatest/castaliatest" (in directory "/home/shailendra/omnet/castaliatest/Simulations/radioTest"): error=2, No such file or directory


    Requesting you to see what can be a problem...

    ReplyDelete
  18. unable to locate libts-dev .... what should i Do???

    ReplyDelete
  19. hello
    i use the simulator Castalia to simulate leach protocol performance results in wireless sensor networks , I implement the package leach under castalia, we must now try leach:

    Default configuration:

    1- without activating the central node mobility (base station Sink)
    2-activating mobility ...
    please help me i'm blocked
    thank you

    ReplyDelete