jump to navigation

Installing ns-allinone-2.31 in ubuntu 12.04 November 7, 2013

Posted by aghus in Linux, Ngoprek, NS-2.

installing ns allinone 2.31 in buntu 12.04 …… it takes around 40 minutes.
STEP 1 :

Download ns-allinnone-2.31 from nsnam website
Extract the tar file in ~
tar -xvf ns-allinone-2.31.tar.gz
Open terminal and type cd ~/ns-allinone-2.31
Install required libraries for ns2 using terminal
sudo apt-get install build-essential autoconf automake libxmu-dev
Then, sudo ./install

For errors,

ld: libotcl.so: hidden symbol `__stack_chk_fail_local’ isn’t defined
ld: final link failed: Bad value
make: *** [libotcl.so] Error 1
otcl-1.13 make failed! Exiting …
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

In otcl-1.13/configure, line number 5516
SHLIB_LD=”ld -shared” change it with SHLIB_LD=”gcc -shared”

——————-> after you fix the problem, then install again: sudo ./install


After you finish the installation, then it will appear information like as follows (/home/aghus is my home directory, you must change with yours) :

Please put /home/aghus/ns-allinone-2.31/bin:/home/aghus/ns-allinone-2.31/tcl8.4.14/unix:/home/aghus/ns-allinone-2.31/tk8.4.14/unix
into your PATH environment; so that you’ll be able to run itm/tclsh/wish/xgraph.


(1) You MUST put /home/aghus/ns-allinone-2.31/otcl-1.13, /home/aghus/ns-allinone-2.31/lib,
into your LD_LIBRARY_PATH environment variable.
If it complains about X libraries, add path to your X libraries
If you are using csh, you can set it like:
If you are using sh, you can set it like:

(2) You MUST put /home/aghus/ns-allinone-2.31/tcl8.4.14/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.31; ./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.

———————-> example
$ gedit ~/.bashrc

# add in then of the file bashrc, these commands
export PATH=$PATH:/home/aghus/ns-allinone-2.31/bin:/home/aghus/ns-allinone-2.31/tcl8.4.14/unix:/home/aghus/ns-allinone-2.31/tk8.4.14/unix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/aghus/ns-allinone-2.31/otcl-1.13:/home/aghus/ns-allinone-2.31/lib
export TCL_LIBRARY=$TCL_LIBRARY:/home/aghus/ns-allinone-2.31/tcl8.4.14/library

Let it takes effect immediately,
$ source ~/.bashrc


cd ns-2.31

then you can test ns by type
~/ns-allinone-2.31/ns-2.31$ ns

it means the ns2 has been installed

then check nam program
~/ns-allinone-2.31/ns-2.31$ nam

if errors like shown below …

: 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…”

Solution … :

download the patch from https://sites.google.com/site/ejazahmedprofile/faq-ns-2-linux/tk-8.4-lastevent.patch?attredirects=0&d=1

put the patch in ~/ns-allinone-2.31/tk8.4.14
cd ~/ns-allinone-2.31/tk8.4.14
patch -p0 < tk-8.4-lastevent.patch

it will show :
~/ns-allinone-2.31/tk8.4.14$ patch -p0 < tk-8.4-lastevent.patch
patching file generic/tk.h
Hunk #1 succeeded at 637 (offset 2 lines).

sudo ./install

afterthat, check nam
~/ns-allinone-2.31/ns-2.31$ nam

it works.

Moreover, we can check the version of ns2 by typing commad as follows.
% ns-version




No comments yet — be the first.

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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: