LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   LEACH protocol installation on NS2.27 (https://www.linuxquestions.org/questions/linux-general-1/leach-protocol-installation-on-ns2-27-a-785379/)

Scofield 01-28-2010 10:27 AM

LEACH protocol installation on NS2.27
 
Hi,

I am working on LEACH protocol. I have just installed NS2.27 onto my system. Following the LEACH installation steps I just downloaded the mit.tar.gz file for LEACH.

Now I require leach_makefile-2.27.patch for further installation. Can anyone suggest me where can I download this patch for LEACH.

Thank you

knudfl 01-28-2010 12:07 PM

1 Attachment(s)
I can show the notes, I made a week ago ..

I downloaded this : MIT_uAMPS_ns.tar.gz , which seems
to be a complete ' ns-2.1b5 ', patched with LEACH.
This old version will work perfect on CentOS 3.9 .
But I have not yet tried to install this LEACH version.

So where did you get "" mit.tar.gz "" ?
May be you can provide a link.

I found no working links for any ns-2.27 LEACH files.

The notes, 22-Jan-2010 are attached ..
.....

Scofield 01-28-2010 02:35 PM

Steps and Site for installation
 
1 Attachment(s)
Hey thanks for the reply...
Please try installing LEACH on NS2.27 in Ubuntu 9.10.
The whole setup will take little time I will give you the site to download

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

Leach make file:

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

LEACH installation steps are given in the pdf file I have attached.. U will get mit.tar.gz at the above link. If the above site does not open please give me ur mail id I will send u the mit.tar.gz file. Here I am unable to upload it.


for clearly written steps follow this link.

http://cypress.tistory.com/entry/ns2-227-ubuntu

Please help me in installing the above, I am struck in between...

I will send u the errors I got while I install LEACH.

Thank you

knudfl 01-28-2010 06:57 PM

Thank you for showing the http://www.internetworkflow.com link.
Was down for a long time a week ago. Gave up using it then.

http://www.internetworkflow.com/downloads/ns2leach/
> > leach_install

http://www.internetworkflow.com/down...leach/Makefile
> > Makefile for ns-2.27

Google .. leach makefile-2.27.patch ..
.. probably the same things, you already found :
http://namaste.tistory.com/142
1) wget http://www.tekno.chalmers.se/~yushen...7-gcc410.patch
2) Step 9 / Step 5.1 : Makefile edits.

http://ns2.blogspot.com/2004_04_01_archive.html

http://read.pudn.com/downloads95/sou...34.patch__.htm
> > ns227-gcc34.patch

... So this was about all, I found today.
.....

Scofield 01-28-2010 10:28 PM

LEACH patch
 
are the leach makefile-2.27.patch and gcc410.patch are same because according to the instruction given in the below link(:patch -p0 < leach_makefile-2.27.patch)

http://cypress.tistory.com/entry/ns2-227-ubuntu

may be we have to use the leach makefile-2.27.patch file

I searched for it and I didnt get.. i followed
wget http://voyager.ce.fit.ac.jp/wiki/too...ile-2.27.patch
but it seems the link doesnot exist.

Any how after following the steps for LEACH installation from various links, after giving ./test, i get that ./leach_test: No such file or directory....


I will show u this error

PHP Code:

sawyer@sawyer:~/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
warning
no class variable Phy/WirelessPhy::alive_

    see tcl
-object.tcl in tclcl for info about this warning.

warningno class variable Phy/WirelessPhy::Efriss_amp_

warning
no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning
no class variable Phy/WirelessPhy::EXcvr_

warning
no class variable Phy/WirelessPhy::sleep_

warning
no class variable Phy/WirelessPhy::ss_

warning
no class variable Phy/WirelessPhy::dist_

INITIALIZE THE 
LIST xListHead
warning
no class variable Phy/WirelessPhy::alive_

    see tcl
-object.tcl in tclcl for info about this warning.

warningno class variable Phy/WirelessPhy::Efriss_amp_

warning
no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning
no class variable Phy/WirelessPhy::EXcvr_

warning
no class variable Phy/WirelessPhy::sleep_

warning
no class variable Phy/WirelessPhy::ss_

warning
no class variable Phy/WirelessPhy::dist_

warning
no class variable Phy/WirelessPhy::alive_

    see tcl
-object.tcl in tclcl for info about this warning.

warningno class variable Phy/WirelessPhy::Efriss_amp_

warning
no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning
no class variable Phy/WirelessPhy::EXcvr_

warning
no class variable Phy/WirelessPhy::sleep_

warning
no class variable Phy/WirelessPhy::ss_

