Installing Ns2.34 with Mannasim in Linux Mint 14

Post Version: 1.1

Version of GCC I use: 4.7.2

This is the version of GCC that comes default with Linux Mint 14.

gcc_VersionIf you wish to install ns2.34 without Mannasim skip steps 4 and 9.

1. Download ns-allinone-2.34 from this site:
http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.34/ns-allinone-2.34.tar.gz/download
2. Extract the downloaded file into your home folder(say, /home/micman)

Throughout this post, I shall be mentioning my home folder /home/micman. When you follow these procedures, replace my username micman with your username.
3. Place the file ns2.34-mannasim-gcc4.3.patch into the following folder:

 /home/micman/ns-allinone-2.34 

4. In Terminal, type the following commands:

cd /home/micman/ns-allinone-2.34
path -p1 < ns2.34-mannasim-gcc4.3.patch

5. If the patch gets applied without any error, proceed to next step open the following file

 /home/micman/ns-allinone-2.34/otcl-1.13/configure 

Replace the following lines:

Linux*)
SHLIB_CFLAGS="-fpic"
SHLIB_LD="ld -shared"
SHLIB_SUFFIX=".so"
DL_LIBS="-ldl"
SHLD_FLAGS=""

with the following:

Linux*)
SHLIB_CFLAGS="-fpic"
SHLIB_LD="gcc -shared"
SHLIB_SUFFIX=".so"
DL_LIBS="-ldl"
SHLD_FLAGS=""

6. Next, open the following file:

/home/micman/ns-allinone-2.34/ns-2.34/tools/ranvar.cc

In line 219, make the following changes:
Find this line:

return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);

and replace it with:

 return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);

7. Next, open the following file:

/home/micman/ns-allinone-2.34/ns-2.34/mac/mac-802_11Ext.h

In line 65, make the following changes:

Include this header file

#include "cstddef" 

8. Open the following file:

 /home/micman/ns-allinone-2.34/ns-2.34/mobile/nakagami.cc

Find the following code:

if (int_m == m) {
resultPower = ErlangRandomVariable::ErlangRandomVariable(Pr/m, int_m).value();
} else {
resultPower = GammaRandomVariable::GammaRandomVariable(m, Pr/m).value();
}
return resultPower;
}

Replace it with the code below:

if (int_m == m) {
resultPower = ErlangRandomVariable(Pr/m, int_m).value();
} else {
resultPower = GammaRandomVariable(m, Pr/m).value();
}
return resultPower;
}
}

9. In the following file, some code needs to be commented:

/home/micman/ns-allinone-2.34/ns-2.34/mannasim/onDemandData.cc


Comment the following lines:

OnDemandData :: OnDemandData()
{
/// REAL request type is default.
OnDemandData::OnDemandData(REAL);
}

10. Finally, in the following file:

/home/micman/ns-allinone-2.34/ns-2.34/linkstate/ls.h

Make the following changes:
In line 137, change the following line

void eraseAll() { erase(baseMap::begin(), baseMap::end()); }

into

void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }

11. When all the above steps have been completed successfully, run the following commands in Terminal before we begin installing ns2:

sudo apt-get install build-essential autoconf automake libxmu-dev

Once the above updates are successful, we shall proceed with installing ns2.

12. Navigate into the ns-allinone-2.34 folder:

cd /home/micman/ns-allinone-2.34

13. Just run the following command:

./install

14. Meanwhile, while the installation is happening, create the following file in /home/micman, if it doesn’t exist(else use the existing file):

.bashrc

15. Copy the following contents into .bashrc file created now:

# LD_LIBRARY_PATH
OTCL_LIB=/home/micman/ns-allinone-2.34/otcl-1.13
NS2_LIB=/home/micman/ns-allinone-2.34/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY
TCL_LIB=/home/micman/ns-allinone-2.34/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/home/micman/ns-allinone-2.34/bin:/home/micman/ns-allinone-2.34/tcl8.4.18/unix:/home/micman/ns-allinone-2.34/tk8.4.18/unix
NS=/home/micman/ns-allinone-2.34/ns-2.34/
NAM=/home/micman/ns-allinone-2.34/nam-1.14/
PATH=$PATH:$XGRAPH:$NS:$NAM

Here, micman is my username, replace it with your system username.

16. Meanwhile, in the Terminal, if the installation completes without any error, then close the terminal, and reopen it and type the following command:

ns
if % sign appears then the installation has been successful.

Additional Links:

Download Linux Mint: http://www.linuxmint.com/download.php

Download mannasim patch for ns2.34: https://www.box.com/shared/th6qi9b5v0

