LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-08-2012, 10:39 AM   #1
anitha.r.u
LQ Newbie
 
Registered: Mar 2012
Posts: 3

Rep: Reputation: Disabled
Leach protocol


Hi,

I am working on LEACH protocol. I have just installed NS2.27 onto my system in fedora. Following the LEACH installation steps I just need the mit.tar.gz file for LEACH and also I require leach_makefile-2.27.patch for further installation.

I already tried the following links,but it fails.

http://www.internetworkflow.com/down...ach/mit.tar.gz .

Leach make file:

http://www.internetworkflow.com/down...leach/Makefile

Can anyone suggest me where can I download this patch for LEACH.

Thank you
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-09-2012, 02:54 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
Welcome to LQ. .. ..

Links to files, etc. here, post # 4
http://www.linuxquestions.org/questi...each-862835/#4


The 500 LEACH posts at LQ :
LQ Search , TAG = leach

.
 
2 members found this post helpful.
Old 03-09-2012, 10:27 AM   #3
trung65
LQ Newbie
 
Registered: Mar 2012
Posts: 9

Rep: Reputation: Disabled
HI all,sorry for my poor English im a newbie in linux and im trying to implement LEACH on ns2.27. I must send a special thank to Knudfl, base on ur instructions, i do install successfully ns2.27 in ubuntu 10.04. Now on the LEACH phase,im stuck. I read the whole thead 18 page (which is closed) and have some questions. Please guide me.
1. I cant Make -f the knudfl's file (please see the below)

trung@ubuntu:~/ns-allinone-2.27/ns-2.27$ make -f 1-LEACH-Makefile-modified.txt.doc
1-LEACH-Makefile-modified.txt.doc:1: warning: NUL character seen; rest of line ignored
1-LEACH-Makefile-modified.txt.doc:1: *** missing separator. Stop.

2. So im trying the LEACH-makefile-org, ( already edit the gcc,g++ >>3.3;add DMIT_uAMPS; -I./mit/rca -I./mit/uAMPS and 3 lines after GAF...)
then, result in error http://www.linuxquestions.org/questi...379/page2.html post#25

3. I try ur instruction in #26 ,which i dont understand clearly.
i do :
cd otcl-1.13/ && ./configure --prefix=/usr --enable-release --enable-devel
and Make >>> error below

trung@ubuntu:~/ns-allinone-2.27/otcl-1.13$ make
rm -f libotcl.so otcl.o so_locations
gcc -c -g -O2 -fsigned-char -fno-inline -DUSE_SHM -fpic -I. -I/home/trung/ns-allinone-2.27/tk8.4.18/generic -I/home/trung/ns-allinone-2.27/tcl8.4.18/generic -I/home/trung/ns-allinone-2.27/tcl8.4.18/generic -I/include otcl.c
ld -shared -o libotcl.so otcl.o
otcl.o: In function `OTclDispatch':
/home/trung/ns-allinone-2.27/otcl-1.13/otcl.c:495: undefined reference to `__stack_chk_fail_local'
otcl.o: In function `Otcl_Init':
/home/trung/ns-allinone-2.27/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: Nonrepresentable section on output
make: *** [libotcl.so] Error 1

Bypass it, i try the next step with tclcl-1.19, result in below:

trung@ubuntu:~/ns-allinone-2.27/tclcl-1.19$ make
make: Nothing to be done for `all'.
trung@ubuntu:~/ns-allinone-2.27/tclcl-1.19$ sudo make install
/usr/bin/install -c -m 644 *.h /usr/include
/usr/bin/install -c tcl2c++ /usr/bin
/usr/bin/install -c libtclcl.a /usr/lib
ranlib /usr/lib/libtclcl.a

...and the next 2 sudo apt command :