warning
no class variable Phy/WirelessPhy::dist_

Loading connection pattern
...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp Calc highestAntennaZ_ and distCST_
highestAntennaZ_ 
1.5,  distCST_ 89.8
SORTING LISTS 
...DONE!
NS EXITING...
./
testline 5: ./leach_testNo such file or directly 

error can be seen in the last line.

What about the status of you trying for this. Did u try installing. Can you please try and install LEACH onto NS2.27 and try to find out where I am missing. or am I miss any installation file.

knudfl 02-09-2010 06:50 AM

Finally got it to compile. ( ./install ).

Code:

knudfl@88:~$ cd 9tmp/ns-allinone-2.27/ns-2.27
knudfl@88:~/9tmp/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...

The "test" script has a typo, this will work :
Code:

#!/bin/bash
cd tcl/ex
ns wireless-demo-csci694.tcl
sleep 2

cd ../../
./leach_test

.....
P.S. : The warnings have no importance, are information only.
So actually your test passed OK. !
I got no warnings on Ubuntu 9.10 , but warnings identical to yours
did appear on PCLinuxOS.
.....

knudfl 02-12-2010 05:54 AM

Your first test : ( from post # 5 )
Quote:

Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 89.8
SORTING LISTS ...DONE!
NS EXITING...
.. is OK ..

Your new test, received by email today, shows :
Quote:

Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 89.8
SORTING LISTS ...DONE!
NS EXITING...
sleep: invalid time interval `2\r'
Try `sleep --help' for more information.
Did you change "test" ? Please copy / paste the "test"
from post # 6, which is known to work.
Or did you use an MS - Windows app to copy or write
the test script, so is not UNIX text format any more ? ?
"" sleep: invalid time interval `2\r' "" looks like a formatting issue.
.....

Scofield 02-12-2010 10:53 AM

It worked
 
hey thank you very much.. I just edited the test file as it was in the 6th post and it worked.
yes the problem was it was in default opening through MS word (a WINE application).
I just edited the test file and saved it and run the ./test. I didnt get any errors..(only irritating warnings)

emtarik05 03-06-2010 06:05 AM

urgently
 
please can you send for me the patch "ns-2.27-gcc410.patch"
because the link doesn't work
thanks

knudfl 03-07-2010 04:26 AM

@ emtarik05, welcome to LQ.

The file ns-2.27-gcc410.patch is just mentioned as an example
on things that were / are available. Not at all needed.
Please read the LEACH threads, tagged : leach , and see,
that we did build LEACH without that.
http://www.linuxquestions.org/questi...atch-791222/#2

And better delete your email adress, to prevent spam.
Unless you haven't seen it, we can click your name,
and use the function : "Send email to emtarik05".
.....

emtarik05 03-07-2010 08:14 AM

thanks knudfl
I want to install NS2.27 on ubuntu 9.10.
but it indicate the following problem

============================================================
* Build tcl8.4.5
============================================================
loading cache ./config.cache
checking whether to use symlinks for manpages... no
checking compression for manpages... no
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking how to run the C preprocessor... gcc -E
checking for unistd.h... yes
checking for limits.h... yes
checking for building with threads... no (default)
checking if the compiler understands -pipe... yes
checking for required early compiler flags... _LARGEFILE64_SOURCE
checking for 64-bit integer type... long long
checking for struct dirent64... no
checking for struct stat64... yes
checking for off64_t... yes
checking whether byte ordering is bigendian... no
checking for getcwd... yes
checking for opendir... yes
checking for strstr... yes
checking for strtol... yes
checking for strtoll... yes
checking for strtoull... yes
checking for tmpnam... yes
checking for waitpid... yes
checking for strerror... yes
checking for getwd... yes
checking for wait3... yes
checking for uname... yes
checking for realpath... yes
checking dirent.h... yes
checking for errno.h... yes
checking for float.h... yes
checking for values.h... yes
checking for limits.h... (cached) yes
checking for stdlib.h... yes
checking for string.h... yes
checking for sys/wait.h... yes
checking for dlfcn.h... yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for sys/modem.h... no
checking termios vs. termio vs. sgtty... termios
checking for fd_set in sys/types... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for sys/time.h... yes
checking whether time.h and sys/time.h may both be included... yes
checking for tm_zone in struct tm... yes
checking for gmtime_r... yes
checking for localtime_r... yes
checking tm_tzadj in struct tm... no
checking tm_gmtoff in struct tm... yes
checking long timezone variable... yes
checking for st_blksize in struct stat... yes
checking for fstatfs... yes
checking for 8-bit clean memcmp... yes
checking for memmove... yes
checking proper strstr implementation... yes
checking for strtoul... yes
checking for strtod... yes
checking for strtod... (cached) yes
checking for Solaris2.4/Tru64 strtod bugs... ok
checking for ANSI C header files... yes
checking for mode_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking for socklen_t... yes
checking for opendir... (cached) yes
checking union wait... yes
checking for strncasecmp... yes
checking for BSDgettimeofday... no
checking for gettimeofday... yes
checking for gettimeofday declaration... present
checking whether char is unsigned... no
checking signed char declarations... yes
checking for a putenv() that copies the buffer... no
checking for langinfo.h... yes
checking whether to use nl_langinfo... yes
checking for sin... no
checking for main in -lieee... yes
checking for main in -linet... no
checking for net/errno.h... no
checking for connect... yes
checking for gethostbyname... yes
checking how to build libraries... static
checking for ranlib... ranlib
checking if 64bit support is requested... no
checking if 64bit Sparc VIS support is requested... no
checking system version (for dynamic loading)... ./configure: 1: Syntax error: Unterminated quoted string
tcl8.3.2 configuration failed! Exiting ...
Tcl is not part of the ns project. Please see www.Scriptics.com
to see if they have a fix for your platform.

tarik@tarik-desktop:~/Bureau/ns-allinone-2.27$

knudfl 03-07-2010 08:38 AM

Please read post # 10 again.
And read everything in the links very carefully.

When you follow the procedure in post # 3 here strictly ..
http://www.linuxquestions.org/questi...9.10-782356/#3

.. you will not meet any tcl-8.4.5 ( or 8.3.2 ),
because you are not using it ! Instead the 8.4.18
from ns-allinone-2.34 is linked and used !
.....

Another very important thing : Remove the system tcl, tk :
sudo apt-get remove tcl*
.. before you start the build of any ns2.

.....

maunik 03-09-2010 11:27 PM

hi
i am working on leach protocol.
i can't download mit.tar.gz from link http://www.internetworkflow.com/down...ach/mit.tar.gz .
because this link not open now.
please give me another link i download mit.tar.gz.
thanks....

knudfl 03-10-2010 12:14 PM

@ maunik : Click my name, send an email, and I will attach
mit.tar.gz + LEACH-Makefile-org to a return mail. ( 580 kB.)

.....

enji 03-17-2010 05:35 AM

hi,
I am a new user in LQ.

I'm trying to work with LEACH on ns-2.
So refer to the previous post I install ns-2.27 on Ubuntu 9.10.
But the problem now is the link for downloading LEACH for ns 2.27 give before, doesn't work.

So please, someone can give me a working link.
Thanks.

knudfl 03-17-2010 05:02 PM

@ enji, welcome to LQ.
Ref. your email :
The files mit.tar.gz + LEACH-Makefile-org have been send to you.

( @ maunik also asked for those, I hope the mail has arrived.)

.....

enji 03-18-2010 09:41 AM

Thank you knudfl.

I do what you tell me in the mail.

But when I run make -f 1-LEACH-Makefile-org, I've got this error

/home/enji/PFE/ns-allinone-2.27/lib -ltcl8.4 -lXext -lX11 -lintl -lm
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
mit/rca/resource.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [ns] Erreur 1

Do you know what it means?

knudfl 03-18-2010 02:15 PM

@ enji, post # 17.

Did you remember to do 'make clean' in ns-allinone-2.27/ns-2.27/ ?
1) cd ns-allinone-2.27/ns-2.27/
2) make clean

.....

enji 03-18-2010 02:32 PM

Quote:

Originally Posted by enji (Post 3903236)
Thank you knudfl.

I do what you tell me in the mail.

But when I run make -f 1-LEACH-Makefile-org, I've got this error

/home/enji/PFE/ns-allinone-2.27/lib -ltcl8.4 -lXext -lX11 -lintl -lm
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
/usr/bin/ld: mit/rca/resource.o: Relocations in generic ELF (EM: 2)
mit/rca/resource.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [ns] Erreur 1

Do you know what it means?

I found the problem:
when I do make clean, not all the files object (.o) are erase.
So when I delete the file: mit/rca/resource.o and re run make, it compile without errors.

The simulation of LEACH run also without any errors.

So thank you knudfl for your reply.
I have just another question:
During the simulation, a lot of warnings are displaying
is it possible to disable this.

Thanks.

knudfl 03-19-2010 05:53 AM

Post # 19

The warnings have no importance, are information only.
Please read the posts # 5 and # 6.

.....

emtarik05 03-20-2010 08:51 AM

Leach ns2.34
 
I modified MIT LEACH to work on NS2.34 ubuntu 9.10
its ok thank you.

knudfl 03-21-2010 02:47 AM

@ emtarik05, post # 21 : That is interesting. Really. Thank you.

Can you please describe, what you did, and can you make
this modified MIT available for others too ? Please ..
( I would very much like to have a copy.)
.....

omegabullit 03-30-2010 08:55 AM

Hey all, I followed a combination of instructions, basically I used the posts that knudfl posted in regards to setting up NS-2.27 (with NS-2.34), and I've used the Jason Pamplin pdf for going about with the LEACH installation. Also, I'm running Ubuntu 9.04. I've gotten to the point in the pdf where I need to run make after having extracted the mit.tar.gz package. I've made the necessary changes to the Makefile I have, but am getting the following errors:

Code:

g++ -c -Dstand_alone -DSTL_NAMESPACE=@STL_NAMESPACE@  -o setdest.o setdest.cc
setdest.cc:71:1: warning: "INFINITY" redefined
In file included from /usr/include/math.h:40,
                from setdest.cc:43:
/usr/include/bits/inf.h:27:1: warning: this is the location of the previous definition
In file included from ../../../config.h:54,
                from setdest.h:5,
                from setdest.cc:57:
../../../autoconf.h:85: error: ‘CPP_NAMESPACE’ is not a namespace-name
../../../autoconf.h:85: error: expected namespace-name before ‘;’ token
In file included from setdest.cc:57:
setdest.h:26: error: extra qualification ‘vector::’ on member ‘operator=’
setdest.h:31: error: extra qualification ‘vector::’ on member ‘operator+=’
setdest.h:36: error: extra qualification ‘vector::’ on member ‘operator==’
setdest.h:39: error: extra qualification ‘vector::’ on member ‘operator!=’
make[1]: *** [setdest.o] Error 1
make[1]: Leaving directory `/home/ucacm/Downloads/ns-allinone-2.27/ns-2.27/indep-utils/cmu-scen-gen/setdest'
make[1]: Entering directory `/home/ucacm/Downloads/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/dec'
g++ -c -DSTL_NAMESPACE=@STL_NAMESPACE@ -I. -I/home/ucacm/Downloads/ns-allinone-2.27/tclcl-1.15 -I/home/ucacm/Downloads/ns-allinone-2.27/otcl-1.8 -I/home/ucacm/Downloads/ns-allinone-2.27/include -I/home/ucacm/Downloads/ns-allinone-2.27/include -I/usr/include/pcap -o proxytrace.o proxytrace.cc
In file included from proxytrace.cc:3:
../../../autoconf.h:85: error: ‘CPP_NAMESPACE’ is not a namespace-name
../../../autoconf.h:85: error: expected namespace-name before ‘;’ token
make[1]: *** [proxytrace.o] Error 1
make[1]: Leaving directory `/home/ucacm/Downloads/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/dec'
make[1]: Entering directory `/home/ucacm/Downloads/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/ucacm/Downloads/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/epa'
make[1]: Entering directory `/home/ucacm/Downloads/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/nlanr'
g++ -c -DSTL_NAMESPACE=@STL_NAMESPACE@ -I. -I../../.. -I/home/ucacm/Downloads/ns-allinone-2.27/tclcl-1.15 -I/home/ucacm/Downloads/ns-allinone-2.27/otcl-1.8 -I/home/ucacm/Downloads/ns-allinone-2.27/include -I/home/ucacm/Downloads/ns-allinone-2.27/include -I/usr/include/pcap -o tr-stat.o tr-stat.cc
In file included from logparse.h:7,
                from tr-stat.cc:24:
../../../config.h:103:1: warning: "STRTOI64_FMTSTR" redefined
In file included from /home/ucacm/Downloads/ns-allinone-2.27/tclcl-1.15/tclcl.h:47,
                from ../../../config.h:60,
                from logparse.h:7,
                from tr-stat.cc:24:
/home/ucacm/Downloads/ns-allinone-2.27/tclcl-1.15/tclcl-config.h:37:1: warning: this is the location of the previous definition
In file included from ../../../config.h:54,
                from logparse.h:7,
                from tr-stat.cc:24:
../../../autoconf.h:85: error: ‘CPP_NAMESPACE’ is not a namespace-name
../../../autoconf.h:85: error: expected namespace-name before ‘;’ token
make[1]: *** [tr-stat.o] Error 1
make[1]: Leaving directory `/home/ucacm/Downloads/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/nlanr'
make[1]: Entering directory `/home/ucacm/Downloads/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/ucacm/Downloads/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/ucb'

I've also tried to perform the steps listed on this site:
http://www.isi.edu/nsnam/ns/ns-problems.html#ns-2.27

For applying a patch regarding the second problem listed under ns-2.27, but the patch would not work for me. Any thoughts?

Edit: I think I may have been using the wrong Makefile, this is attempting to make with the Makefile you sent me knudfl

Code:

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


knudfl 03-31-2010 04:34 AM

.......... Post # 23 ..
Well, the gcc / g++ 3.3 should be installed for a purpose :

LEACH-Makefile , line 36-37, please edit to ..
CC = gcc-3.3
CPP = g++-3.3

.....

I also have this , line 40 ..
TCLSH = tclsh8.4

.....

omegabullit 03-31-2010 10:16 AM

I made the changes you suggested knudfl, big new list of errors:

Quote:

g++-3.3 -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: 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: syntax error before `{' token
tools/rng.h:112: error: syntax error before `const'
tools/rng.h:113: error: syntax error before `long'
tools/rng.h:121: error: syntax error before `,' token
tools/rng.h:122: error: `RNGSources' was not declared in this scope
tools/rng.h:122: error: syntax error before `,' token
tools/rng.h: In function `RNG* defaultrng()':
tools/rng.h:123: error: `default_' undeclared (first use this function)
tools/rng.h:123: error: (Each undeclared identifier is reported only once for
each function it appears in.)
tools/rng.h: At global scope:
tools/rng.h:202: error: non-member function `void get_state(long unsigned int*)
' cannot have `const' method qualifier
tools/rng.h:208: error: non-member function `void write_state()' cannot have `
const' method qualifier
tools/rng.h:213: error: non-member function `void write_state_full()' cannot
have `const' method qualifier
tools/rng.h: In function `int random()':
tools/rng.h:259: error: new declaration `int random()'
/usr/include/stdlib.h:327: error: ambiguates old declaration `long int random()
'
tools/rng.h: At global scope:
tools/rng.h:290: error: syntax error before `protected'
tools/rng.h:328: error: `RNG*default_' used prior to declaration
tools/rng.h:329: error: syntax error before `}' token
tools/rng.h:341: error: incomplete type `RNG' does not have member `RNGSources'
tools/rng.h:341: error: syntax error before `,' token
tools/rng.h:342: error: incomplete type `RNG' does not have member `RNGSources'
tools/rng.h:342: error: syntax error before `,' token
In file included from tools/random.cc:41:
tools/random.h: In static member function `static RNG* Random::rng()':
tools/random.h:46: error: incomplete type 'RNG' cannot be used to name a scope
tools/random.h: In static member function `static void Random::seed(int)':
tools/random.h:49: error: incomplete type `RNG' does not have member `
RAW_SEED_SOURCE'
tools/random.h:49: error: `set_seed' undeclared (first use this function)
tools/random.h: In static member function `static int
Random::seed_heuristically()':
tools/random.h:50: error: incomplete type `RNG' does not have member `
HEURISTIC_SEED_SOURCE'
tools/random.h:50: error: `set_seed' undeclared (first use this function)
tools/random.h:50: error: `seed' undeclared (first use this function)
tools/random.h: In static member function `static int Random::random()':
tools/random.h:52: error: `uniform_positive_int' undeclared (first use this
function)
tools/random.h: In static member function `static double Random::uniform()':
tools/random.h:53: error: `uniform_double' undeclared (first use this function)
tools/random.h: In static member function `static double
Random::uniform(double)':
tools/random.h:54: error: `uniform' undeclared (first use this function)
tools/random.h: In static member function `static double
Random::uniform(double, double)':
tools/random.h:55: error: `uniform' undeclared (first use this function)
tools/random.h: In static member function `static double Random::exponential()
':
tools/random.h:56: error: `exponential' undeclared (first use this function)
tools/random.h: In static member function `static int Random::integer(int)':
tools/random.h:57: error: `uniform' undeclared (first use this function)
tools/random.h: In static member function `static double
Random::exponential(double)':
tools/random.h:58: error: `exponential' undeclared (first use this function)
tools/random.h: In static member function `static double Random::pareto(double,
double)':
tools/random.h:59: error: `pareto' undeclared (first use this function)
tools/random.h: In static member function `static double
Random::paretoII(double, double)':
tools/random.h:60: error: `paretoII' undeclared (first use this function)
tools/random.h: In static member function `static double Random::normal(double,
double)':
tools/random.h:61: error: `normal' undeclared (first use this function)
tools/random.h: In static member function `static double
Random::lognormal(double, double)':
tools/random.h:62: error: `lognormal' undeclared (first use this function)
tools/random.cc: In function `long int random()':
tools/random.cc:52: error: new declaration `long int random()'
tools/rng.h:259: error: ambiguates old declaration `int random()'
tools/random.cc: In function `long int random()':
tools/random.cc:53: error: `printf' undeclared (first use this function)
tools/random.cc: At top level:
tools/rng.h:129: warning: `void set_package_seed(const long unsigned int*)'
declared `static' but never defined
tools/rng.h:311: warning: `double next_seed_[6]' defined but not used
tools/rng.h:328: warning: `RNG*default_' defined but not used
make: *** [tools/random.o] Error 1

knudfl 03-31-2010 12:16 PM

Post # 25 : One error only ( so far ) :
Quote:

config.h:60:19:tclcl.h: No such file or directory
Be aware, that this LEACH-Makefile was written for
a completely different set of paths ..
(not all paths point to a known ns-allinone path) :
config.h , line 60 : #include <tclcl.h>

Which means searching in the default search path = /usr/ .
I am always installing otcl + tclcl to /usr/ :
cd otcl-1.13/ &&
./configure --prefix=/usr --enable-release --enable-devel
&& make && sudo make install
cd ../tclcl-1.19/ &&
./configure --prefix=/usr --enable-release --enable-devel
&& make && sudo make install .

sudo apt-get remove tcl8.5-dev tk8.5-dev
sudo apt-get install tcl8.4-dev tk8.4-dev
.. which provides the essential tcl / tk files in /usr/ .
( You may already have this tcl / tk in place.)
.....

elzohrry2006 04-05-2010 05:13 PM

can any one compress the working directory of ns2.27 with leach and upload it for us

emtarik05 wrote :
Quote:

I modified MIT LEACH to work on NS2.34 ubuntu 9.10
its ok thank you.
please tell us how or upload the patcy

thanks

elzohrry2006 04-06-2010 07:12 AM

how can use trace file of leach protocol ?

does any one have Awk script for it ?

thanks

knudfl 04-06-2010 01:09 PM

@elzohrry2006 , welcome to LQ.

ns2 trace : Please Google e.g. .. using trace file ns2 ..
The first hit is :
http://nsnam.isi.edu/nsnam/index.php/NS-2_Trace_Formats
I don't know how to run a trace file. Start a new thread,
if you want to run a file.tr. Do not mention awk, then
you will most likely get no answers.
Quote:

compress the working directory of ns2.27 with leach and upload it
I can upload these to an email : mit.tar.gz , LEACH-Makefile ,
and the compiled binary "ns" , alias ns227 , alias ns227LEACH
from ns-2.27 . All objects are compiled into that binary.
The other "50 MB" are examples, etc. , which you already have.
But why not compile it yourself. It's easy. But please tell,
which Linux, you are using : And get instructions.
Other info : LQ Search → 'Tag Name' = leach ((and = ns227)).
http://www.linuxquestions.org/questions/search.php
.....

omegabullit 04-06-2010 02:48 PM

Thanks again for all the help everyone. I solved the last problem knudfl, except now I've got a new one. Upon making the PATH corrections in the makefile, it went through and got pretty far before reaching the following error:

Quote:

/usr/bin/ld: cannot find -lintl
collect2: ld returned 1 exit status
make: *** [ns] Error 1
I've tried searching around, and tried installing a few packages others suggested might contain what I need, but to no avail. Any tips?

knudfl 04-06-2010 05:01 PM

Post # 30 , @ omegabullit.
Well, I don't know, why I didn't miss any ' libintl.so ' for
ns-2.27 on Ubuntu. And no libintl at all is available, it seems.
A few Linux include a libintl package with libintl.so.X.x.x ,
and a 'gettext-devel' package with the link libintl.so , etc.

The option, I can find for adding the files, is to rebuild the original
gettext source, Ubuntu http://packages.ubuntu.com/source/jaunty/gettext

http://archive.ubuntu.com/ubuntu/poo...17.orig.tar.gz
>> gettext_0.17.orig.tar.gz

cd gettext-0.17/ &&
./configure --prefix=/usr/ --with-included-gettext --enable-shared
&& make && sudo make install
.....
( Or use a --prefix/home/'name'/<result> , cp libintl.so.8.0.2
to /usr/lib/ , and create the links, libintl.so , libintl.so.8 ,
to libintl.so.8.0.2 .)

elzohrry2006 04-06-2010 11:25 PM

can any one give us simple example of leach protocol

the ./test work with me
but i open the script file wireless-demo-csci694.tcl
the protocol is
set opt(adhocRouting) DSDV
not leach

thanks

knudfl 04-09-2010 03:34 AM

Post # 32 @elzohrry2006

I guess, you can just Google .. example leach protocol ns2 ..
and find e.g. http://ns2.blogspot.com/

With those 1,880 hits, you will probably find a solution.
.....

maunik 04-10-2010 01:52 AM

hii sir
i complete install leach protocol in ns 2.27..
but after i seen in root/ns-allinone-2.27/ns2.27/mit/leach_sims/leach.err
following error occured
couldn't read file "/mit/rca/ns-ranode.tcl": no such file or directory
while executing
"source.orig /mit/rca/ns-ranode.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source $env(RCA_LIBRARY)/ns-ranode.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 9)
invoked from within
"source.orig mit/uAMPS/sims/uamps.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source mit/uAMPS/sims/uamps.tcl"
(file "tcl/mobility/leach.tcl" line 18)
invoked from within
"source.orig tcl/mobility/leach.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source tcl/mobility/$opt(rp).tcl"
(file "tcl/ex/wireless.tcl" line 187)


i dont know whts is this error ?

knudfl 04-11-2010 05:11 AM

Post # 34
Quote:

... in root/ns-allinone-2.27/ns2.27/mit/leach_sims/leach.err
following error occured
couldn't read file "/mit/rca/ns-ranode.tcl": no such file or ..
while executing
"source.orig /mit/rca/ns-ranode.tcl"
What do you mean by " root/ns-allinone-2.27 "
Wrong location ? /home/"name"/<dir>/ns-allinone-2.27 is default.
And what is "source.orig<space>/mit/.." ? ? One space too many ?
Or executed from a wrong location.

The missing file ( which causes the error = missing ) is here :
ns-allinone-2.27/ns-2.27/mit/rca/ns-ranode.tcl
.....

maunik 04-12-2010 12:17 AM

hii sir
file at
ns-allinone-2.27/ns-2.27/mit/rca/ns-ranode.tcl
is present ..
also error occured ...

sahel_s 04-15-2010 10:45 AM

runing leach algorithm on ns2.35 ubuntu 8.04
 
Quote:

Originally Posted by emtarik05 (Post 3905507)
I modified MIT LEACH to work on NS2.34 ubuntu 9.10
its ok thank you.

hi

i installed ns2.35 on ubuntu8.04 lts Desktop edition.
and now i want tu run leach algorithm on it.
i dont know what should i do,
please tell me the steps of runnin leach algorithm.and send me the url of everything that i have to download it or email them for me(sahel_652003@yahoo.com)

thx

maunik 04-15-2010 01:04 PM

@knudfl
sir
please give me the proper step for install leach protocol in ns 2.27..
urgently
thanks you...

knudfl 04-15-2010 01:59 PM

@ sahel_s : Welcome to LQ. . :) .. Either contact @emtarik05
http://www.linuxquestions.org/questi...ember&u=516518
for the "ns-2.34 method", or use ns-allinone-2.27 ...
... please read all the LEACH treads ...
http://www.linuxquestions.org/questi...atch-791222/#2
http://www.linuxquestions.org/questi...10-a-782356/#3

General install instructions are in "ns2leach.pdf"
http://www.linuxquestions.org/questi...2-27-a-785379/
post # 3, or you can easily find it with Google.


Post # 38 @ maunik,
please see the above link(s) ns2leach.pdf etc.
http://www.linuxquestions.org/questi...0&d=1264710405
.....

sahel_s 04-16-2010 07:25 AM

dear knudf
as i told you,i read the posts,but finalyy i decide to install ns2.27 by using steps which i found them in posts(http://cypress.tistory.com/entry/ns2-227-ubuntu)
but in step 1,part3,it gives me this problem:
"~$ wget http://www.tekno.chalmers.se/~yushen...7-gcc410.patch
--05:10:27-- http://www.tekno.chalmers.se/~yushen...7-gcc410.patch
=> `ns-2.27-gcc410.patch'
Resolving www.tekno.chalmers.se... 129.16.30.200
Connecting to www.tekno.chalmers.se|129.16.30.200|:80... failed: Connection refused.
"
so now ,what shoud i do?how can i download the Patch for compiling NS-2.27 with GCC 4.1.x: ns-2.27-gcc410.patch?
please help me.

