Install NS2 (ns-allinone-2.35) on Ubuntu 11.04 for beginners
#########################
- Part I: Introduction
#########################
This installation guide is on Linux Ubuntu 11.04 (download from here), and uses ns-allinone-2.35 source file for NS2. I assume that you have the skill to install Ubuntu, so I skip this process, and focus on the installation of NS2 (step-by-step with commands).
#########################
- Part II: Install
#########################
[Step 1]
Before install NS2, you have to install some essential softwares:
sudo apt-get install tcl8.5-dev tk8.5-dev
sudo apt-get install build-essential autoconf automake
sudo apt-get install perl xgraph libxt-dev libx11-dev libxmu-dev
[Step 2]
Download NS2 source file from from here.
Then you will get a file named “ns-allinone-2.35.tar.gz“
[Step 3]
Unpack ns-allinone-2.35.tar.gz to your home directory. (/home/stan is my home directory, you SHOULD change it to your own!)
tar -zxvf ns-allinone-2.35.tar.gz -C /home/stan
[Step 4]
4.1) Modify the makefile (NOTICE: I use “vi” for an editor, you can use “gedit” instead)
vi /home/stan/ns-allinone-2.35/otcl-1.14/Makefile.in
4.2) Change CC = @CC@ to CC = @CC@ -V 4.5
(For changing this because the gcc complier in Ubuntu 11.04 is version 4.5, however NS2 only supports gcc-4.3 below. NOTICE the V is capital.)
[Step 5]
Install NS2:
cd /home/stan/ns-allinone-2.35
sudo ./install
[Step 6]
6.1) Modify .bahrc
vi /home/stan/.bashrc
6.2) Go to the last line and add the scripts below:
export PATH=$PATH:/home/stan/ns-allinone-2.35/bin:/home/stan/ns-allinone-2.35/tcl8.5.10/unix:/home/stan/ns-allinone-2.35/tk8.5.10/unix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/stan/ns-allinone-2.35/otcl-1.14:/home/stan/ns-allinone-2.35/lib
export TCL_LIBRARY=$TCL_LIBRARY:/home/stan/ns-allinone-2.35/tcl8.5.10/library
6.3) Enable the path setting:
cd /home/stan source .bashrc
#####################
# Verify
# ###################
which ns
If it shows /home/stan/ns-allinone-2.35/bin/ns, it works!










THE membership of Facebook is growing rapidly; according to 



Google Reader
haniza 2:57 pm on 18/01/2012 Permalink |
it works .. thanks a lot.
haniza 2:03 pm on 19/01/2012 Permalink |
hi stan.. i have problem with xgraph in step 1… it can not install. could you advise me? thanks
Stan 8:28 am on 23/01/2012 Permalink |
Hi Haniza, would you show me the error message of xgraph installation?
Henrique 12:13 am on 15/03/2012 Permalink
ubuntu@ubuntu:~$ sudo apt-get install xgraph
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package xgraph
This problem
Henrique 12:13 am on 15/03/2012 Permalink |
ubuntu@ubuntu:~$ sudo apt-get install xgraph
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package xgraph
This one
Henrique 12:18 am on 18/03/2012 Permalink |
In my case, i installed xgraph separately.
Stan 8:55 am on 19/03/2012 Permalink |
sorry for the late reply. Has your problem resolved now?
Henrique 4:34 am on 07/05/2012 Permalink
Yes, thanks…
ns2-rachida 4:58 pm on 05/05/2012 Permalink |
hi
I want to draw curves with NS2.34 under CentOS 6.2 Please there’s someone there can give me the script to realize this task I can not use the xgraph
Stan 6:58 pm on 06/05/2012 Permalink |
Hey, sorry I haven’t used xgraph to draw. I’m using “Gnuplot”. Try this first and see what supports do you need.