LinuxQuestions.org
Visit Jeremy's Blog.
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-05-2011, 10:37 AM   #16
magicbullet
LQ Newbie
 
Registered: May 2011
Posts: 6

Rep: Reputation: 0

Quote:
Originally Posted by knudfl View Post
@magicbullet, post # 12 : Welcome to LQ.

No gcc-4.3 for Ubuntu 11.04, but you can then use gcc-4.2.
( gcc-4.1 and gcc-3.4 (gcc-3.3) will usually work perfect too.

Add hardy to etc/apt/sources.list, as described in post # 2.
( sudo gedit etc/apt/sources.list ).


And then ..
sudo apt-get update && sudo apt-get install g++-4.2 gcc-4.2

..
I've tried that but failed with the following error:

============================================================
* 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... gcc-4.2
checking whether the C compiler works... no
configure: error: in `/home/wilson/Documents/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.

I did this: export CC=gcc-4.2 CXX=g++-4.2 && ./install

Before this, I have installed other gcc versions like 4.3, 3.3 but they all failed as well

It seems all the gcc versions cannot compile, i.e. "checking whether the C compiler works... no"
 
Old 05-05-2011, 10:49 AM   #17
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,519

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
@magicbullet, post # 16.

'sudo apt-get install g++ g++-4.2' , etc. etc.

GCC cannot be used for very much alone.
You will have to install the g++** for all versions :
g++ insures that the files required by gcc also will get installed.

EDIT : See post # 22

..

Last edited by knudfl; 02-26-2012 at 11:10 AM.
 
Old 05-05-2011, 10:58 AM   #18
magicbullet
LQ Newbie
 
Registered: May 2011
Posts: 6

Rep: Reputation: 0
Quote:
Originally Posted by knudfl View Post
@magicbullet, post # 16.

'sudo apt-get g++ g++-4.2' , etc. etc.

GCC cannot be used for very much alone.
You will have to install the g++** for all versions :
g++ insures that the files required by gcc also will get installed.
U mean I need to do: sudo apt-get install g++-4.2 gcc-4.2 ?
Anything else? Anyhow, by doing: sudo apt-get install g++-4.2 gcc-4.2, I still get the same error.

I also did the following:

sudo rm /usr/bin/gcc
sudo ln -s /usr/bin/gcc-4.2 /usr/bin/gcc
export CC=gcc-4.2 CXX=g++-4.2 && ./install

Same error
 
Old 05-05-2011, 11:21 AM   #19
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,519

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
#18
Quote:
... I need to do: sudo apt-get install g++-4.2 gcc-4.2 ?
Not really. No reason to write gcc-4.2. gcc** will always be installed
for dependency, when you type g++*.


But there are problems with the older compilers in Ubuntu 11.04.
Versions 3.3 , 3.4 , 4.2 don't work here either : Ubuntu 11.04, 64bits.

I will look for a solution.
And please tell, if you have a 64bits OS. The command : 'uname -a' will show.
 
Old 05-05-2011, 11:26 AM   #20
magicbullet
LQ Newbie
 
Registered: May 2011
Posts: 6

Rep: Reputation: 0
Quote:
Originally Posted by knudfl View Post
#18
Not really. No reason to write gcc-4.2. gcc** will always be installed
for dependency, when you type g++*.


But there are problems with the older compilers in Ubuntu 11.04.
Versions 3.3 , 3.4 , 4.2 don't work here either : Ubuntu 11.04, 64bits.

I will look for a solution.
And please tell, if you have a 64bits OS. The command : 'uname -a' will show.
Thanks! The command shows : 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux
 
Old 05-05-2011, 12:17 PM   #21
magicbullet
LQ Newbie
 
Registered: May 2011
Posts: 6

Rep: Reputation: 0
Quote:
Originally Posted by knudfl View Post
#18
Not really. No reason to write gcc-4.2. gcc** will always be installed
for dependency, when you type g++*.


But there are problems with the older compilers in Ubuntu 11.04.
Versions 3.3 , 3.4 , 4.2 don't work here either : Ubuntu 11.04, 64bits.

I will look for a solution.
And please tell, if you have a 64bits OS. The command : 'uname -a' will show.
I have tried with 4.3 . It solved the above problem. However, I got the following error:

/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
make: *** [tcl2c++] Error 1
tclcl-1.19 make failed! Exiting ...
 
Old 05-05-2011, 05:24 PM   #22
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,519

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
# 20-21.
Quote:
i686 i686 i386
That's a 32bits OS.


There seems to be a workaround for the 32bits Ubuntu 11.04 (Not 64bits) :
cd /usr/local/lib/ &&
sudo ln -s /lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so

cd /usr/local/include/ && sudo ln -s /usr/include/i386-linux-gnu/asm/

Works with : export CC=gcc-4.2 CXX=g++-4.2 && ./install
( 4.3 should be OK too. Where did you get the "4.3" ? )

..

Last edited by knudfl; 05-05-2011 at 05:29 PM.
 
Old 05-05-2011, 07:53 PM   #23
magicbullet
LQ Newbie
 
Registered: May 2011
Posts: 6

Rep: Reputation: 0
Quote:
Originally Posted by knudfl View Post
# 20-21.

That's a 32bits OS.


There seems to be a workaround for the 32bits Ubuntu 11.04 (Not 64bits) :
cd /usr/local/lib/ &&
sudo ln -s /lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so

cd /usr/local/include/ && sudo ln -s /usr/include/i386-linux-gnu/asm/

Works with : export CC=gcc-4.2 CXX=g++-4.2 && ./install
( 4.3 should be OK too. Where did you get the "4.3" ? )

..
Thanks. It works now!

Btw, how do I remove all the linkages, i.e. sudo ln -s /lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so and sudo ln -s /usr/include/i386-linux-gnu/asm/?
 
Old 05-06-2011, 02:24 AM   #24
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,519

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
# 23

cd /usr/local/lib/ && sudo rm libgcc_s*

cd /usr/local/include/ && sudo rm -r asm/
 
Old 05-06-2011, 08:39 AM   #25
keepwalking
Member
 
Registered: Oct 2010
Posts: 46

Rep: Reputation: 0
Hello every body
may any one help me to change this pseudo code to and real protocol I m not familiar with C++
Code:
Initialization
{
Find average energy of n nodes
Find the distance of each node
Calculate whether node is eligible as Cluster Head (ch node)
Select x nodes where x < n as the candidate of Cluster Head
43
}
Find m as total chromosome, where m=x nodes/desired p cluster
Populate m Chromosome
For i=0, i<m, i++
{
Randomly choose nodes from x nodes
If y < p
Add nodes to chromosome C at y
else
y=0
}
For each p chromsome
{
Do
{
For each Chromosome k where k<=p
{
Find the Chromosome Fitness
Find the Chromosome probability
}
Find average probability
Find best Chromosome as Parent 1
Do Roulette
{
Determine r where 0 < r < 1
If probability Chromosome i > r
Select Chromosome ith as second parent
Break roulette
Else
Continue Roulette
}
44
Do Crossover parent 1 and parent 2
Crossover result as Children 1 and Children 2
Mutation between least Probability Chromosome with Children
} Until iteration=k
Select the best chromosome as a group of Cluster Head (CH0,CH1,CH3,…,CHn)
Determine Cluster Head for each nodes, where d(CHi)<< from each nodes
Inform to all nodes about their Cluster head
 
Old 05-07-2011, 10:16 PM   #26
vaan
LQ Newbie
 
Registered: May 2011
Posts: 2

Rep: Reputation: 0
Question same question~

Quote:
Originally Posted by melokuhle View Post
Hello every body

when I'm using the make command I get the following error:
Code:
trace/cmu-trace.cc: In member function ‘void CMUTrace::format(Packet*, const char*)’:
trace/cmu-trace.cc:1327: error: ‘format_rca’ was not declared in this scope
trace/cmu-trace.cc: At global scope:
trace/cmu-trace.cc:1523: error: no ‘void CMUTrace::format_rca(Packet*, int)’ member function declared in class ‘CMUTrace’
make: *** [trace/cmu-trace.o] Error 1
luuh@ubuntu:~/ns-allinone-2.34/ns-2.34$ ns
ns: command not found
can any one help me to to solve this problem.
same question ,any one help? Thank you ~
 
Old 05-09-2011, 09:50 AM   #27
leminh1009
LQ Newbie
 
Registered: May 2011
Posts: 4

Rep: Reputation: 0
Hi MayTamer,

Could you please advise me how to download "leach-setup.sh" file from your link provided? When i clicked that link, it doesn't work at all.

Thank in advance.

Last edited by leminh1009; 05-09-2011 at 09:51 AM. Reason: syntax error
 
Old 05-09-2011, 11:30 AM   #28
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,519

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
# 27, @leminh1009.

The link works OK here. However, I have uploaded the files too
some time ago, to provide a "second source".

leach-setup234.sh = leach-setup.sh
https://docs.google.com/uc?id=0B7S25...download&hl=en

ns234-leach-042011.tar.bz2 = ns-234-leach.tar.gz
https://docs.google.com/uc?id=0B7S25...download&hl=en

..
 
1 members found this post helpful.
Old 05-10-2011, 07:10 PM   #29
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 179

Rep: Reputation: 261Reputation: 261Reputation: 261
You need to add a declaration of format_rca in cmu-trace.h
Code:
        void    format_imep(Packet *p, int offset);
        void    format_aodv(Packet *p, int offset);
	void    format_aomdv(Packet *p, int offset);
#ifdef MIT_uAMPS
	void    format_rca(Packet *p, int offset);
#endif

	// This holds all the tracers added at run-time
	static PacketTracer *pktTrc_;

};
This should help solve your issue

Quote:
Originally Posted by melokuhle View Post
Hello every body


when I'm using the make command I get the following error:
Code:
trace/cmu-trace.cc: In member function ‘void CMUTrace::format(Packet*, const char*)’:
trace/cmu-trace.cc:1327: error: ‘format_rca’ was not declared in this scope
trace/cmu-trace.cc: At global scope:
trace/cmu-trace.cc:1523: error: no ‘void CMUTrace::format_rca(Packet*, int)’ member function declared in class ‘CMUTrace’
make: *** [trace/cmu-trace.o] Error 1
luuh@ubuntu:~/ns-allinone-2.34/ns-2.34$ ns
ns: command not found
can any one help me to to solve this problem.


---------- Post added 05-10-11 at 08:11 PM ----------


Last edited by deepa_2111; 05-10-2011 at 07:11 PM.
 
Old 05-11-2011, 08:17 AM   #30
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 179

Rep: Reputation: 261Reputation: 261Reputation: 261
Please see my reply on Post #29

Quote:
Originally Posted by vaan View Post
same question ,any one help? Thank you ~
 
  


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 09:38 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