best regards

knudfl 04-16-2010 12:31 PM

1 Attachment(s)
The " mit.tar.gz " link is up again
http://www.internetworkflow.com/down...ach/mit.tar.gz
http://www.internetworkflow.com/downloads/ns2leach/

Found it here today http://ranlog.blogspot.com/
http://ranlog.blogspot.com/search/label/LEACH
... May be these instructions will do too.

The http://norae.tistory.com/67 link is also working today:
'ns-2.27-gcc410.patch' ( Never had that luck before ! )


And by the way, all files are always available from
http://www.pudn.com ? ? , also the 'ns-2.27-gcc410.patch' ?
but come with a price, $ X.xx .
http://en.pudn.com/login.asp ( Unless you upload some (new) code.)
http://en.pudn.com/search_db.asp?key...7-gcc410.patch
http://www.pudn.com/downloads227/sou...il1067570.html
.....

WSNs 04-19-2010 02:07 PM

Thanks all,

I am new in ns-2 and I want to run LEACH. Actually, My OS is Ubuntu 9.10.

MY question is: Should I install ns-2.34 then install ns-2.27 I am confused about what is written in different #posts?

Can you give me clear steps to run leach on ubuntu 9.10?

Thanks alot

WSNs 04-19-2010 03:18 PM

LEACH on ns2.34
 
Quote:

Originally Posted by emtarik05 (Post 3905507)
I modified MIT LEACH to work on NS2.34 ubuntu 9.10
its ok thank you.

Hi emtarik,

I need to run LEACH on my ns-2.34. plz send my steps and any files needed to run it

Kind Regards,
Naif

WSNs 04-19-2010 03:20 PM

thanks alot

zeost 04-19-2010 03:21 PM

ns_2.35
 
I need help for run "leach algorithm on ns_2.35".plz

knudfl 04-20-2010 04:23 AM

@ WSNs, # 42, welcome to LQ. Suggest: delete your 'email address'.
Email addresses displayed on the internet are used by spammers.
The "Send email to WSNs" is already present in the WSNs Menu.
....... Please do not write three posts for one short message.
Better use the 'Edit' button instead.

Please read LQ threads with a 'leach' Tag.
LQ Search → 'Tag Name' = leach
Ubuntu cannot compile old tcl tk otcl tclcl. Replace with versions
from ns-allinone-2.34 and / or make links as described. The script
'install' will use 'old names' only. Hence the 8.4.5=>8.4.14 etc. links.

LQ Rules > > sms, chatspeak, shorthand like plz/PLZ: not allowed.

@ zeost, # 45, welcome to LQ. The term ' ns_2.35". ' is unknown.
Google will tell. Do you mean ns-allinone-2.34? Be precise, please.
EDIT : Found ns-allinone-2.35-RC3.tar.gz, 'release candidate 3'.
And please read the 6 leach threads. → Lots of info.

