Ubuntu NS installation

Installation of NS under Ubuntu

1. Install Vmware player, it will allow you to run linux in your windows system. Download Ubuntu image from any mirrors, and install it in your Vmware.

2. download the NS allinone package, you can find it in sorceforge. follow the step

tar -xzvf  ns-allinone-2.31.tar.gz

cd ns-allinone-2.33

3. before install, you need to make sure that your system has gcc installed, if you are not sure about that, insert your ubuntu installation disk, and try

sudo apt-get install build-essential autoconf automake libxmu-dev

if you haven’t install gcc, it will install it for you, if you have already installed, you will see the message.

4. install

./install

5. after you successfully installed, you will see the message for you to set the environment variable, if not, there might be something wrong. Now, set the environment variable, .bashrc is a hidden file, but you can open it by gedit or vi, following this code

gedit ~/.bashrc 
write the following code at the end of the .bashrc file, make sure to change /your/path to your own 
folder and the version number to be your version number (including ns version and tcl, tk, nam)
# LD_LIBRARY_PATH
OTCL_LIB=/your/path/ns-allinone-2.31/otcl-1.13
NS2_LIB=/your/path/ns-allinone-2.31/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=/your/path/ns-allinone-2.31/tcl8.4.14/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB
 
# PATH
XGRAPH=/your/path/ns-allinone-2.31/bin:/your/path/ns-allinone-2.31/tcl8.4.14/unix:/your/path/ns-allinone-2.31/tk8.4.14/unix
NS=/your/path/ns-allinone-2.31/ns-2.31/
NAM=/your/path/ns-allinone-2.31/nam-1.13/
PATH=$PATH:$XGRAPH:$NS:$NAM
6. you have finished installing, close the command window, restart a new command window, try 
ns
if % appears, you installed successfully, type exit to exit, if not, there might be something wrong, check the steps carefully.
7. you can now validate all the files (it will take your quite a long time, not necessary)
  cd ns-2.31
  ./validate
 
 
 
 
Good Luck!
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: