To keep up the pace with new versions of Ubuntu and potentially new installation problems with ns-2, here is a recipe for installing ns-2.34 on Ubuntu 10.10:
Download and extract ns-2.34 to a folder in your home directory. Get ns-2.34 allinone here.
Install the development files for X Windows plus the g++ compiler:
sudo apt-get install xorg-dev g++ xgraph
Fix the error in the linking of otcl by editing line 6304 of otcl-1.13/configure so that it reads
SHLIB_LD="gcc -shared"
instead of
SHLIB_LD="ld -shared"
And run ./install
Good luck!
Friday, March 11, 2011 at 8:15
hi
i m trying to install ns2.34 on ubuntu10.10.
sudo apt-get install build-essential autoconf automake libxmu-dev gcc-4.3
downloaded ns2.34
extract
cd /home/abcd/ns-allinone-2.34
dited the make.in file of otcl
CC= @CC@
and change it to:
CC= gcc-4.3
but when i put install command
it give following error
make:warning:file ‘home/abcd/ns-allinone2.34/tcl8.4.18/unix/makefile.in’ has modification time 2e+08s in the future
plz help me
Friday, March 11, 2011 at 10:31
Hi Bhawna,
I’m not sure how you managed to get this error. You can change the modification time of makefile.in using the command ‘touch’ as follows:
touch -m -t 201103111030 makefile.in
where the number after the -t is a timestamp in the form CCYYMMDDHHMM.
By the way, I didn’t get your change of the makefile.in file of otcl to work for me, so I recommend my fix in the post above.
Cheers!
Saturday, March 12, 2011 at 6:32
hi
Thank you for ur suggestion ,i tried it
but again it gives the error
make:warning:file ‘home/abcd/ns-allinone2.34/tcl8.4.18/unix/makefile.in’ has modification time 1.5e+04s in the future
So plz tell me what i can do now
Sunday, March 20, 2011 at 5:46
Hello, I would like to ask, how do I run ns in ubuntu 10.10.
I had installed it following your instructions. Then I tried to run an example tcl file by going to the tcl file directory and running “ns test.tcl” on terminal. But I get “The program ‘ns’ is currently not installed. You can install it by typing:
sudo apt-get install ns2”
I understand that this will start a completely new installation of ns 2, different from the installation already done supposedly.
How do I resolve this?
I’m sorry if its a silly question, I’m very new to linux environment and already tried googling to no avail. I hope you could shed some light.
THANKS!!! 🙂
Sunday, March 20, 2011 at 23:06
I guess you could make ns available from any directory by doing a ‘make install’ after installing/compiling ns-2.
However, I would advise you to instead use the full path when you want to run the simulator. This way you can have several ns-2 versions on your computer, maybe with different alterations to specific code segments, and know which version that you are using to run the simulations with.
If you for instance have a version of ns-2 in the directory /home/user/simulators/ns-allinone-2.34/.. you would from your simulation script directory write ‘/home/user/simulators/ns-allinone-2.34/ns-2.34/ns test.tcl’
Or you could use the relative path from the tcl file directory to get up to where the ns executable lies and run the simulation script with ‘../ns test.tcl’
Finally, if you are in the directory where the ns executable is residing, you have to put ‘./’ in front of the filename to execute the file. Thus, you have to write ‘./ns test.tcl’ to run the script.
Good luck!
Monday, March 21, 2011 at 5:03
Hi Erlend,
I have smoothly installed the ns, but when I run, it didn’t work.
ns: command not found
How do I resolve this?
thanks in advance
Thursday, March 24, 2011 at 9:00
Check my answer to Partohap above. 🙂
Thursday, March 24, 2011 at 7:34
Thank you thank you thank you! Iḿ a first timer, and you saved me!
Thursday, March 24, 2011 at 9:00
Glad to help!
Sunday, April 10, 2011 at 18:27
hi for me the installation was success but i couldn,t compile it it shows error ,how can i sort out this help me
% ns t.tcl
warning: using backward compatibility mode
error when calling class OldSim: t.tcl
Sunday, April 17, 2011 at 11:29
I followed ur installation steps.
Tcl ,Otcl ,Tk builds are successful
but during the ns 2.34 build it gives an error n terminates abruptly…
gcc Killed…
Plz help ASAP…thanks..
Friday, May 13, 2011 at 22:21
hi when i execute make makefile.in
the following error appears:
******
administrateur@ubuntu:~/ns-allinone-2.34/ns-2.34$ make makefilemake: *** No rule to make target `makefile’. Stop.
********
Please help
THANKS IN ADVANCE
Wednesday, May 25, 2011 at 14:50
Hi Erland,
I try to install NS2 on my Natty Narwhal (11.04) but there are any problem. that’s:
gcc -V 4.5.2 -c -g -O2 -DNDEBUG -DUSE_SHM -fpic -I. -I/home/madness/ns-allinone-2.34/include -I/home/madness/ns-allinone-2.34/include -I/home/madness/ns-allinone-2.34/include -I/include otcl.c
gcc: error trying to exec ‘x86_64-linux-gnu-gcc-4.5.2’: execvp: File o directory non esistente
gcc -shared -o libotcl.so otcl.o
gcc: otcl.o: File o directory non esistente
gcc: no input files
make: *** [libotcl.so] Errore 1
otcl-1.13 make failed! Exiting …
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems
Can you help me?
thank you vary much!
(from italy –> i’m sorry for my english)
Wednesday, May 25, 2011 at 15:01
I tried to do :https://erl1.wordpress.com/2011/05/12/installing-ns-2-34-on-ubuntu-11-04/
but without good results
I Hope you con help me
Thursday, May 26, 2011 at 9:07
Hi,
I don’t understand why you have a make command where you force the gcc compiler to use version 4.5.2, as the first line in your error message states: “gcc -V 4.5.2 -c…”. But I have no experience with the 64 bit OS. Perhaps it would work better using a 32 bit OS?
Cheers,
Erlend
Thursday, May 26, 2011 at 9:53
Hi Erland,
these are the last lines after invoking the command “. / install” to install NS2.
I’m not forced to use gcc 4.5.2. So you think it is a problem due to the 64bit OS?
I downloaded the package gcc4.3.3 but it seems difficult to install (I’m new in linux). As far as I understand, I think he can not see the gcc compiler during installation. This problem arises when it is installing “OTcl.
I always hope in you
thanks for attention
Thursday, May 26, 2011 at 10:45
I’m just looking to see what factors are different for you compared to me, and the 64 bit OS is one difference. I’m not able to recreate your error, but installing gcc 4.4 should be easy using the Synaptics Packet Manager.
If this is very important for you, I would reinstall Ubuntu 11.04 and download a clean version of ns-allinone-2.34 and follow the directions in the post https://erl1.wordpress.com/2011/05/12/installing-ns-2-34-on-ubuntu-11-04/ to the letter. 🙂
Cheers
Thursday, May 26, 2011 at 11:39
You can run Synaptic Package Manager either through the Applications button (the magnifying glass with a + inside), or run it from the command line:
$ sudo synaptic
I’ll add this to the blog post also.
Thursday, May 26, 2011 at 11:08
First, thanks for your patience.
NS2 I need for college and, unfortunately, even in a short time.
I followed exactly your guide for ubuntu 11.04.
What you call “Synaptic Packet Manager” would be “Ubuntu software center” in 11:04?
From there I installed gcc and automatically installed the version 4.5.2!
How can I now install the 4.4?
grrrrrrr that anger! but could not be easier to install software in linux!?
many thanks
P.S.
if we can not solve the problem, I might consider installing a new version of linux in another HD (external), right?
Thursday, May 26, 2011 at 11:39
I found Synaptic! :))
Now, I install the 4.4 version and let you know what happens!
Slowly, I learn!
Sunday, June 19, 2011 at 9:01
Hi can you tell me how to install um-olsr in ns2 2.34 ,I’m using ubuntu 10.10
Tuesday, June 21, 2011 at 7:47
I think it will go smoothly if you follow the installation instructions at the um-olsr webpage and patch with the um-olsr patch for ns-2.34 here: http://masimum.dif.um.es/?Software:UM-OLSR:Patches
Cheers
Monday, July 4, 2011 at 10:32
warning: using backward compatibility mode
error when calling class OldSim
Monday, July 4, 2011 at 10:33
plz can u hel me for this…………. i have so much problem with this………..
warning: using backward compatibility mode
error when calling class OldSim
Tuesday, July 12, 2011 at 11:47
please help me , getting problem while installing ,i log off, log in
executeed sudo apt-get update
it asked password i gave
the media change:please insert the disc labeled
‘ Ubuntu 10.10 _Maverick Meerkat_-Release i386(20101007)’
in the drive ‘/cdrom/’ and press enter
i got this, so i inserted ubuntu 10.10 i press enter ,but still getting same problem
Your comment is awaiting moderation.
Thursday, September 22, 2011 at 11:54
I have the same problem..so plz help
Friday, September 23, 2011 at 9:01
You can edit the repositories that apt uses, either through editing the file /etc/apt/sources.list directly, or through the Synaptic Package Manager. You need to disable the use of the CD as repository, provided you are connected to the Internet.
Monday, September 19, 2011 at 11:46
i am now currently using ubuntu 11.04 could you please tell me how to run ns 2.34 and how can i work the thing in my system.anyone please help me… and thank you in advance.
Monday, September 19, 2011 at 12:16
https://erl1.wordpress.com/2011/05/12/installing-ns-2-34-on-ubuntu-11-04/
Thursday, October 27, 2011 at 21:59
I am now currenty using ubuntu 10.10
and when i typed
# sudo source ~/.bashrc
the respond is :
sudo: source: command not found
what should i do ??
thanks
Friday, November 4, 2011 at 13:22
I have received a scheme for pacing packets and its called queue length based pacing (QLBP) from its author.
He provided the documentation to patc that scheme in ns-allnone-2.33.
that is :
—————————————————————————-
Apply QLBP patch
Step 1. Copy ns2-patch/queue/qlbp.cc and qlbp.h to ns-homefolder/ns-2.33/queue, where ns-homefolder is where the ns-allinone-2.33 package is installed.
Step 2. Copy lines 109 to 118 of ns2-patch/tcl/lib/ns-default.tcl into ns-homefolder/ns-2.33/tcl/lib/ns-default.tcl. The copied content can be inserted at line 109 of ns-homefolder/ns-2.33/ tcl/lib/ns-default.tcl. Note that don’t replace your ns-default.tcl with the provided ns-default.tcl. Doing so will cause a failure of running ns2 in your linux machine.
That is :
# added by Yan Cai
Queue/QLBP set drop_front_ false
Queue/QLBP set summarystats_ false
Queue/QLBP set queue_in_bytes_ false
Queue/QLBP set mean_pktsize_ 500
Queue/QLBP set qmax_ 20
Queue/QLBP set umax_ 100Mb
Queue/QLBP set umin_ 100Kb
Queue/QLBP set amplfer_ 1.0
Queue/QLBP set linespeed_ 100Mb
Step 3. Copy line 326 of ns2-patch/Makefile to line 326 of ns-homefolder/ns-2.33/Makefile.
That is : queue/qlbp.o \
Step 4. Go to ns-homefolder/ns-2.33/ and run “make” to recompile ns2.33
————————————————————————-
after going through the procedure I am getting following error :
———————————————————————–
invalid command name “Queue/QLBP”
while executing
“Queue/QLBP create _o645 ”
invoked from within
“catch “$className create $o $args” msg”
invoked from within
“if [catch “$className create $o $args” msg] {
if [string match “__FAILED_SHADOW_OBJECT_” $msg] {
delete $o
return “”
}
global errorInfo
error “class $…”
(procedure “new” line 3)
invoked from within
“new Queue/$qtype”
(“default” arm line 3)
invoked from within
“switch -exact $qtype {
ErrorModule {
if { [llength $args] > 0 } {
set q [eval new $qtype $args]
} else {
set q [new $qtype Fid]
}
}
intserv {
set qtyp…”
(procedure “_o3” line 14)
(Simulator simplex-link line 14)
invoked from within
“_o3 simplex-link _o141 _o153 100Mb 20ms QLBP”
(“eval” body line 1)
invoked from within
“eval $self simplex-link $n1 $n2 $bw $delay $type $args”
(procedure “_o3” line 8)
(Simulator duplex-link line 8)
invoked from within
“$ns duplex-link $acr($i) $cr(0) $stage2_bw $stage2_delay QLBP”
(procedure “create_topology” line 54)
invoked from within
“create_topology”
(file “bell_topology.tcl” line 528)
————————————————————————
I think there is just a little error in patching the QLBP scheme..
PLEASE HELP ME AS SOON AS POSSIBLE…
Wednesday, December 21, 2011 at 8:14
i have a problem when i install ns2.33 in ubuntu10.10
/home/pranesh/ns-allinone-2.33/tk8.4.18/unix/../generic/tk.h:81: fatal error: X11/Xlib.h: No such file or directory
make: *** [tk3d.o] Error 1
tk8.4.18 make failed!
Wednesday, December 21, 2011 at 8:23
Have you performed this operation successfully?: sudo apt-get install xorg-dev g++ xgraph
Wednesday, December 21, 2011 at 15:09
i did this. bt they show that xgraph can nt find anythng
Tuesday, January 10, 2012 at 19:42
HI!!
Thank you so much for putting up this content!
With much help from here and there I finally got NS2.34 installed on Ubuntu 11.04!!!!!!!
Wednesday, November 6, 2013 at 21:00
Hi Ashish,
Can you kindly share how you eventually managed to install NS2.34 on Ubuntu 11.04?
I am currently installing NS2.35 on Ubuntu 11.04 and I have the same error “fatal error: X11/Xlib.h: No such file or directory”
Much appreciated!
Wednesday, February 29, 2012 at 13:46
how to change that otcl thing.how to open that file.
Thursday, March 1, 2012 at 9:40
If you are on Ubuntu, and your ns-2 folder is situated directly under your home directory: open a terminal window, and write
gedit ~/ns-allinone-2.34/otcl-1.13/configure
and press enter.
Monday, March 5, 2012 at 19:36
I have installed ns2.34 on ubuntu 10.10 successfully… i also simulated 4 to 5 both wired & wireless source codes… but when i restarted after shutting down ubuntu 10.10 & tried to run same codes as earlier it is giving me error that ………
couldn’t open “out.nam”: permission denied
while executing
“open out.nam w”
invoked from within
“set nf [open out.nam w]”
(file “example2.tcl” line 9)
sir please help me ……i am not getting its solution…..
Monday, March 5, 2012 at 19:43
It looks like you have a permission problem. Make sure that the user you use when running ns has write-permission to the directory where the out.nam is attempted written.
Tuesday, March 6, 2012 at 7:01
hi erland sir, i want to ask whether can u assist me in simulating a special anycast routing algorithm in ns2?
Tuesday, March 6, 2012 at 8:45
its based on ieee paper titled, “Minimizing delay and maximizing lifetime of wireless sensor networks using anycast”
Tuesday, May 29, 2012 at 11:33
hi,
help solve this error message in an attempt to run ns-simple.tcl after installation. what should i do pls?
warning: using backward compatibility mode
error when calling class OldSim
Monday, August 27, 2012 at 10:18
hi i have a doubt. I installed ns2 successfully. but how do i check xgraph is installed od not?
Sunday, December 19, 2021 at 23:13
https://mykingdomtoken.com/blasenreste spaquart quintyla a30b5ac58e