This is almost identical to the way ns-2.34 is installed on Ubuntu 11.04, except for the lines in bold face:
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"
Then, edit the file ns-2.34/tools/ranvar.cc and change the line 219 from
return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
to
return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
Next, change the lines 183 and 185 in file ns-2.34/mobile/nakagami.cc to read
resultPower = ErlangRandomVariable(Pr/m, int_m).value();
and
resultPower = GammaRandomVariable(m, Pr/m).value();
Add a line after line 64 in ns-2.34/mac/mac-802_11Ext.h to read:
#include <stddef.h>
Now the code will compile if you run ./install
. However, you may not be able to run the ns executable. If you get an error stating that there has been a buffer overflow *** buffer overflow detected ***: ./ns terminated
including a backtrace, you need to do the following to make it work:
Install gcc-4.4 and g++-4.4 including dependencies using the code below:
$ sudo apt-get install gcc-4.4 g++-4.4
Change the line 270 in tcl8.4.18/unix/Makefile.in that reads
CC = @CC@
so it uses gcc version 4.4:
CC = gcc-4.4
Finally, run ./install
from the ns-allinone-2.34 top folder again.
P.S. If you are moving and renaming ns-2 folders as time goes by, check the tip here on a potential problem with tk.
Tuesday, October 18, 2011 at 18:00
thanks you saved me
Friday, October 21, 2011 at 16:46
how to install ns 2.34 on ubuntu 11.10.. please explain to me in detail
Friday, October 28, 2011 at 3:53
thanks a lot
i would like to ask permission to translate this post into Chinese and i will keep the origin URL
Friday, October 28, 2011 at 7:30
Permission granted! 🙂
Monday, October 31, 2011 at 14:14
Thanks you so much………………
Friday, November 4, 2011 at 3:33
Good morning,
I try to transform ns-2.34 to multi interface multi channel with routing protocol TORA but It don’t work. I use same things as in AOMDV in ns2.33 in this @:http://mohittahiliani.blogspot.com/2011/07/modified-aomdv-with-multiple-interface.html
pls can you help me.
Friday, November 4, 2011 at 9:49
A long time ago, I implemented multiple interfaces for use with OLSR using the recipe by Ramón Calvo http://personales.unican.es/aguerocr/
Thursday, November 10, 2011 at 18:12
hey.. very nice description..but when i followed all these steps i am getting the following error.
Warning: tclStubInit.c may be out of date.
Developers may want to run “make genstubs” to regenerate.
This warning can be safely ignored, do not report as a bug!
Installing libtcl8.4.a to /home/ranjita/ns-allinone-2.34/lib/
cp: cannot create regular file `/home/ranjita/ns-allinone-2.34/lib/#inst.10843#’: Permission denied
rm: cannot remove `/home/ranjita/ns-allinone-2.34/lib/libtcl8.4.a’: Permission denied
mv: cannot stat `/home/ranjita/ns-allinone-2.34/lib/#inst.10843#’: No such file or directory
ranlib: could not create temporary file whilst writing archive: No more archived files
make: *** [install-binaries] Error 1
tcl8.4.18 installation failed.
Tcl is not part of the ns project.
Please help me out.. need to install it urgently..
Thursday, November 10, 2011 at 18:17
Perhaps you have a file and directory permissions problem?
Saturday, November 26, 2011 at 1:59
Hi sir, How i solve this error…………….
I have installed ns2(ns-allinone-2.34) in ubuntu11.10 .. At time of
execution it’s showing some error like u installed tcl8.5 package th
need is exactly tc18.4 only like that.
Error is
: version conflict for package “Tcl”: have 8.5.10, need exactly 8.4
while executing
“package require -exact Tcl 8.4”
child process exited abnormally
i cannn’t execute nam animatorr sir while i try to execute this error is come plz help ……
Saturday, November 26, 2011 at 2:02
how i solve this error
I have installed ns2(ns-allinone-2.34) in ubuntu11.10 .. At time of
execution it’s showing some error like u installed tcl8.5 package th
need is exactly tc18.4 only like that.
Error is
: version conflict for package “Tcl”: have 8.5.10, need exactly 8.4
while executing
“package require -exact Tcl 8.4”
child process exited abnormally
Friday, December 2, 2011 at 18:21
I have the same problem, if you fixed this problem,
pleace, tell me how.
Friday, January 27, 2012 at 7:56
have you installed ns2 using the command “sudo spt-get install ns2 nam xgraph “? IF it…first uninstall ns2.34 and “nam”(important) from the system …install ns2.35 from sourceforge
Monday, January 23, 2012 at 19:22
Hi, when I run the code i faced following error. pls help me..
make: Warning: File `Makefile.in’ has modification time 1.9e+07 s in the future
Makefile.in is newer than Makefile.
You need to re-run configure.
false
make: *** [Makefile] Error 1
Ns make failed!
Tuesday, January 24, 2012 at 8:09
Have you tried executing
./configure
from the
ns-allinone-2.34/ns-2.34
folder, or any other folder where you have a Makefile?
Tuesday, January 24, 2012 at 13:59
Yes, I have tried, I faced the same error..
kindly help me
Monday, January 30, 2012 at 17:29
Hi i faced following error. kindly guide me…
gcc -c -g -O2 -DNDEBUG -DUSE_SHM -fpic -I. -I/home/sesho/ns-allinone-2.34/include -I/home/sesho/ns-allinone-2.34/include -I/home/sesho/ns-allinone-2.34/include -I/include otcl.c
ld -shared -o libotcl.so otcl.o
otcl.o: In function `OTclDispatch’:
/home/sesho/ns-allinone-2.34/otcl-1.13/otcl.c:495: undefined reference to `__stack_chk_fail_local’
otcl.o: In function `Otcl_Init’:
/home/sesho/ns-allinone-2.34/otcl-1.13/otcl.c:2284: undefined reference to `__stack_chk_fail_local’
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 …
Saturday, February 11, 2012 at 13:37
I have the same problem, if you fixed this problem, pleace, tell me how.
Saturday, February 11, 2012 at 15:11
re,
I forgot to do these first instructions:
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”
Once I did I could fix this problem.
Wednesday, February 8, 2012 at 10:00
I have installed Ns-2.34 on Ubuntu 11.10, but when I tried to run
$ ns example1a.tcl
i got
nam:
: version conflict for package “Tcl”: have 8.5.10, need exactly 8.4
while executing
“package require -exact Tcl 8.4”
Can you please help me to solve this problem
Monday, March 26, 2012 at 11:26
“nam command is not working” , i am using ubuntu 11.04 and i am able run tcl file using ns command but nam dont work plz help, thanks
Tuesday, April 3, 2012 at 7:45
I think you need to compile nam by itself.
Monday, April 2, 2012 at 21:23
Hi, I am using ubuntu 11.10 and I’m trying to install ns-3.9. I can’t build ns-3. It keeps giving me the error:
Build failed: -> task failed (err #1):
{task: cxx buffer.cc -> buffer_1.o}
Traceback (most recent call last):
File “./build.py”, line 117, in
sys.exit(main(sys.argv))
File “./build.py”, line 108, in main
build_ns3(config)
File “./build.py”, line 56, in build_ns3
run_command([“python”, “waf”])
File “/home/larissa/repos/ns-allinone-3.9/util.py”, line 24, in run_command
raise CommandError(“Command %r exited with code %i” % (argv, retval))
util.CommandError: Command [‘python’, ‘waf’] exited with code 1
I really would appreciate any help!
Thanks,
Larissa.
Tuesday, April 3, 2012 at 7:30
Have you installed the Python development kit?
sudo apt-get install python-dev
Tuesday, April 3, 2012 at 14:59
Yes. I have, but I still get the same error.
Thanks.
Friday, April 6, 2012 at 1:33
Can anyone have an example of MANETs which includes DCCP instead of TCP as tcl file.
its urgent
Tuesday, May 29, 2012 at 11:40
Thank you
Wednesday, September 19, 2012 at 20:29
You should really add this to the NS-2 wiki !
Wednesday, January 8, 2014 at 10:27
hi all
I installed ns2 in ubuntu 12.04 and run leach on it without any error(I fixed them)
but there is no valid output I think, I saw this problem later that no one know it.
can any one help me where is the problem?
http://www.4shared.com/file/iEc3lORcba/leach.html
Creating sensor nodes…
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 (100 == BS)
*** NOTE: no connection pattern specified.
Loading scenario file…
Node 0: (65.745973803916002,92.581722416254564)
Node 1: (21.008649990432268,92.380389195112684)
Node 2: (37.201202259027028,40.606367467253641)
Node 3: (71.218022131928251,61.297971318148988)
Node 4: (35.003944130150579,11.288995440718249)
Node 5: (34.146372151629237,98.076752432657756)
.
.
.
Node 99: (44.071560420129238,10.71598111219517)
Max Distance for this Simulation is 139.0
Load complete…
Starting Simulation…
THRESH = 0.050000000000000003
0: *******************************************
THRESH = 0.050000000000000003
1: *******************************************
THRESH = 0.050000000000000003
2: *******************************************
THRESH = 0.050000000000000003
3: *******************************************
THRESH = 0.050000000000000003
4: *******************************************
THRESH = 0.050000000000000003
5: *******************************************
THRESH = 0.050000000000000003
.
.
.
THRESH = 0.050000000000000003
99: *******************************************
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
0: Warning!!! No Cluster Head ADVs were heard!
Data being sent to the Base Station
Data was sent to the base station
1: Warning!!! No Cluster Head ADVs were heard!
Data being sent to the Base Station
Data was sent to the base station
2: Warning!!! No Cluster Head ADVs were heard!
Data being sent to the Base Station
Data was sent to the base station
3: Warning!!! No Cluster Head ADVs were heard!
Data being sent to the Base Station
Data was sent to the base station
4: Warning!!! No Cluster Head ADVs were heard!
Data being sent to the Base Station
Data was sent to the base station
.
.
.
99: Warning!!! No Cluster Head ADVs were heard!
Data being sent to the Base Station
Data was sent to the base station
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
.
.
.
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning! There are no nodes in this cluster (11)!
Data being sent to the Base Station
Data was sent to the base station
Warning! There are no nodes in this cluster (26)!
Data being sent to the Base Station
Data was sent to the base station
.
.
Node 0 is DEAD!!!!
Node 1 is DEAD!!!!
Node 2 is DEAD!!!!
Node 3 is DEAD!!!!
Node 4 is DEAD!!!!
Node 5 is DEAD!!!!
.
.
.
Node 94 is DEAD!!!!
Node 95 is DEAD!!!!
At 1.0999999999999999:
Total Energy = 30125.543246939353
Total Data = 0
Total Alive = 4
Simulation complete.
num_nodes is set 101
channel.cc:sendUp – Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 222.8
as we see , at end Total data is 0 and all of the nodes dead!!!
help plsss:)
Friday, May 29, 2015 at 10:52
Why the total running time is 1.0999999999999s and the total data is 0.
Thank you very much