Wednesday 29 February 2012

How to install Ns 2.29


Installation of ns2.29 on Fedora 13:
STEP 1:

From terminal login as super user and do the following.(internet must also be connected in order to install the package dependencies.)

yum install autoconf
yum install automake
yum install gcc-c++
yum install libX11-devel
yum install xorg-x11-proto-devel
yum install libXt-devel
And for nam installation (optional):
yum install libXmu-devel

STEP 2:
From terminal go to the folder where the ns-allinone patch is placed and type the following to extract
$ tar -xzf ns-allinone-2.31.tar.gz
$ cd ns-allinone-2.29
$. /install
At the time of installation it may give some of the problem in building tclcl1.17 or otcl 1.11,tk-8.4.11, for that use the patchs given in the folder ns2installation.
(tk-8.4-lastevent.patch)
Step 3:
Place the patch in folder tk8.4.11 of nsallinone2.29.
Run the patch as “ $ patch -p0 < tk-8.4-lastevent.patch
Note: choose your compiler should be gcc4.1 and g++ 4.1.
Step 4:
Again try to install ns2 i,e
$ ./install
Step 5:
Now go to /etc folder and type

gedit ~/.bashrc

Add the following lines to the end of it.
# LD_LIBRARY_PATH
OTCL_LIB=/root/Desktop/ns-allinone-2.29/otcl-1.11
NS2_LIB=/root/Desktop/ns-allinone-2.29/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=/root/Desktop/ns-allinone-2.29/tcl8.4.11/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/root/Desktop/ns-allinone-2.29/bin:/root/Desktop/ns-allinone-2.29/tcl8.4.11/unix:/root/Desktop/ns-allinone-2.29/tk8.4.11/unix
NS=/root/Desktop/ns-allinone-2.29/ns-2.29/
NAM=/root/Desktop/ns-allinone-2.29/nam-1.11/
PATH=$PATH:$XGRAPH:$NS:$NAM

Let it take effect immediately

source ~/.bashrc
Note: the step described above is important; otherwise, you cannot run ns successfully.
Now, the installation has been completed. If you try:
$ ns

Then a "%" will appear on the screen. type "exit" to quit the mode and back to "$"
Lastly $  ./validate

No comments:

Post a Comment