trung@ubuntu:~/ns-allinone-2.27/otcl-1.13$ sudo apt-get remove tcl8.5-dev tk8.5-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package tcl8.5-dev is not installed, so not removed
Package tk8.5-dev is not installed, so not removed
You might want to run `apt-get -f install' to correct these:
The following packages have unmet dependencies:
libstdc++5-3.3-dev: Depends: libstdc++5 (>= 1:3.3.6-15ubuntu4) but it is not installable
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
trung@ubuntu:~/ns-allinone-2.27/otcl-1.13$ sudo apt-get install tcl8.4-dev tk8.4-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
tcl8.4-dev is already the newest version.
tk8.4-dev is already the newest version.
You might want to run `apt-get -f install' to correct these:
The following packages have unmet dependencies:
libstdc++5-3.3-dev: Depends: libstdc++5 (>= 1:3.3.6-15ubuntu4) but it is not installable
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Please help me this problem.. thank u!
Best regards!

Last edited by trung65; 03-09-2012 at 10:50 AM.
 
Old 03-09-2012, 10:49 AM   #4
trung65
LQ Newbie
 
Registered: Mar 2012
Posts: 9

Rep: Reputation: Disabled
Sorry if it is a double post :| . I also have a question about post #175 in the same above thread http://www.linuxquestions.org/questi...79/page12.html. I dont understand about step modify the Makefile in ns2.27

Step 3:
cd ns-allinone-2.27/ns-2.27/
gedit Makefile

Do the following in Makefile:
Add -DMIT_uAMPS to the DEFINE list
Add -I./mit/rca -I./mit/uAMPS to the INCLUDE list
Add the following just prior to the (before) line gaf/gaf.o \
mit/rca/energy.o mit/rca/rcagent.o \
mit/rca/rca-ll.o mit/rca/resource.o \
mac/mac-sensor-timers.o mac/mac-sensor.o mit/uAMPS/bsagent.o \
save the Makefile.

Does it mean we dont need the "LEACH-makefile-modified" ? I tried these steps and have the same error in http://www.linuxquestions.org/questi...379/page4.html post #50, after do Makeclean && make, i received:

