Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Installing NS-2.

35 on Linux Fedora 20

Installing NS-2.35 on Linux Fedora 20

Download NS2
1. Download NS-2.35 from this link

http://sourceforge.net/projects/nsnam/

2. Place downloaded file in Documents directory and type

tar -xzvf ns-allinone-2.35.tar.gz

Installing dependencies
Install Linux necessary dependencies

su

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

Installing NS2
Install NS-2 by using the following commands

cd ns-allinone-2.35

./install

Mobile Computing – NET455 Walaa Alayed


Installing NS-2.35 on Linux Fedora 20

You may face the following error:

In file included from linkstate/ls.cc:67:0:


linkstate/ls.h: In instantiation of â€‫ک‬void LsMap::eraseAll() [with Key = int; T =
LsIdSeq]’:
linkstate/ls.cc:396:28: required from here
linkstate/ls.h:137:20: error: â€‫ک‬erase’ was not declared in this scope, and no
declarations were found by argument-dependent lookup at the point of instantiation [-
fpermissive]
linkstate/ls.h:137:20: note: declarations in dependent base â€‫ک‬std::map, std::allocator >
>’ are not found by unqualified lookup
linkstate/ls.h:137:20: note: use â€‫ک‬this->erase’ instead
make: *** [linkstate/ls.o] Error 1
Ns make failed!

Solution:

a. Go to ns-allinone-2.35/ns-2.35/linkstate/

b. Now edit ls.h

In line number 137, in place of

void eraseAll() { erase(baseMap::begin(), baseMap::end()); }

make it

void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }

c. Save the file and again run

./install

Setting NS2 PATH


After the installation is finished this message is shown

Ns-allinone package has been installed successfully.


Here are the installation places:
tcl8.5.10: /home/net455/Documents/ns-allinone-2.35/{bin,include,lib}
tk8.5.10: /home/net455/Documents/ns-allinone-2.35/{bin,include,lib}
otcl: /home/net455/Documents/ns-allinone-2.35/otcl-1.14
tclcl: /home/net455/Documents/ns-allinone-2.35/tclcl-1.20
ns: /home/net455/Documents/ns-allinone-2.35/ns-2.35/ns
nam: /home/net455/Documents/ns-allinone-2.35/nam-1.15/nam
xgraph: /home/net455/Documents/ns-allinone-2.35/xgraph-12.2
gt-itm: /home/net455/Documents/ns-allinone-2.35/itm, edriver, sgb2alt, sgb2ns,
sgb2comns, sgb2hierns

----------------------------------------------------------------------------------

Mobile Computing – NET455 Walaa Alayed


Installing NS-2.35 on Linux Fedora 20

Please put /home/net455/Documents/ns-allinone-2.35/bin:/home/net455/Documents/ns-


allinone-2.35/tcl8.5.10/unix:/home/net455/Documents/ns-allinone-2.35/tk8.5.10/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.

IMPORTANT NOTICES:

(1) You MUST put /home/net455/Documents/ns-allinone-2.35/otcl-1.14,


/home/net455/Documents/ns-allinone-2.35/lib,
into your LD_LIBRARY_PATH environment variable.
If it complains about X libraries, add path to your X libraries
into LD_LIBRARY_PATH.
If you are using csh, you can set it like:
setenv LD_LIBRARY_PATH <paths>
If you are using sh, you can set it like:
export LD_LIBRARY_PATH=<paths>

(2) You MUST put /home/net455/Documents/ns-allinone-2.35/tcl8.5.10/library into your


TCL_LIBRARY environmental
variable. Otherwise ns/nam will complain during startup.

After these steps, you can now run the ns validation suite with
cd ns-2.35; ./validate

For trouble shooting, please first read ns problems page


http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive
for related posts.

To apply the instruction above

a. Run

gedit ~/.bashrc

b. Based on the message above add the following lines to the


file then save and close the file

# LD_LIBRARY_PATH
OTCL_LIB=/home/net455/Documents/ns-allinone-2.35/otcl-1.14
NS2_LIB=/home/net455/Documents/ns-allinone-2.35/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
#USR_BIN=/usr/bin:/usr/local/bin
export
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL
_LIB

# TCL_LIBRARY
TCL_LIB=/home/net455/Documents/ns-allinone-2.35/tcl8.5.10/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
PATH_ALL=/home/net455/Documents/ns-allinone-
2.35/bin:/home/net455/Documents/ns-allinone-

Mobile Computing – NET455 Walaa Alayed


Installing NS-2.35 on Linux Fedora 20

2.35/tcl8.5.10/unix:/home/net455/Documents/ns-allinone-
2.35/tk8.5.10/unix
XGRAPH=/home/net455/Documents/ns-allinone-2.35/xgraph-12.2
NS=/home/net455/Documents/ns-allinone-2.35/ns-2.35/ns
NAM=/home/net455/Documents/ns-allinone-2.35/nam-1.15/nam
#USR_BIN=/usr/bin:/usr/local/bin
USR_BIN=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
export PATH=$PATH_ALL:$XGRAPH:$NS:$NAM:$USR_BIN

c. Run the following command

source ~/.bashrc

Install gnuplot
Use the following command to install gnuplot

yum install gnuplot

References that helped


 http://milanjainblog.wordpress.com/2012/12/29/installing-
ns2-simulator-in-fedora-17/

Mobile Computing – NET455 Walaa Alayed

You might also like