how to integrate the "Resource/Energy" leach class into NS-2.34?
Linux - SoftwareThis 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
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 really a beginner and for a school project I have to make a simulation for LEACH protocol in ns.
I have installed ns-allinone-2.34 on Ubuntu 11.04 and now i think i have to add the LEACH patch to ns. As i read here there are some steps to do but the problem is that i have installed "gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) ".
Can someone please help me with the exact steps for this version of gcc complier.
Thank you in advance.
Awaiting for your early reply.
Thank you knudfl,
I have installed g++-4.2 and i have followed post #7 and at step 6:
6. Edit both “Makefile” & “Makefile.in” as following: CC = gcc-4.2
CPP = g++-4.2
Then when i gave ./configure it gave me :
Code:
checking for tclsh8.4.18... no
checking for tclsh8.4... /usr/bin/tclsh8.4
checking for tk.h... -I../tk8.4.18/generic
checking for libtk8.4... -L/usr/lib -ltk8.4
checking for tk.tcl... ../tk8.4.18/library
checking for otcl.h... -I../otcl-1.13
checking for libotcl1.13... -L/usr/lib -lotcl
checking for tclcl.h... -I../tclcl-1.19
checking for libtclcl... no
checking for tcl2c++... /usr/bin
configure: error: Installation of tcl seems incomplete or can't be found automatically.
Please correct the problem by telling configure where tcl is
using the argument --with-tcl=/path/to/package
(perhaps after installing it),
or the package is not required, disable it with --with-tcl=no.
If i gave
rares@ubuntu:/opt/ns-allinone-2.34/ns-2.34$ ./configure --with-tcl=/usr/share/tcltk/
:
Code:
checking if STL works with namespace std... yes
checking should use STL... yes
checking for tcl.h... no
checking for tclInt.h... no
checking for libtcl8.4... no
checking for init.tcl... no
checking for http.tcl... no
checking Tcl http.tcl library... configure: error: Couldn't find http.tcl in /http /http2.4 /http2.3 /http2.1 /http2.0 /http1.0
As previous, when I've been running ./test and I reached leach.out as following path: /root/ns-allinone-2.34/ns-2.34/ns-234-leach/mit/leach_sims but no result in it.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517
Rep:
#37, @ helyos : "" ... have followed post #7 and at step 6: ""
You mean post # 5 ? Post #5 assumes a working ns-allinone-2.34/.
cd ns-allinone-2.34/ && export CC=gcc4.2 CXX=g++-4.2 && ./install
( If you have built ns-allinone-2.34/ to another location, it cannot be reused.
You will have to start from scratch.)
Another thing : Ubuntu 11.04 is 'worst choice' for ns-allinone-2.34/.
Suggest : Use the 'Long Term Supported' Ubuntu 10.04.
Pfff.. now I am more closer to the end. So i installed the 'Long Term Supported' Ubuntu 10.04. In staled ns2 into the opt directory.
And now i passed from ./configure
Ok .. try running leach_test alone. See if the output is created.
( You have to manually create the folder leach_sims )
Once you run leach_test, in \mit\leach_sims\ folder, open leach.err.
Do you have any error messages in it ?
Quote:
Originally Posted by leminh1009
Hi everyone,
As previous, when I've been running ./test and I reached leach.out as following path: /root/ns-allinone-2.34/ns-2.34/ns-234-leach/mit/leach_sims but no result in it.
sudo apt-get install build-essential autoconf automake libxmu-dev gcc-4.3 was issued.
./install was issued too.
---------------------------
Ok so i have tried your way but failed at /install
it gave me :
Code:
* Build tcl8.4.18
============================================================
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... gcc4.3
checking whether the C compiler works... no
configure: error: in `/opt/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.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517
Rep:
#44, @helyos.
Please do : sudo apt-get install g++ g++-3.4
I.e. the g++ components are required to have a working gcc(-any-version)
Quote:
checking for gcc... gcc4.3
There is a missing hyphen ( - ) : It's gcc-3.4
A good idea before compiling is to do these checks :
1) ls /usr/bin/gcc* 2) ls /usr/bin/g++*
.. to verify the compiler spelling. ("gcc34" is commonly used too.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.