![]() |
how to install leach patch in ns2.34 in ubuntu 9.10
I am working on wsn security. I need to include the leach protocol as my model is hierarchial.
I have found many threads about patching leach in ns2.27... But i need to know how can i include patch of leach in ns2.34 in ubuntu 9.10 ???? sunny |
1 Attachment(s)
Welcome to LQ. .. .. :) ..
Build instructions, ns-allinone-2.27, Ubuntu 9.XX, post #3 : http://www.linuxquestions.org/questi...10-a-782356/#3 LQ member @ emtarik05 has ported the leach code (mit.tar.gz) to ns-2.34. EDIT : Latest package + instructions + install script, #5 here, by @MayTamer http://www.linuxquestions.org/questi...34-a-870368/#5 (( Patch / package name, old version : tarik-ns234-leach.tar.bz2 )) EDIT : see above. (( https://docs.google.com/leaf?id=0B7S...ut=list&num=50 )) The @emtarik05 posts : #68, #78, #88 http://www.linuxquestions.org/questi...379/page6.html .. |
Quote:
|
Quote:
LQ member. May be you will write your personal HOWTO in a follow up post ? That will be very much appreciated. EDIT : A HOWTO "leach on ns-2.34" is now available http://www.linuxquestions.org/questi...34-a-870368/#5 Thanks in advance. .. |
Quote:
when i was patching it showed. sunny@sunny-laptop:~/simulator/ns-allinone-2.27/tk8.4.18$ patch -p0 < tk-8.4-lastevent.patch patching file generic/tk.h Hunk #1 FAILED at 635. 1 out of 1 hunk FAILED -- saving rejects to file generic/tk.h.rej the otcl was patched without prblm. I installed ns2.27 without any problem. Then i set the environment variable in ~/.bashrc I add the variables after the environment variables of ns2.34 Then i became confused. Should I use the mit.tar.gz or Tarik_ben__1_9__USTHB_leach_for_NS2.34 in ns2.27 ? Then will do the next steps starting from step3 as here: http://cypress.tistory.com/entry/ns2-227-ubuntu But again i am saying that should i use mit.tar.gz or Tarik_ben__1_9__USTHB_leach_for_NS2.34 ?? Then at step 6 i will do only : make -f 1-LEACH-Makefile-modified Then i will # make clean # make Then ./test or ./leach_test Pls tell me if i am wright or wrong ? Another question, how i will do this as said following and when : "the leach modified to run under NS-2.34 create a shortcut of leach.tcl, leach-c.tcl ... and put them on ..\tcl\mobility\" waiting for you reply eagerly but in the meantime i am including mit.tar.gz as said in ns2leach.pdf(i think u saw it). after "make clean" i put the Makefile from http://www.internetworkflow.com/downloads/ns2leach/ in ns2.27 dir and then make, but it showed me an error like this: sunny@sunny-laptop:~/simulator/ns-allinone-2.27/ns-2.27$ make g++ -c -g -Wall -DTCP_DELAY_BIND_ALL -DNO_TK -DTCLCL_CLASSINSTVAR -fsigned-char -fno-inline -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_8 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCL_H -DHAVE_CONFIG_H -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=std -DUSE_SINGLE_ADDRESS_SPACE -Drng_test -DMIT_uAMPS -I. -I/usr/X11R6/include -I/home/Administrator/ns-allinone-2.27/tclcl-1.15 -I/home/Administrator/ns-allinone-2.27/otcl-1.8 -I/home/Administrator/ns-allinone-2.27/include -I/home/Administrator/ns-allinone-2.27/include -I/usr/include/pcap -I./tcp -I./sctp -I./common -I./link -I./queue -I./adc -I./apps -I./mac -I./mobile -I./trace -I./routing -I./tools -I./classifier -I./mcast -I./diffusion3/lib/main -I./diffusion3/lib -I./diffusion3/lib/nr -I./diffusion3/ns -I./diffusion3/filter_core -I./asim/ -I./qs -I./mit/rca -I./mit/uAMPS -o tools/random.o tools/random.cc In file included from tools/random.cc:40: ./config.h:60:19: error: tclcl.h: No such file or directory In file included from tools/random.h:42, from tools/random.cc:41: tools/rng.h:103: error: expected class-name before ‘{’ token tools/rng.h:342: error: ‘FILE’ has not been declared tools/random.cc: In function ‘long int random()’: tools/random.cc:53: error: ‘printf’ was not declared in this scope make: *** [tools/random.o] Error 1 sunny@sunny-laptop:~/simulator/ns-allinone-2.27/ns-2.27$ I alse tried as u said : make -f 1-LEACH-Makefile-modified It also showed error like this : sunny@sunny-laptop:~/simulator/ns-allinone-2.27/ns-2.27$ make -f 1-LEACH-Makefile-modified g++33 -c -g -Wall -DTCP_DELAY_BIND_ALL -DNO_TK -DTCLCL_CLASSINSTVAR -fsigned-char -fno-inline -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_8 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCL_H -DHAVE_CONFIG_H -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=std -DUSE_SINGLE_ADDRESS_SPACE -Drng_test -DMIT_uAMPS -I. -I/usr/X11R6/include -I/home/Administrator/ns-allinone-2.27/tclcl-1.15 -I/home/Administrator/ns-allinone-2.27/otcl-1.8 -I/home/Administrator/ns-allinone-2.27/include -I/home/Administrator/ns-allinone-2.27/include -I/usr/include/pcap -I./tcp -I./sctp -I./common -I./link -I./queue -I./adc -I./apps -I./mac -I./mobile -I./trace -I./routing -I./tools -I./classifier -I./mcast -I./diffusion3/lib/main -I./diffusion3/lib -I./diffusion3/lib/nr -I./diffusion3/ns -I./diffusion3/filter_core -I./asim/ -I./qs -I./mit/rca -I./mit/uAMPS -o tools/random.o tools/random.cc make: g++33: Command not found make: *** [tools/random.o] Error 127 sunny@sunny-laptop:~/simulator/ns-allinone-2.27/ns-2.27$ What can i do now ? |
After make -f 1-LEACH-Makefile-modified(i changed the Administrator to my homedirectory)
it says many things but at last : bin/string2c.tcl version_string < VERSION > gen/version.c bin/string2c.tcl: 5: gets: not found bin/string2c.tcl: 6: puts: not found make: *** [gen/version.c] Error 127 sunny@sunny-laptop:~/simulator/ns-allinone-2.27/ns-2.27$ But then i run ./test it says: sunny@sunny-laptop:~/simulator/ns-allinone-2.27/ns-2.27$ ./test num_nodes is set 3 warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl INITIALIZE THE LIST xListHead Loading connection pattern... Loading scenario file... Starting Simulation... channel.cc:sendUp - Calc highestAntennaZ_ and distCST_ highestAntennaZ_ = 1.5, distCST_ = 550.0 SORTING LISTS ...DONE! NS EXITING... ./test: line 5: ./leach_test: No such file or directory sunny@sunny-laptop:~/simulator/ns-allinone-2.27/ns-2.27$ |
Quote:
""./test: line 5: ./leach_test: No such file or directory"" Please use the edited script : http://www.linuxquestions.org/questi...27-a-785379/#6 And please read all six threads tagged 'leach'. There may be some good hints. LQ Search > 'Tag Name' = leach .. |
"1 out of 1 hunk FAILED" : It just means, we do not edit this line.
Has already been edited. (I.e. the patch was made for e.g. tk8.4.5). NS-2.27 : only the "mit.tar.gz" files are used. NS-2.34 : May be some "mit" files are used ? Please ask @ nour-eddine or @ emtarik05. .. |
| All times are GMT -5. The time now is 02:00 AM. |