Installing ns-2.35 in Ubuntu 12.04, 12.10, 13.04, 13.10 and 14.04

Tutorial to install ns-2.35 on Ubuntu 12.04/10 and 13.04/10

please follow the tutorial step by step

Step 1:


Download NS-2.35 (http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.35/ns-allinone-2.35.tar.gz/download)

Step 2:

place this file ns-allinone-2.35.tar.gz in any folder you like (recommended is /home/loginname) 

Step 3:

Run this command in terminal
( first go to the directory where you have put you ns-allinone-2.35.tar.gz file. )


tar zxvf ns-allinone-2.35.tar.gz (extracts the .tar.gz files content to a folder in the same directory name ns-allinone-2.35)

Step 4:

Run these command in terminal (Requires Internet)

sudo apt-get update ( means you need to keep your pc sources updated )
sudo apt-get install build-essential autoconf automake libxmu-dev (These are essential library files and size is around 17 MB)

Step 5:

Run this command in terminal 
 
cd ns-allinone-2.35 (get inside the ns directory)

Step 6: 

./install 

note:- the only error I got was something related to linkstate/ls.h.

So to resolve this issue do the following

execute command

sudo gedit  ns-allinone-2.35/ns-2.35/linkstate/ls.h 

on line number 137 change 

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

to

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

Save and Close it.

Now again run ./install

after successful compilation you get ld_library_path an path ... read carefully !!!

Step 7:

This step is about how to save paths properly.
 
You will receive a three set of paths after successful
completion of install command.

these are path, ld library path and tcl library.

So to save them properly do the following:-

run cd .. ( this brings you back in home directory)

run gedit .bashrc (at last of the file add these paths in format given below)

export PATH=$PATH:path1:path2:path3 (Here paths should be separated by colon)


similarly for

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:path1:path2 (paths separated by colon)

and also for

export TCL_LIBRARY=$TCL_LIBRARY:path

Save and close it.
run source .bashrc (this loads the new .bashrc file)   

Type nam 

if you see nam window then great, installed successfully.

or else

post the error (note most of the mistakes happen in the last step i.e. saving paths).
37 comments

Popular posts from this blog

Installing ns-2.35 on Mountain Lion, Mavericks, Yosemite and El Capitan (OS X 10.8/10.9/10.10/10.11)

Tutorial to implement protoname in ns2.35