Installing ns-2.35 on Ubuntu 13.04

NAM ns-2.35Before we again, the time required for the installation depends on your system and internet connection. Internet is required to complete the following procedure.

Here are the steps for installing ns-2.35 on Ubuntu 13.04 and before versions.

Open Terminal and …

[Step 1] Install some Essential Libraries and Softwares:

sudo apt-get install tcl8.5-dev tk8.5-dev

sudo apt-get install gcc-4.4 g++-4.4

sudo apt-get install build-essential autoconf automake

sudo apt-get install perl xgraph libxt-dev libx11-dev libxmu-dev

[Step 2] Download ns-2.35

Download ns-2.35 from http://sourceforge.net/projects/nsnam/files/latest/download

Unpack ns2 to your Desktop directory tar -zxvf ns-allinone-2.35.tar.gz -C /home/khawajaali/Desktop

(or simply unzip the package on your desktop)

[Step 3] Modify the OTcl makefile

Open /home/khawajaali/Desktop/ns-allinone-2.35/otcl-1.14/Makefile.in

Change CC = @CC@ to CC=gcc-4.4

Save the file

[Step 4] Install ns2

cd /home/khawajaali/Desktop/ns-allinone-2.35

./install

(this will take a while)

[Step 5] Modify ~/.bashrc

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

gedit ~/.bashrc

Now Add these lines in the end of the file

#LD_LIBRARY_PATH
OTCL_LIB=/home/khawajaali/Desktop/ns-allinone-2.35/otcl-1.14
NS2_LIB=/home/khawajaali/Desktop/ns-allinone-2.35/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/khawajaali/Desktop/ns-allinone-2.35/tcl8.5.10/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB
# PATH
XGRAPH=/home/khawajaali/Desktop/ns-allinone-2.35/bin:/home/khawajaali/Desktop/ns-allinone-2.35/tcl8.5.10/unix:/home/khawajaali/Desktop/ns-allinone-2.35/tk8.5.10/unix
# Note: the above two lines starting from XGRAPH should come in the same line
NS=/home/khawajaali/Desktop/ns-allinone-2.35/ns-2.35/
NAM=/home/khawajaali/Desktop/ns-allinone-2.34/nam-1.15/
PATH=$PATH:$XGRAPH:$NS:$NAM

Save the modification and close the file

source ~/.bashrc

And that is all 😀 *cheers*

Now type ns to see % and type nam to show the nam startup window, This shows the installation has been successful.

Important : you should replace /home/khawajaali/Desktop with the path to your Desktop folder.

Still unable to complete the installation ? Post your issues in the comment section below

Advertisements

7 thoughts on “Installing ns-2.35 on Ubuntu 13.04

Your Thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s