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.
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.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
@ 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.)
.....
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 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:areto(double,
double)':
tools/random.h:59: error: `pareto' undeclared (first use this function)
tools/random.h: In static member function `static double
Random:aretoII(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
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
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.)
.....
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
@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
.....
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.