make[1]: Entering directory `/home/trung/ns-allinone-2.27/ns-2.27/indep-utils/cmu-scen-gen/setdest'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/trung/ns-allinone-2.27/ns-2.27/indep-utils/cmu-scen-gen/setdest'
make[1]: Entering directory `/home/trung/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/dec'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/trung/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/dec'
make[1]: Entering directory `/home/trung/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/epa'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/trung/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/epa'
make[1]: Entering directory `/home/trung/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/nlanr'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/trung/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/nlanr'
make[1]: Entering directory `/home/trung/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/ucb'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/trung/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/ucb'

I followed the ur next post #51, but again, i dont understand it clearly and still cant make -f the LEACH-makefile as the same as my post above.
Can u explain it to me? Thank you!

Last edited by trung65; 03-09-2012 at 10:36 PM.
 
Old 03-11-2012, 11:02 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
# 3, # 4
Quote:
gcc -c -g -O2 -fsigned-char -fno-inline -DUSE_SHM -fpic -I. -I.........
"gcc" should be gcc-3.3, when Ubuntu 10.04 is used :
sudo apt-get install g++-3.3

The latest install guide for ns-allinone-2.27 / Ubuntu (10.04)
http://www.linuxquestions.org/questi...10-a-782356/#3

About the Makefile :
1) The "1-LEACH-Makefile-modified.txt" will usually work OK
in Ubuntu. But not if you use it / save it "as a .doc format".
2) May be easier with a new Makefile.in ? With the new objects added.
Then it's : export CC=gcc-3.3 CXX=g++-3.3 && ./configure && make
... The attached Makefile.in.leach.txt should be renamed to Makefile.in


Quote:
indep-utils/cmu-scen-gen/setdest'
make[1]: Nothing to be done for `all'.
"indep-utils/" : Not used with LEACH. Nothing to be done for `all' :
Means OK, these files were compiled with the previous 'make'.


P.S. : Simpler to use ns-2.34 for LEACH ?
http://www.linuxquestions.org/questi...34-a-870368/#5
And http://www.linuxquestions.org/questi...ra13-907076/#9
http://www.linuxquestions.org/questi...a13-907076/#11

.
Attached Files
File Type: txt Makefile.in.leach.txt (17.5 KB, 9 views)

Last edited by knudfl; 03-27-2012 at 08:18 AM.
 
1 members found this post helpful.
Old 03-11-2012, 01:13 PM   #6
trung65
LQ Newbie
 
Registered: Mar 2012
Posts: 9

Rep: Reputation: Disabled
Thanks for helping me, first, i download The "1-LEACH-Makefile-modified.txt" to win7 and it has a word file format, i copy to virtual machine ubuntu and it cant be used although i deleted the suffix .txt
I tried ur second instruction as :
-delete the old makefile.in
-download ur attach file and rename
-edit it with some add (uAMPS, 3 lines after gaf...),
-./configure && make >>> error as the below: (i post the last part)

mit/uAMPS/bsagent.o:bsagent.cc:(.text+0x15f6): first defined here
mit/uAMPS/bsagent.o: In function `BSAgent::itoa(int, char*)':
bsagent.cc:(.text+0x150e): multiple definition of `BSAgent::itoa(int, char*)'
mit/uAMPS/bsagent.o:bsagent.cc:(.text+0x150e): first defined here
mit/rca/rcagent.o: In function `RCAgent::sendmsg(int, char const*, int, int, double, int)':
rcagent.cc:(.text+0x766): undefined reference to `hdr_rca::offset_'
mit/rca/rcagent.o: In function `RCAgent::recv(Packet*, Handler*)':
rcagent.cc:(.text+0x8a6): undefined reference to `hdr_rca::offset_'
mit/rca/rca-ll.o: In function `RCALinkLayer::sendDown(Packet*)':
rca-ll.cc:(.text+0x10): undefined reference to `hdr_rca::offset_'
mit/rca/rca-ll.o: In function `RCALinkLayer::sendUp(Packet*)':
rca-ll.cc:(.text+0x1bd): undefined reference to `hdr_rca::offset_'
mac/mac-sensor.o: In function `MacSensor::send(Packet*, Handler*)':
mac-sensor.cc:(.text+0x4da): undefined reference to `hdr_rca::offset_'
mac/mac-sensor.o:mac-sensor.cc:(.text+0x6ad): more undefined references to `hdr_rca::offset_' follow
collect2: ld returned 1 exit status
make: *** [ns] Error 1

I did something wrong?
Please guide me... And im a bit confuse with makefile & makefile.in . So when we edit the first? when for the second one? And you linked me a threat about 2.34 leach. I wonder if it's easier for me to implement leach? I have no experience in Fedora,CentOS.. only have a little bit about ubuntu :(. So do the thread about ns2.34 in Fedora13 can help me the same with ubuntu 10.04?
Thank u Knudfl!
Best Regard!

Last edited by trung65; 03-11-2012 at 01:19 PM.
 
Old 03-11-2012, 01:18 PM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
# 6

!! It's not : ./configure && make

But : export CC=gcc-3.3 CXX=g++-3.3 && ./configure && make


And : You will probably have to do a 'make clean' before 'make'.

.
 
Old 03-11-2012, 09:09 PM   #8
trung65
LQ Newbie
 
Registered: Mar 2012
Posts: 9

Rep: Reputation: Disabled
Hi knudfl, i tried ur step, also do 'make clean' before.. the error still almost the same :

mit/uAMPS/bsagent.o:bsagent.cc:(.text+0x92c): first defined here
mit/uAMPS/bsagent.o: In function `BSAgent::recv(Packet*, Handler*)':
bsagent.cc:(.text+0xa9e): multiple definition of `BSAgent::recv(Packet*, Handler*)'
mit/uAMPS/bsagent.o:bsagent.cc:(.text+0xa9e): first defined here
mit/uAMPS/bsagent.o: In function `BSAgent::find_min_dist(double*, double*, int, double*, double*, int, int*, int*)':
bsagent.cc:(.text+0x15f6): multiple definition of `BSAgent::find_min_dist(double*, double*, int, double*, double*, int, int*, int*)'
mit/uAMPS/bsagent.o:bsagent.cc:(.text+0x15f6): first defined here
mit/uAMPS/bsagent.o: In function `BSAgent::itoa(int, char*)':
bsagent.cc:(.text+0x150e): multiple definition of `BSAgent::itoa(int, char*)'
mit/uAMPS/bsagent.o:bsagent.cc:(.text+0x150e): first defined here
collect2: ld returned 1 exit status
make: *** [ns] Error 1

