LinuxQuestions.org
Help answer threads with 0 replies.
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 05-11-2011, 08:19 AM   #31
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 179

Rep: Reputation: 261Reputation: 261Reputation: 261

Please see my reply in Post #29
 
Old 05-11-2011, 08:39 AM   #32
helyos
LQ Newbie
 
Registered: May 2011
Posts: 28

Rep: Reputation: 3
Hi there,

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.
 
Old 05-11-2011, 12:38 PM   #33
leminh1009
LQ Newbie
 
Registered: May 2011
Posts: 4

Rep: Reputation: 0
Hi MayTamer,

I set up successfully ns2 and leach but I've run ./test and I can't find leach.out. Could you please advise me this problem ?

Quote:
oot@bt:~/ns-allinone-2.34/ns-2.34# ./test
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
NS EXITING...
root@bt:~/ns-allinone-2.34/ns-2.34#
 
Old 05-11-2011, 01:54 PM   #34
helyos
LQ Newbie
 
Registered: May 2011
Posts: 28

Rep: Reputation: 3
leminh1009, can you help me with my issue? please
 
Old 05-11-2011, 03:50 PM   #35
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 179

Rep: Reputation: 261Reputation: 261Reputation: 261
Quote:
Originally Posted by leminh1009 View Post
Hi MayTamer,

I set up successfully ns2 and leach but I've run ./test and I can't find leach.out. Could you please advise me this problem ?

Quote:
oot@bt:~/ns-allinone-2.34/ns-2.34# ./test
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
NS EXITING...
root@bt:~/ns-allinone-2.34/ns-2.34#
look at the /mit/leach_sims/ directory in your ns-2.34 folder. leach.out and all the other simulation results should be there
 
1 members found this post helpful.
Old 05-12-2011, 04:55 AM   #36
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
@ helyos, post # 32 : Welcome to LQ.

You can have as many compilers as you want, installed at the same time.
Installing g++-4.2 : Read post # 2.

And g++-4.3 : Must be manually installed. It's an Ubuntu Lucid package :
http://packages.ubuntu.com/lucid/g++-4.3

Use with e.g.: export CC=gcc-4.3 CXX=g++-4.3 && ./install

..
 
Old 05-12-2011, 07:03 AM   #37
helyos
LQ Newbie
 
Registered: May 2011
Posts: 28

Rep: Reputation: 3
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
How can i fix it?

Last edited by helyos; 05-12-2011 at 08:51 AM.
 
Old 05-12-2011, 10:22 AM   #38
leminh1009
LQ Newbie
 
Registered: May 2011
Posts: 4

Rep: Reputation: 0
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.

Could you please help me solve this problem?

Thanks in advance,
 
Old 05-12-2011, 11:30 AM   #39
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
#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.


..
 
Old 05-12-2011, 11:50 AM   #40
helyos
LQ Newbie
 
Registered: May 2011
Posts: 28

Rep: Reputation: 3
Quote:
Originally Posted by knudfl View Post
Another thing : Ubuntu 11.04 is 'worst choice' for ns-allinone-2.34/.
Suggest : Use the 'Long Term Supported' Ubuntu 10.04.


..
Ok, Thanks. I will install Ubuntu 10.04 and i will try to do a fresh install of ns2 on it.
 
Old 05-12-2011, 04:23 PM   #41
helyos
LQ Newbie
 
Registered: May 2011
Posts: 28

Rep: Reputation: 3
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

I am stucked when i enter $ make:

Code:
rares@ubuntu:/opt/ns-allinone-2.34/ns-2.34$ make
g++-4.3 -c -Wall -Wno-write-strings  -DTCP_DELAY_BIND_ALL -DNO_TK -DTCLCL_CLASSINSTVAR  -DNDEBUG -DLINUX_TCP_HEADER -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_13 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCLINT_H -DHAVE_TCL_H  -DHAVE_CONFIG_H -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=std -DUSE_SINGLE_ADDRESS_SPACE -Drng_test -DMIT_uAMPS  -I. -I. -I/opt/ns-allinone-2.34/tclcl-1.19 -I/opt/ns-allinone-2.34/otcl -I/opt/ns-allinone-2.34/include -I/opt/ns-allinone-2.34/include -I/opt/ns-allinone-2.34/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./diffserv -I./satellite -I./wpan -I./mit/rca -I./mit/uAMPS -o tools/random.o tools/random.cc
make: g++-4.3: Command not found
make: *** [tools/random.o] Error 127
knudfl please help me. thank you in advance!
 
Old 05-12-2011, 11:11 PM   #42
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 179

Rep: Reputation: 261Reputation: 261Reputation: 261
Hi,

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 View Post
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.

Could you please help me solve this problem?

Thanks in advance,
 
Old 05-13-2011, 02:25 AM   #43
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
#41, @helyos : No g++-4.3 unless you install it : Like all other prerequisites.


sudo apt-get install g++ g++-4.3 autoconf automake libtool \
libx11-dev libxmu-dev libxmu-headers libxt-dev


cd ns-allinone-2.34/ && export CC=gcc-4.3 CXX=g++-4.3 && ./install

..

Last edited by knudfl; 05-13-2011 at 08:10 AM.
 
Old 05-13-2011, 05:07 AM   #44
helyos
LQ Newbie
 
Registered: May 2011
Posts: 28

Rep: Reputation: 3
@ knudfl When i have installed ns2 i have followed this http://www.anand-iyer.com/blog/?p=22 .

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.
What should i do next? Reinstall it again?

Last edited by helyos; 05-13-2011 at 05:35 AM.
 
Old 05-13-2011, 08:16 AM   #45
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
#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.)
 
  


Reply

Tags
leach, leach-deepa#774, leach-warning50, 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


All times are GMT -5. The time now is 12:06 AM.

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