LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Closed Thread
 
Search this Thread
Old 01-31-2011, 04:23 AM   #151
sawyer
LQ Newbie
 
Registered: Jan 2011
Posts: 7

Rep: Reputation: 0

thanks for the reply but I didnt understand ur answer, please can you post specifically wat to do

Regards,
Sawyer
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-10-2011, 02:50 AM   #152
nirmalak
LQ Newbie
 
Registered: Feb 2011
Posts: 3

Rep: Reputation: 0
i am working n clustering can u brief out about the posts above i find it difficult to understand.... actually wat should we do to implement leach protocol... how to bind C++ code to a tcl code and how to run it
 
Old 02-11-2011, 02:21 AM   #153
sawyer
LQ Newbie
 
Registered: Jan 2011
Posts: 7

Rep: Reputation: 0
Answer

Hey,

First of all I like to get your idea clearly. What exactly you want to do. Whether you want to modify existing protocols or propose a new one.

LEACH is a clustering protocol. We have a code for LEACH for NS-2.27. No need for implementation.

C++ serves like the backend for Network simulator NS2. Tcl is used for creating nodes, establishing links between the nodes. That is parameters for simulation are written in Tcl.

C++ and Tcl are binded together and called Otcl. With Otcl we can call some classes from C++ programs to Tcl.

For clear understanding better u wiki, u have ample of material available on net for Tcl, Otcl and C++.

Regards,
Sawyer
 
Old 02-16-2011, 10:32 PM   #154
lilicharmaine
LQ Newbie
 
Registered: Feb 2011
Posts: 13

Rep: Reputation: 8
Hi

may I get the following source files from you, Thanks for help

mit.tar.gz + LEACH-Makefile-org

Last edited by lilicharmaine; 02-16-2011 at 11:27 PM.
 
Old 02-17-2011, 05:56 AM   #155
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,923

Rep: Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587
@lilicharmaine , post # 154 : Welcome to LQ. .. .. ..

The "old leach link" http://www.internetworkflow.com/downloads/ns2leach
seems to be down currently. I have uploaded the files to Google Docs.

All the links are in this LQ post :
http://www.linuxquestions.org/questi...each-862835/#4

Good luck !

..
 
Old 02-17-2011, 08:34 AM   #156
lilicharmaine
LQ Newbie
 
Registered: Feb 2011
Posts: 13

Rep: Reputation: 8
Hi knufl,

Thanks for your help I got all the files..
 
Old 02-17-2011, 10:40 AM   #157
lilicharmaine
LQ Newbie
 
Registered: Feb 2011
Posts: 13

Rep: Reputation: 8
Hi,

May I know where can I get the ns2.27-gcc410 patch file? I need it for ns2.27-allinone-tar.gz installation in Ubuntu 10.10, thanks
 
Old 02-17-2011, 11:13 AM   #158
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,923

Rep: Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587
Post # 157 : The ns-2.27-gcc410.patch is here (Google .. ns-2.27-gcc410.patch ..)
http://cfs3.tistory.com/upload_contr...7-gcc410.patch

But you may not have much luck with the patch.

The rather complicated build method, you were pointed to is used for a reason:
http://www.linuxquestions.org/questi...10-a-782356/#3

But who knows ? You could be that lucky with Ubuntu 10.10 ?

..
 
1 members found this post helpful.
Old 02-17-2011, 12:44 PM   #159
lilicharmaine
LQ Newbie
 
Registered: Feb 2011
Posts: 13

Rep: Reputation: 8
Hi knudlf,

Thanks a lot for your help, really appreciates it

I got the ns2.27-gcc410 patch file, but I cannot managed to install successful in ubuntu10.10.

But I did follow the instruction from post #3, when I reach the step of tk8.4-lastevent file patching,
it prompted me the following error, may I know what is the solutions for that?

====================================================================
run --> patch -p0 < tk-8.4-lastevent.patch
patching file generic/tk.h

error -->
Hunk #1 FAILED at 635
1 out of 1 hunk FAILED -- saving rejects to file generic/tk.h.rej
====================================================================
 
Old 02-17-2011, 01:15 PM   #160
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,923

Rep: Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587
Post # 159 , lilicharmaine.

'cd tk8.4.14/ && patch -p0 < tk-8.4-lastevent.patch'
1 out of 1 hunk FAILED : Can be ignored. Concerns mainly nam.
And nam is a seperate application : Any binary nam can be used.

When you have finished the build of ns-allinone-2.27 and the LEACH files,
you can do : sudo apt-get install nam
Installing nam before you have fished everything, may disturb your install:
The dependencies for nam ( libotcl1 tcl8.4 tk8.4 ) are slightly different
from the versions used to build ns-2.27.

..
 
Old 02-17-2011, 01:27 PM   #161
lilicharmaine
LQ Newbie
 
Registered: Feb 2011
Posts: 13

Rep: Reputation: 8
Hi knudfl,

Noted, thanks

when I ./install for ns-allinone-2.27, I got any error message as following:

Code:
============================================================
* Build OTcl-1.8
============================================================
No .configure file found in current directory
Continuing with default options...
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc-4.4
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc-4.4 accepts -g... yes
checking for gcc-4.4 option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C preprocessor... gcc-4.4 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking for main in -lXbsd... no
checking for socket in -lsocket... no
checking for gethostbyname in -lnsl... yes
checking for dcgettext in -lintl... no
checking for getnodebyname in -ldnet_stub... no
checking standard STL is available... no
checking for tcl.h... -I../tcl8.4.18/generic
checking for tclInt.h... -I../tcl8.4.18/generic
checking for libtcl8.4... -L../tcl8.4.18/unix -ltcl8.4
checking for init.tcl... ../tcl8.4.18/library
checking for http.tcl... ../tcl8.4.18/library/http
checking Tcl http.tcl library... yes
checking for tclsh8.4.18... no
checking for tclsh8.4... /home/shiayok/ns-allinone-2.27/bin/tclsh8.4
checking for tk.h... -I../tk8.4.18/generic
checking for libtk8.4... -L../tk8.4.18/unix -ltk8.4
checking for tk.tcl... ../tk8.4.18/library
checking for X11 header files
checking for X11 library archive
checking for XOpenDisplay in -lX11... yes
checking for XShmAttach in -lXext... yes
checking for ranlib... ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking system version (for dynamic loading)... Linux-2.6.35-22-generic
No explicit static compilation flag; setting V_STATIC to ""
checking for dlopen in -ldl... yes
checking for a BSD-compatible install... /usr/bin/install -c
configure: creating ./config.status
config.status: creating Makefile
rm -f libotcl.so otcl.o so_locations
gcc-4.4 -c -g -O2 -DNDEBUG -DUSE_SHM -fpic -I. -I/home/shiayok/ns-allinone-2.27/tk8.4.18/generic -I/home/shiayok/ns-allinone-2.27/tcl8.4.18/generic -I/home/shiayok/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/shiayok/ns-allinone-2.27/otcl-1.8/otcl.c:495: undefined reference to `__stack_chk_fail_local'
otcl.o: In function `Otcl_Init':
/home/shiayok/ns-allinone-2.27/otcl-1.8/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
otcl-1.8 make failed! Exiting ...
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems
=============================================================
May I know what caused these message prompted? or did I miss up
some steps? Thanks
 
Old 02-17-2011, 01:34 PM   #162
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,923

Rep: Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587
Post #159, continued answer :

.. And by the way, the 'ns-2.27-gcc410.patch' works OK with ns-allinone-2.27, no leach:
'patch < -p0 ns-2.27-gcc410.patch' outside the source ns-allinone-2.27/ .

cd ns-allinone-2.27/ && export CC=gcc-4.1 CXX=g++-4.1 && ./install

But when the LEACH files are added : make -f modified-leach-Makefile : Errors.
( Tested on Ubuntu 10.04 , 32bits.)

..

Last edited by knudfl; 02-17-2011 at 02:10 PM.
 
Old 02-17-2011, 02:08 PM   #163
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,923

Rep: Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587
Post # 161.

Are you quite sure, that all old tcl, tk, otcl, tclcl is gone ?
Renamed to back-? Moved away ? Deleted ?

All those should be replaced by the ns-allinone-2.34 versions.
Renamed or have links, that tells the old names to make the 'install'
file work. http://www.linuxquestions.org/questi...10-a-782356/#3

..
 
Old 02-17-2011, 02:26 PM   #164
lilicharmaine
LQ Newbie
 
Registered: Feb 2011
Posts: 13

Rep: Reputation: 8
Hi knudfl,

yup, very sure, because I followed exactly all the steps in post #3.
But in my ns-allinone-2.27 directory, I still can see all those old folders.

In the post #163, do you means even the unused old folders need to be deleted from the ns-allione-2.27 directory?
 
Old 02-17-2011, 03:14 PM   #165
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,923

Rep: Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587
Hi lilicharmaine.

Deleting is OK, usually I just rename to back-<name>.

I don't know, why you get that error.
I checked it immediately, when you asked : No errors with "otcl-1.13"
in Ubuntu 10.10, 64bits using the default compiler.
If it is right on the edge, that it will fail / not fail, then suggest :
Edit the otcl Makefile, Makefile.in to : CC = gcc-4.3
And may be tclcl-1.19/ : CC = gcc-4.3 , CPP = g++-4.3

Also required : sudo apt-get install g++-4.3

..
 
  


Closed Thread

Tags
leach, leach-ns227, ns2, ns227


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in simulating Black Hole Attack in AODV Protocol through NS2 in FC8 shyan Linux - Newbie 1 03-21-2009 05:28 AM
NS2 installation ds_priyaa Fedora 2 05-28-2008 02:23 AM
NS2 installation eby83 Linux - Newbie 2 06-11-2007 01:08 AM
ns2 installation pranoti Linux - Software 2 06-11-2007 12:45 AM
LXer: Interview with Bernard Leach (iPodLinux) LXer Syndicated Linux News 0 10-31-2006 11:33 AM


All times are GMT -5. The time now is 04:15 PM.

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