Saturday 27 April 2013

Method of Installing ns-2.34 in Fedora 12




First of all Install the dependency packages.  This will create an environment to get ready to install NS-2.  All the packages will be downloaded from the Internet, therefore make sure you have an Internet connection.

It is advisable to do all the steps as a Super User, or abbreviated as su in Linux.  To change status as a super user, type:
su -
you will then required to enter the root password which you entered during the Fedora Core 8 (FC8) installation.
Then, you can start 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
yum install libXmu-devel


After installation of dependancy packages is complete download and install NS-2.  In this example, I’m showing how to install NS-2 version 2.30.  I am using the all in one package, ns-allinone-2.30.
From the terminal, you can use the wget command to download the NS-2 package.  Then, decompress/ untar it before installing using the ./install command.  Please make sure that you are the root before installing the package.
$ wget http://www.isi.edu/nsnam/dist/ns-allinone-2.30.tar.gz
$ tar -xzf ns-allinone-2.30.tar.gz
$ cd ns-allinone-2.30.tar.gz
You can also download the ns-allinone-2.xx package of ns-2 using mozilla and untar it using GUI.
after that you will need to goto ns-allinone-2.xx directory and run the following command.


          $. /install


If you are familiar with the Windows environment, you will notice that there is section where you can configure the environment variables to set a Class Path.  In Linux, we also have the section, but it is not in a graphical user interface (GUI).  It is in a text file format named .bashrc.  You have to add some lines in the text file so that it can detect the NS-2 libraries to compile your script that you will write to configure your simulation scenarios and settings.
Go to the /etc folder.  Then type:
gedit .bashrc
Then, add some lines at THE END of the text file.  Remember replace “/usr/local/” by your installation path like “/home/najwan”.  These lines are:

# LD_LIBRARY_PATH
OTCL_LIB=/usr/local/ns-allinone-2.xx/otcl-1.xx
NS2_LIB=/usr/local/ns-allinone-2.xx/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=/usr/local/ns-allinone-2.xx/tcl8.x.xx/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/usr/local/ns-allinone-2.xx/bin:/usr/local/ns-allinone-2.xx/tcl8.x.xx/unix:/usr/local/ns-allinone-2.xx/tk8.x.xx/unix
NS=/usr/local/ns-allinone-2.xx/ns-2.xx/
NAM=/usr/local/ns-allinone-2.xx/nam-1.xx/
PATH=$PATH:$XGRAPH:$NS:$NAM
 You can use these steps to install the later version of NS, such as ns-allinone-2.31 and ns-allinone-2.32. BUT make sure the version number is correct!  This includes the nam version, tcl version, tk version and the otcl version. replace the "x" with the correct version number as in your downloaded ns-allinone-2.xx.

No comments:

Post a Comment