LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-12-2013, 01:46 PM   #556
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 185

Rep: Reputation: 268Reputation: 268Reputation: 268

hi Knudfl (#551),

Let me check .. It was over 1.5 yrs ago that I made the changes ... Let me see if I have a copy on my backup.
If so, I'll mail or google drive share them ... Ok ?
But need some time to dig up the old backups.

Quote:
Originally Posted by knudfl View Post
# 550 .

Yes we know that, and I have referred several times to your original post,
where you told about ns-2.35.
And advised the members to contact you for the ns235 patch.

Is it possible that you still have the files ?
It would be very nice if you could upload the
"patch package" / {the edited ns235 files}.

Alternatively the edited ns-2.35/ : Can be made to about 12 MB,
with 'make clean', and with the "tcl/test/" folder deleted.
I.e. as a bzip2 compressed package "leach-ns235-patched.tar.bz2".

You can also mail the files to me, and I will upload to 'Google Drive'.

-
 
1 members found this post helpful.
Old 11-12-2013, 01:49 PM   #557
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 185

Rep: Reputation: 268Reputation: 268Reputation: 268
Hi Mhmmahdi, (#554),

For the last part of your error (i.e., the format_rca error), please refer to this link:
http://abdusyarif.wordpress.com/2012...-step-by-step/
(look at #7)


Quote:
Originally Posted by mhmdmahdi View Post
hi all, i'm trying to install leach for my research.
i'm using ubuntu 12.04..

when i used "make" command i got an error just like post #26 and solved the error with the solution given by our friend deepa_2111 on post #29.
but when i used "make" command again, i got another error.



can anybody help me how to solve this problem?
thanks in advance.
 
1 members found this post helpful.
Old 11-12-2013, 11:13 PM   #558
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Rep: Reputation: 22
Hi, knudfl..
thanks for the response..

i'm using ubuntu 12.04 i686 and already install gcc 4.4 and g++ 4.4.
is that new patch for LEACH you gave me on that link? also include pegasis routing?

i also tried to export gcc & g++ to use gcc 4.4 and g++4.4 as default compiler but got error when hit "./install" command

Quote:
mhmdmahdi@mhmdmahdi:~/ns-allinone-2.34$ export CC=gcc44 CXX=g++44
mhmdmahdi@mhmdmahdi:~/ns-allinone-2.34$ ./install
============================================================
* Testing for Darwin (OS X) environment
============================================================
============================================================
* Testing for Cygwin environment
============================================================
Cygwin not detected, proceeding with regular install.
============================================================
* Testing for FreeBSD environment
============================================================
FreeBSD not detected
============================================================
* Build XGraph-12.1
============================================================
loading cache ./config.cache
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... missing
checking if malloc debugging is wanted... no
checking for gcc... (cached) 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... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking how to run the C preprocessor... (cached) gcc -E
checking for X... (cached) libraries , headers
checking for dnet_ntoa in -ldnet... (cached) no
checking for dnet_ntoa in -ldnet_stub... (cached) no
checking for gethostbyname... (cached) yes
checking for connect... (cached) yes
checking for remove... (cached) yes
checking for shmat... (cached) yes
checking for IceConnectionNumber in -lICE... (cached) yes
checking for float.h... (cached) yes
checking for limits.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for unistd.h... (cached) yes
checking for strcasecmp... (cached) yes
creating ./config.status
creating Makefile
creating autoconf.h
autoconf.h is unchanged
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -c dialog.c
dialog.c: In function ‘make_msg_box’:
dialog.c:780:5: warning: passing argument 2 of ‘getline’ from incompatible pointer type [enabled by default]
/usr/include/stdio.h:675:20: note: expected ‘size_t * __restrict__’ but argument is of type ‘char *’
dialog.c:780:5: error: too few arguments to function ‘getline’
/usr/include/stdio.h:675:20: note: declared here
dialog.c: In function ‘getline’:
dialog.c:893:9: error: argument ‘lptr’ doesn’t match prototype
/usr/include/stdio.h:675:20: error: prototype declaration
dialog.c:899:1: error: number of arguments doesn’t match prototype
/usr/include/stdio.h:675:20: error: prototype declaration
make: *** [dialog.o] Error 1
Can not create xgraph; But xgraph is an optional package, continuing...
============================================================
* Build CWeb
============================================================
Making cweb
gcc -g -c -o ctangle.o ctangle.c
ctangle.w:75:12: warning: conflicting types for built-in function ‘strlen’ [enabled by default]
gcc -g -DCWEBINPUTS=\"/usr/local/lib/cweb\" -c common.c
common.w:1409:12: warning: conflicting types for built-in function ‘strlen’ [enabled by default]
common.w: In function ‘fatal’:
common.w:1176:1: warning: format not a string literal and no format arguments [-Wformat-security]
gcc -g -o ctangle ctangle.o common.o
gcc -g -c -o cweave.o cweave.c
cweave.w:79:12: warning: conflicting types for built-in function ‘strlen’ [enabled by default]
cweave.w: In function ‘print_cat’:
cweave.w:1739:1: warning: format not a string literal and no format arguments [-Wformat-security]
gcc -g -o cweave cweave.o common.o
ln: failed to create symbolic link `cweave': File exists
ln: failed to create symbolic link `ctangle': File exists
============================================================
* Build Stanford GraphBase
============================================================
Making sgb
gcc44 -g -I/usr/local/sgb/include test_io.c gb_io.o -o test_io
make: gcc44: Command not found
make: *** [test_io] Error 127
Unable to create sgb library, but it's optional, so continuing...
============================================================
* Build GT-ITM
============================================================
gcc -I../include -L../lib -DFBSD -o ../bin/itm itm.o geog.o ts.o dfs.o -lm -lgb
gcc -I../include -L../lib -DFBSD -o ../bin/sgb2alt sgb2alt.o -lm -lgb
gcc -I../include -L../lib -DFBSD -o ../bin/edriver edriver.o eval.o -lm -lgb
gt-itm has been installed successfully.
gcc -I../include -L../lib -o ../bin/sgb2comns sgb2comns.o -lm -lgb
gcc -I../include -L../lib -o ../bin/sgb2hierns sgb2hierns.o -lm -lgb
gcc -I../include -L../lib -o ../bin/sgb2ns sgb2ns.o -lm -lgb
sgb2ns has been installed successfully.
============================================================
* Build zlib
============================================================
Building static library libz.a version 1.2.3 with gcc44.
Checking for unistd.h... No.
Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()
Checking for snprintf() in stdio.h... No.
WARNING: snprintf() not found, falling back to sprintf(). zlib
can build but will be open to possible buffer-overflow security
vulnerabilities.
Checking for return value of sprintf()... No.
WARNING: apparently sprintf() does not return a value. zlib
can build but will be open to possible string-format security
vulnerabilities.
Checking for errno.h... No.
Checking for mmap support... No.
make: Nothing to be done for `all'.
Zlib has been installed successfully.
============================================================
* Build tcl8.4.18
============================================================
rm -f *.a *.o libtcl* core errs *~ \#* TAGS *.E a.out \
errors tclsh tcltest lib.exp Tcl
cd dltest ; make clean
make[1]: Entering directory `/home/mhmdmahdi/ns-allinone-2.34/tcl8.4.18/unix/dltest'
rm -f *.o config.cache config.log config.status
rm -f lib.exp ../dltest.marker
rm -f *.so
make[1]: Leaving directory `/home/mhmdmahdi/ns-allinone-2.34/tcl8.4.18/unix/dltest'
rm -rf Makefile config.status config.cache config.log tclConfig.sh \
SCRPtcl.* prototype *.plist Tcl.framework
cd dltest ; make distclean
make[1]: Entering directory `/home/mhmdmahdi/ns-allinone-2.34/tcl8.4.18/unix/dltest'
rm -f *.o config.cache config.log config.status
rm -f lib.exp ../dltest.marker
rm -f *.so
rm -f Makefile
make[1]: Leaving directory `/home/mhmdmahdi/ns-allinone-2.34/tcl8.4.18/unix/dltest'
configure: WARNING: unrecognized options: --enable-gcc
checking whether to use symlinks for manpages... no
checking whether to compress the manpages... no
checking whether to add a package name suffix for the manpages... no
checking for gcc... gcc44
checking whether the C compiler works... no
configure: error: in `/home/mhmdmahdi/ns-allinone-2.34/tcl8.4.18/unix':
configure: error: C compiler cannot create executables
See `config.log' for more details
tcl8.4.18 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.
Quote:
Originally Posted by knudfl View Post
Post # 554, @mhmdmahdi : Welcome to LQ.

Looks like you are using the wrong compiler.

About LEACH : Latest is exidus-pegasis-leach-ns234-patch.2.tar.gz
https://drive.google.com/file/d/0B7S...it?usp=sharing

Info http://www.linuxquestions.org/questions/tags/pegasis/
( Pegasis is first mentioned in post # 289 :
http://www.linuxquestions.org/questi...68/page20.html )

Using, Ubuntu example :
Please start from scratch with $ tar xvf ns-allinone-2.34.tar.gz
$ cd ns-allinone-2.34/ && tar xvf exidus-pegasis-leach-ns234-patch.2.tar.gz
$ export CC=gcc41 CXX=g++41 && ./install

** ** Which Ubuntu 12.04 are you using ? i686 ? x86_64 ? : $ uname -m

-

Last edited by mhmdmahdi; 11-12-2013 at 11:43 PM.
 
Old 11-12-2013, 11:21 PM   #559
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Rep: Reputation: 22
Hi deepa_2111,
thanks for your response.

i followed the guide on that link and have done all instructed on step #7
but after i hit "make" command again, i got another format_rca error.

Quote:
Originally Posted by deepa_2111 View Post
Hi Mhmmahdi, (#554),

For the last part of your error (i.e., the format_rca error), please refer to this link:
http://abdusyarif.wordpress.com/2012...-step-by-step/
(look at #7)
 
Old 11-20-2013, 01:14 AM   #560
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Rep: Reputation: 22
still got the problem here, please help
 
Old 11-20-2013, 02:51 AM   #561
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,383

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
# 560 .

Why don't you use gcc41 / g++41 as mentioned in #555 ?

Then there are no issues at all.
Just plain $ export CC=gcc41 CXX=g++41 && ./install
.. when it's a 32bits Ubuntu 12.04 .

-
 
Old 11-20-2013, 03:09 AM   #562
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Rep: Reputation: 22
Quote:
Originally Posted by knudfl View Post
# 560 .

Why don't you use gcc41 / g++41 as mentioned in #555 ?

Then there are no issues at all.
Just plain $ export CC=gcc41 CXX=g++41 && ./install
.. when it's a 32bits Ubuntu 12.04 .

-
Thanks for helping.
Working on installing gcc 41 & g++ 41 now.
I'm complete noob, i have some question to ask.
Is there any depedencies problem when installing gcc 41 & g++ 41 on ubuntu 12.04?
And do i need to edit bashrc file to make those version of gcc & g++ working on ns?
 
Old 11-21-2013, 05:22 AM   #563
pmaurya070
LQ Newbie
 
Registered: Nov 2013
Posts: 2

Rep: Reputation: Disabled
downgarding GCC compiler did'nt work for removing warning in leach.out file:

Quote:
0: 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
condition.txt, leach.alive, leach.data, leach.energy, leach.err, leach.out, leach.save1, leach.save2, strartup.energy, and TDMSschedule.0.txt files generated successfully and all have data but leach.out have above mentioned warning.
please help...
Currently I am using Ubuntu 12.04 32 bit OS with NS-2.34 and gcc4.6

Last edited by pmaurya070; 11-21-2013 at 05:26 AM.
 
Old 11-21-2013, 09:32 AM   #564
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,383

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
# 562, @mhmdmahdi.
Quote:
Is there any depedencies problem when installing gcc 41 & g++ 41 on ubuntu 12.04 ?
Depends which "gcc-4.1.2" is is about. Is your OS i686 or x86_64 ? ?
Please show the output from $ uname -m <Enter>

Binary gcc/g++ .deb packages has "no dependencies".


Quote:
And do I need to edit bashrc file to make those version of gcc & g++ working on ns ?
No gcc / g++ requires editing anything in .bashrc .
Neither does any ns2 version.
Only if you have no permission to install 'ns' to /usr/local/bin/.
I.e. like a computer you use at University :
Then you have no administrative permissions, and may edit .bashrc .

-
 
Old 11-21-2013, 03:44 PM   #565
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Rep: Reputation: 22
Hello knudfl.
I'm using Ubuntu 12.04 i686 OS.

I saw your post here (post #47): http://www.linuxquestions.org/questi...532/page4.html

Can i use that guide to install gcc 41 & g++ 41 on my ubuntu 12.04?

Quote:
Originally Posted by knudfl View Post
# 562, @mhmdmahdi.

Depends which "gcc-4.1.2" is is about. Is your OS i686 or x86_64 ? ?
Please show the output from $ uname -m <Enter>

Binary gcc/g++ .deb packages has "no dependencies".



No gcc / g++ requires editing anything in .bashrc .
Neither does any ns2 version.
Only if you have no permission to install 'ns' to /usr/local/bin/.
I.e. like a computer you use at University :
Then you have no administrative permissions, and may edit .bashrc .

-
 
Old 11-22-2013, 01:43 PM   #566
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,383

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
# 565, @mhmdmahdi.

Ubuntu 12.04 - i686 , post #18 here :
http://www.linuxquestions.org/questi...022/page2.html

sudo dpkg -i gcc41-compat-4.1.2.ubu1204_i386.deb g++41-compat-4.1.2_i386.deb
.. Then reboot, and the new compiler can be used :

cd ns-allinone-2.3x/ && export CC=gcc41 CXX=g++41 && ./install


P.S. : If you want the updated version of LEACH :
Use "exidus-pegasis-leach-ns234-patch.2.tar.gz", ref. post #555.


-

Last edited by knudfl; 11-22-2013 at 01:48 PM.
 
Old 11-23-2013, 04:20 AM   #567
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Rep: Reputation: 22
thanks knudfl.
finally i have successfully running Leach simulation on ns 2.34.
from what i see, in simulation output provides information about what happens on simulation every 10 seconds. am i right?

have some questions:
how can i get an information about number of cluster formed, energy consumed by each node, node alive, and another usefull info from simulation each rounds?
i mean how can the simulation output updated per round, not per 10 seconds.

thanks for helping.

-------------- EDIT -----------------
on /ns-2.34/mit/leach_sims there are 2 leach.save (leach.save1 & leach.save2)
why there are 2 file of leach.file when i only run the simulation once? and the results are different.

leach.save1
Quote:
At 584.50000000006435:
Total Energy = 334.47633141687106
Total Data = 51407
Total Alive = 4

Simulation complete.
leach.save2
Quote:
At 331.6000000000069:
Total Energy = 273.21666940025437
Total Data = 35008
Total Alive = 4

Simulation complete.
After succesfully run the simulation for first time, i edit some .tcl file to remove "dst_" warning on leach.out
but when i tried to run the simulation again, it gaves me different result and its weird.

Quote:
At 1.0999999999999999:
Total Energy = 29863.937202448949
Total Data = 0
Total Alive = 4

Simulation complete.
restored the edited file as before, but no change on the simulation result.
tried to find the answers on previous pages and other threads, but have no idea how to solve it.
please, how to solve this problem?

Last edited by mhmdmahdi; 11-23-2013 at 06:58 AM.
 
Old 11-23-2013, 02:16 PM   #568
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,383

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
# 567, @mhmdmahdi.

That's a question for @deepa_2111.

I have no knowledge about the mentioned subject(s).


-
 
Old 11-23-2013, 02:36 PM   #569
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Rep: Reputation: 22
yups, thanks for your time knudfl.
now i'm waiting for deepa_2111 to answer my questions.
saw his profile and his last activity: 10 days ago
i need your help deepa_2111

btw i have another question knudfl, if i want to use a new update of leach for ns-2.34 (exidus-pegasis-leach-ns234-patch.2.tar.gz), do i need to remove previous leach simulation installed on my ns?
if don't, how can i used the simulation without affecting my previous leach?

Quote:
Originally Posted by knudfl View Post
# 567, @mhmdmahdi.

That's a question for @deepa_2111.

I have no knowledge about the mentioned subject(s).


-

Last edited by mhmdmahdi; 11-23-2013 at 02:37 PM.
 
Old 11-24-2013, 12:20 PM   #570
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 185

Rep: Reputation: 268Reputation: 268Reputation: 268
Hi mhmdmahdi,

A round = 20 sec (by default ). To change the settings, you need to modify the wireless.tcl file.

So anyway, if you take the statistics every 20 sec, it gives you the details per round.
Note though - the data is cumulative .. So, u need to subtract the previous round's data values to get the current round's total data packets received t the BS.

Quote:
Originally Posted by mhmdmahdi View Post
thanks knudfl.
finally i have successfully running Leach simulation on ns 2.34.
from what i see, in simulation output provides information about what happens on simulation every 10 seconds. am i right?

have some questions:
how can i get an information about number of cluster formed, energy consumed by each node, node alive, and another usefull info from simulation each rounds?
i mean how can the simulation output updated per round, not per 10 seconds.

thanks for helping.

-------------- EDIT -----------------
on /ns-2.34/mit/leach_sims there are 2 leach.save (leach.save1 & leach.save2)
why there are 2 file of leach.file when i only run the simulation once? and the results are different.

leach.save1


leach.save2


After succesfully run the simulation for first time, i edit some .tcl file to remove "dst_" warning on leach.out
but when i tried to run the simulation again, it gaves me different result and its weird.



restored the edited file as before, but no change on the simulation result.
tried to find the answers on previous pages and other threads, but have no idea how to solve it.
please, how to solve this problem?
 
  


Reply

Tags
leach, leach-warning50, ns2, ns2 ns234, pegasis


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
ns:"error when calling class OldSim"&tclsh:"invalid command+child process exits abn." shojaru Linux - Newbie 0 03-05-2009 04:23 AM
labview stopped at "init tmp resource files" on FC4 baosheng Linux - Software 2 09-28-2007 11:02 AM
ORiNOCO WLAN card not working - "failed to allocate resource" hauneboo Linux - Laptop and Netbook 1 11-29-2005 09:08 AM
What "kernel opts" allow PC to power down with "turning energy off"? kornerr Linux - General 1 03-10-2005 12:07 PM
nvidia insmod: "Device or resource busy" w/GeForce 4 MX KeithSpook Linux - Hardware 4 03-03-2004 12:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:48 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration