Archive for September, 2011

Simple way to install ns2 in ubuntu 10.10


Following is the 10 easy steps of installing ns2 on Ubuntu-10.10

Step1 : Download ns-allinone-2.34 package .

Step2 : Place the ns-allinone-2.34.tar.gz file in under your home folder and extract it using following command

tar xvfz ./ns-allinone-2.34.tar.gz

in my case location is – /home/ruzdi/program/ns-allinone-2.34

step3 : Using command line go to this folder /home/ruzdi/program/ns-allinone-2.34

step4 : use the following command

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

step5 : change the following line in ns-allinone-2.34/otcl-1.13/Makefile.in file

change CC= @CC@ to CC= gcc-4.3 

step6 : then install using

./install

Step7: Once the installation is successful without any errors, we need to add the path information to the file ~/.bashrc

  $ gedit   ~/.bashrc 

Step8: Add the following lines to the file ~/.bashrc

# LD_LIBRARY_PATH
OTCL_LIB=/home/ruzdi/program/ns-allinone-2.34/otcl-1.13
NS2_LIB=/home/ruzdi/program/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/ruzdi/program/ns-allinone-2.34/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH

XGRAPH=/home/ruzdi/program/ns-allinone-2.34/bin:/home/ruzdi/program/ns-allinone-2.34/tcl8.4.18/unix:/home/ruzdi/program/ns-allinone-2.34/tk8.4.18/unix

# Note: the above two lines starting from XGRAPH should come in the same line

NS=/home/ruzdi/program/ns-allinone-2.34/ns-2.34/
NAM=/home/ruzdi/program/ns-allinone-2.34/nam-1.14/
PATH=$PATH:$XGRAPH:$NS:$NAM

Here replace /home/ruzdi/program/ with the path to your ns2 folder path.

Step9: For the changes to take effect immediately, do the following:

$ source      ~/.bashrc 

10. nw use the ‘ns’ command to check that it is installed correctly or not if your ns2 is instaled correctly then it show % sign . You can exit from this using ‘exxit’ command

Thats all cheers …

This post is written with the help of two blog post —

link1

link2

Advertisements