To install NS-2 in FEDORA 10 i have followed the instructions from this url: http://www.edaboard.com/ftopic297674.html

Step 1:
Make sure your computer is connected to the internet and Please log in as a superuser so that you have permission to do as follow.
At the terminal please type the following to install the packages 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
—————————————

Step 2:
Download NS-allinone-2.33 package from sourceforge.net and do as follow at directory of your choice.
At home directory extract the ns file:
# tar -xzf ns-allinone-2.33.tar.gz
Proceed by entering to the ns directory:
# cd ns-allinone-2.33
# ./install

Step 3:
After Step 2, still at the terminal type:
# vi /root/.bashrc
To insert text please press the “i” key then add the following lines to the ./bashrc

—————————————
# LD_LIBRARY_PATH
OTCL_LIB=/home/username/ns-allinone-2.33/otcl-1.13
NS2_LIB=/home/username/ns-allinone-2.33/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB

# TCL_LIBRARY
TCL_LIB=/home/username/ns-allinone-2.33/tcl8.4.18/library
export TCL_LIBRARY=$TCL_LIB

# PATH
XGRAPH=/home/username/ns-allinone-2.33/bin:/home/username/ns-allinone-2.33/tcl8.4.18/unix:/home/username/ns-allinone-2.33/tk8.4.18/unix
NS=/home/username/ns-allinone-2.33/ns-2.33/
NAM=/home/username/ns-allinone-2.33/nam-1.13/
PATH=$PATH:$XGRAPH:$NS:$NAM
—————————————

Remark: Press the “Esc” key follow by the “:”(shift+;) key then type the letters “wq” to write and quite from the terminal.

Let the environment variable that you set take effect immediately by typing the following at the terminal:
# source ~/.bashrc
or
you can choose to restart your computer

Step 4:
The NS should be working by now by typing:
$ ns
the symbol “%” should appear, press ctrl+c to exit from it.

Step 5:
The following error occur when i type “nam” at the terminal:

—————————————

: no event type or button # or keysym
while executing
"bind Listbox {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[tk windowingsystem] eq "classic" [tk windowingsystem] eq "aqua"} {
bind Listbox {
%W yview scroll [expr {- (%D)}] units
}
bind Li..."
---------------------------------------

I found the solution at the following url:http://victorgau.blogspot.com/2008/12/ns2-233-nam.html

1. Download tk-8.4.18-tkBind.patch from http://bugs.gentoo.org/show_bug.cgi?id=225999
2. Put the patch file in the ns-allinone-2.33 directory and patch it:
patch -p0 < tk-8.4.18-tkBind.patch
3. after this step please type ./install again at the NS directory

After this when you type "nam" at the terminal you shall see the nam GUI.

Step 6
Validate the NS by typing:
# ./validate

Step 7
Start by looking at the example provided by NS in the ex folder:
# cd /home/username/ns-allinone-2.33/ns-2.33/tcl/ex
# ns wireless-flodding.tcl

Feel free to explore your newly install NS-2.

Advertisements