http://linuxsilo.net/docs/smart-questions_en.html
.....

btnaveen 04-21-2010 09:51 AM

How to run LEach protocol in ns2.34..

knudfl 04-22-2010 12:06 AM

Post # 47 @ btnaveen : You don't use ns-2.34 for leach.
'ns-allinone-2.27' is to be used for that. And g++ 3.3.x.

Just read all the above posts, to see how.
And welcome to LQ ....... :) ..
..

knudfl 04-22-2010 06:44 AM

Post # 40, @ sahel_s : about the ns-2.27-gcc410.patch ..

I don't think it works. And when you anyway have to use
a "compat" gcc, g++ : There is no big difference installing
( or using ) version 3.3.x instead of version 4.1.x.

.............. 'g++ 3.3.x' works, we know that for sure.
..

WSNs 04-22-2010 10:22 AM

Ubuntu 9.10 with ns2.27
 
Hi all,

In my Ubuntu 9.10 I remove gcc-4.0 and g++-4 then I install gcc-3.3 and g++ and every thing is ok. I install ns-2.27 and its work But after I do modifications to work with LEACH and try to make ns-2.27 it gives me this error:
--------------------------------------
--------------------------------------
Code:

for i in indep-utils/cmu-scen-gen/setdest indep-utils/webtrace-conv/dec indep-utils/webtrace-conv/epa indep-utils/webtrace-conv/nlanr indep-utils/webtrace-conv/ucb; do ( cd $i; make all; ) done
make[1]: Entering directory `/home/naif/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/naif/ns-allinone-2.27/ns-2.27/indep-utils/cmu-scen-gen/setdest'
make[1]: Entering directory `/home/naif/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/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/dec'
make[1]: Entering directory `/home/naif/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/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/epa'
make[1]: Entering directory `/home/naif/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/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/nlanr'
make[1]: Entering directory `/home/naif/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/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/ucb'

--------------------------------------
Can you help me to solve this error?

Thanck you.


All times are GMT -5. The time now is 06:56 PM.