Download PowerIso: http://www.poweriso.com/download.htm

This article is sponsored by: http://hikmainfotech.com

hikma

Was this post helpful? Then thank me by clicking <this link>

Kdenlive: The video editor of my choice

I just grew interested in uploading my videos to Facebook and Youtube. So I set searching for video editors that I wanted to rip a particular portion of my video and convert it into an uploadable form. Believe me, I spent a day to finally settle down with a good editor. I started out with the Windows platform(Win7). First, I chose the traditional Windows Movie Maker. It didnt work out. My .avi  video had some encoding error so Movie Maker did not recognise it. Then I tried Free Video Dub, which had a very simple interface, but a lot of patience was needed to edit videos. It crashed often in my Windows 7. I don’t know whether it was a compatibility error. Turning on the compatibility option(right click on exe–>properties–>compatibility tab) did not work either. Googling around I found this Pinnacle Studio. It seems to be a famous editor out there, but then it was large in size, took some time to load and crashed often. So it was time to say goodbye to Windows and switch to Ubuntu:) But the pastures werent much greener there initially. I chose the editor that was the choice of many: Pitivi. It is a neat app for Linux, but I found it difficult to edit the video strip on the timeline. Phew! I was almost about to quit, when I heard about Lives and Kdenlive from the Ubuntu community forums. I installed them straight from the command line without any hassle. Lives interface was not user friendly, so I will quit talking about that. Finally, I settled down with Kdenlive. It is a very user friendly app for Ubuntu. It looked similar to Windows Movie Maker, but was more easy especially the timeline editing. I was able to finish my task in 30minutes. I rendered my project as  a .avi video. The size of the resulting video turned out to be 814+ MB, a size that would take long to get uploaded in Facebook, considering my 512kbps Internet. So I decided to convert it into a good quality flv video. First, I tried WinFF, based on FFMPEG. The resulting flv video was 14+ MB in size but had no audio. So I took recourse to Windows. Koyote Free Flv converter did the job neat and at last I successfully uploaded <this> video. so next time you sit down on a video editing project, let Kdenlive be your first choice 🙂

Additional:

You may also be interested in this video on LaTex 

Documentation support in Vim

Vim is a cool editor for Linux. I will now show you how to create a html documentation of your source code using vim.

The following tip has been suggested in  ILUGC mailing list.

1. Open the source code file using vim. I am using a tcl script file named sample.tcl

$ vim sample.tcl

2. In command mode type the following

:TOhtml

A new buffer will be opened with the html source

Just save and quit

:wq

3. You will find a new html file with the same name of the source code file in the directory where you the latter (in this case it is sample.html)

This is the documented code.

Have a look at it!

To add salt to the delicacy try out the following procedure before you try out the above tip…

Before performing the above conversion, running the following commands in command mode would produce an html file with a black background and lines numbered.

:sy on

:se nu

:se background=dark

Here is how it looks!!

 

 

 

Google Video Chat now in Linux!

Many a time i get defeated on “word-wars” defending Linux, when my friends ask me if Google video chat is available in Linux.
Google video chat is one “must have” feature that Linux users have wished for a long time. The wait is over!. Google has announced video support for Linux. for now, Ubuntu and other Debian-based distros could enjoy the support instantly. Fedora and other RPM-based ditros need to wait for some time(but not too long ;)).

<Here>  is a quick guide on how to get started on video chatting in Linux.

Enjoy 🙂

—–

References:

1.  Digitizor

The ABC’s of UNIX

source: http://www.mit.edu/people/yandros/humor/unix-alphabet

A is for Awk, which runs like a snail, and
B is for Biff, which reads all your mail.

C is for CC, as hackers recall, while
D is for DD, the command that does all.

E is for Emacs, which rebinds your keys, and
F is for Fsck, which rebuilds your trees.

G is for Grep, a clever detective, while
H is for Halt, which may seem defective.

I is for Indent, which rarely amuses, and
J is for Join, which nobody uses.

K is for Kill, which makes you the boss, while
L is for Lex, which is missing from DOS.

M is for More, from which Less was begot, and
N is for Nice, which it really is not.

O is for Od, which prints out things nice, while
P is for Passwd, which reads in strings twice.

Q is for Quota, a Berkeley-type fable, and
R is for Ranlib, for sorting ar [sic] table.

S is for Spell, which attempts to belittle, while
T is for True, which does very little.

U is for Uniq, which is used after Sort, and
V is for Vi, which is hard to abort.

W is for Whoami, which tells you your name, while
X is, well, X, of dubious fame.

Y is for Yes, which makes an impression, and
Z is for Zcat, which handles compression.