The easiest way to install NS2 network simulator on Fedora 22 is to download an all-in-one package that contains all the tools needed for the simulator. The steps are as follows (tested on Fedora 22 x64):
1- Download the file ns-allinone-2.35.tar.gz from NS website at http://www.isi.edu/nsnam/ns/ns-build.html#allinone.
2- You need to move ns-allinone-2.35.tar.gz to your home directory and then unzip it as follows:
cd /home/mehdi
tar zxvf ns-allione-2.35.tar.gz
cd ns-allinone-2.35
3- Before we start building the package contents, we need to make sure the following tools are installed on Fedora:
libX11-devel
tcl
tk
gcc-c++
libXt-devel
Install the tools with this command:
yum install libX11-devel tcl tk gcc-c++ libXt-devel
4- Now, start the installation by typing ./install
It takes about 5 minutes to build and install components required by the network simulator.
5- Set the paths in the file (/home/mehdi/.bash_profile) as shown below (replace "mehdi" with your user name):
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
NS_HOME=/full/path/to/ns-allinone-2.34
PATH=$NS_HOME/bin:$NS_HOME/tcl8.4.18/unix:$NS_HOME/tk8.4.18/unix:$PATH
export PATH
# LD_LIBRARY_PATH
OTCL_LIB=/home/mehdi/ns-allinone-2.35/otcl-1.14
NS2_LIB=/home/mehdi/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/mehdi/ns-allinone-2.35/tcl8.5.10/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB
# PATH
XGRAPH=/home/mehdi/ns-allinone-2.35/bin:/home/mehdi/ns-allinone-2.35/tcl8.5.10/unix:/home/mehdi/ns-allinone-2.35/tk8.5.10/unix
#the above two lines beginning from xgraph and ending with unix should come on the same line
NS=/home/mehdi/ns-allinone-2.35/ns-2.35/
NAM=/home/mehdi/ns-allinone-2.35/nam-1.15/
PATH=$PATH:$XGRAPH:$NS:$NAM
6- execute the .bash_profile using the command
source /home/mehdi/.bash_profile
7- check ns or nam by typing either ns or nam in the terminal
ns
% indicates ns interpreter is running
nam
Note:
a) In case you receive an error regarding the file ~/ns-2.35/linkstate/ls.h, change erase{ in ls.h to this->erase.
b) You must switch to root user in order to successfully install the package., and then you'll see the following screen showing that the installation has been successful.
Reference:
- Installing Network Simulator 2 (NS-2.35) in Fedora 19, http://www.nsnam.com/2013/09/installing-network-simulator-2-ns-2-35-in-fedora-19.html
- ۰ نظر
- ۰۴ آبان ۹۴ ، ۰۶:۱۱