I'll try the Leach in ns2.34 while waiting for ur answer. Thank u!
 
Old 03-12-2012, 03:19 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
# 8

Please show the output from the command : g++-3.3 --version
 
Old 03-12-2012, 11:58 AM   #10
trung65
LQ Newbie
 
Registered: Mar 2012
Posts: 9

Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
# 8

Please show the output from the command : g++-3.3 --version
hi knudfl, here is the output :

trung@ubuntu:~/ns-allinone-2.27/ns-2.27$ g++-3.3 --version
g++-3.3 (GCC) 3.3.6 (Ubuntu 1:3.3.6-15ubuntu4)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

In my opinion, it's not the error...maybe i'm wrong?
 
Old 03-12-2012, 01:14 PM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
# 10

Are you quite sure, that g++-3.3 is used ?

ns-allinone-2.27/ns-2.27/Makefile , line 37 : CPP = g++-3.3

Be aware that the export command is temporary. If you exit the
terminal before doing ./configure, you will reset to plain g++.

g++-3.3 used to work on Ubuntu 9.10 with ns-2.27 :
http://www.linuxquestions.org/questi...10-a-782356/#3

.
 
Old 03-12-2012, 11:47 PM   #12
trung65
LQ Newbie
 
Registered: Mar 2012
Posts: 9

Rep: Reputation: Disabled
Hi knudfl
Here is the makefile :

# The following will be redefined under Windows (see WIN32 lable below)
CC = gcc-3.3
CPP = g++-3.3

And the makefile.in:

# The following will be redefined under Windows (see WIN32 lable below)
CC = @CC@
CPP = @CXX@

As i mentioned in #6,im confuse between these two files,wonder when edit the first or the second..
I also tried to edit all two files with CC= gcc-3.3,CPP= g++-3.3 and export,configure,make clean, make...again, but it result the same error. I worked with only 1 command terminal as you noticed. After error, i checked again the gcc-3.3 version, still g++-3.3 (GCC) 3.3.6 (Ubuntu 1:3.3.6-15ubuntu4)
I also have question about this line in Makefile :

TCLSH = /home/trung/ns-allinone-2.27/bin/tclsh8.4

I saw in a thread that it must be changed, isn't it?
Thank you again for quickly reply me!
 
Old 03-13-2012, 02:11 AM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
# 12

Why care about the Makefile ?

Please generate a new one from the Makefile.in , post # 5
cd ns-allinone-2.27/ns-2.27/ &&
export CC=gcc-3.3 CXX=g++-3.3 && ./configure && make clean && make
 
Old 03-13-2012, 08:55 AM   #14
trung65
LQ Newbie
 
Registered: Mar 2012
Posts: 9

Rep: Reputation: Disabled
Hi knudfl!
I restored my virtual machine and do the same as you guide,with the new Makefile.in and it result in the same error as post #4
What should i do next...
 
Old 03-13-2012, 12:51 PM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
# 14
Quote:
... the same error as post #4
What do you mean ? ? ? I don't see any errors ( Or the word error.)

Post # 5 explains ..
"" Nothing to be done for `all' "" : means OK.

.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Leach Protocol for ns2.34 pushpita Linux - Software 36 07-08-2013 04:06 AM
SPIN and LEACH protocol in NS-2 shanky Linux - General 17 05-26-2012 12:03 PM
protocol leach ezzati Linux - Newbie 5 05-03-2011 08:42 PM
Leach Protocol simuation avinash.more Ubuntu 1 01-24-2011 05:00 PM
i can not run LEACH protocol on ns-2.29 what steps should i take? norisknolife Linux - Wireless Networking 2 01-07-2011 11:57 PM


All times are GMT -5. The time now is 03:04 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration