Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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++.
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
====================================================================
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
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.
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
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
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.)
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.