Feeds:
Posts
Comments

Archive for February, 2011

What is luck?Getting the right train at the right time. (C@GZKhan)

 

Read Full Post »

(1) Download ns2.34

http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.34/ns-allinone-2.34.tar.gz/downloador from any where else.

(2) Unzip the ns-allinone-2.34.tar.gz to any place where you want to install   your ns. In my case I want to unzip it in  /home/gz/ (note that my zipped folder of ns2 was in /home/gz)

$ cd /home/gz

$ tar -xzvf ns-allinone-2.34.tar.gz

(3) $cd ns-allinone-2.34

(4) $sudo apt-get install build-essential autoconf automake libxmu-dev

(5) $./install

Errors:

It will take some time. After this step you may encounter some errors like the following snapshot

gcc-4.3: command not found
make: *** [libotcl.so] Error 1
otcl-1.13 make failed! Exiting ...

If you get the errors as above, follow the steps from 5.1 to 5.6, otherwise go to step (6)

5.1  $gedit otcl-1.13/Makefile.in

5.2  Edit the file: replace CC=      @CC@ by CC=       gcc-4.3

5.3 $sudo apt-get install g++-4.3

5.4 $cd ns-allinone-2.34

5.5 $CC=gcc-4.3 CXX=g++-4.3 ./install

5.6 You are done if you get the following screen


(6) $ gedit ~/.bashrc

It will open the file shown below. Edit the lines that are highlighted according to your path of      ns2. I installed my ns2 in /home/gz/ns-allinone-2.34

# LD_LIBRARY_PATHOTCL_LIB=/home/gz/ns-allinone-2.34/otcl-1.13NS2_LIB=/home/gz/ns-allinone-2.34/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/gz/ns-allinone-2.34/tcl8.4.18/library

USR_LIB=/usr/lib

export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH

XGRAPH=/home/gz/ns-allinone-2.34/bin:/home/gz/Downloads/ns-allinone-2.34/

tcl8.4.18/unix:/home/gz/ns-allinone-2.34/tk8.4.18/unix

NS=/home/gz/ns-allinone-2.34/ns-2.34/

NAM=/home/gz/ns-allinone-2.34/nam-1.14/

PATH=$PATH:$XGRAPH:$NS:$NAM

(7) $ source ~/.bashrc

(8) $cd ns2.34

(9) $./validate

It will take long time to finish(longer than the install)

If you get this screen shot, you are successful.

(10) Create a symlink, so that ns can be called from everywhere

$ sudo ln -s /home/gz/ns-allinone-2.34/ns-2.34/ns /usr/bin/ns

(11) $reboot

to restart the system.

(12) To check whether ns is installed successfully or not, test it by entering   $ns

If you are prompted with %, it means your installation is successful otherwise check your environment variables, specifically compare the versions of otcl, nam etc in ./bashrc with those in your ns-allinone-2.34.

Press exit to go back from %.

Download this post in PDF

Read Full Post »