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 02-21-2012, 02:37 PM   #1
shanky
Member
 
Registered: Aug 2011
Posts: 155

Rep: Reputation: Disabled
leach installation problem in ns-2.34


Hello

I have been trying to implement leach in my system with reference to this post
http://www.linuxquestions.org/questi...2-34-a-870368/ (post #5)

but i have been certain problems

1) when i try to patch the file "leach-setup.sh" like this
shantanu@ubuntu:~/ns-allinone-2.34/ns-2.34$ bash leach-setup.sh
i get the following error

ns-234-leach/trace/cmu-trace.cc
ns-234-leach/trace/
ns-234-leach/test
ns-234-leach/tcl/mobility/stat-clus.tcl
ns-234-leach/tcl/mobility/mte.tcl
ns-234-leach/tcl/mobility/leach.tcl
ns-234-leach/tcl/mobility/leach-c.tcl
ns-234-leach/tcl/mobility/
ns-234-leach/tcl/ex/wireless.tcl
ns-234-leach/tcl/ex/
ns-234-leach/tcl/
ns-234-leach/package_up
ns-234-leach/mit/uAMPS/stats.tcl
ns-234-leach/mit/uAMPS/sims/uamps.tcl
ns-234-leach/mit/uAMPS/sims/stat-clus.tcl
ns-234-leach/mit/uAMPS/sims/nodescen
ns-234-leach/mit/uAMPS/sims/mte.tcl
ns-234-leach/mit/uAMPS/sims/leach.tcl
ns-234-leach/mit/uAMPS/sims/leach-c.tcl
ns-234-leach/mit/uAMPS/sims/genscen
ns-234-leach/mit/uAMPS/sims/100nodes.txt
ns-234-leach/mit/uAMPS/sims/
ns-234-leach/mit/uAMPS/ns-stat-cluster.tcl
ns-234-leach/mit/uAMPS/ns-mte.tcl
ns-234-leach/mit/uAMPS/ns-leach.tcl
ns-234-leach/mit/uAMPS/ns-leach-c.tcl
ns-234-leach/mit/uAMPS/ns-bsapp.tcl
ns-234-leach/mit/uAMPS/extras.tcl
ns-234-leach/mit/uAMPS/bsagent.o
ns-234-leach/mit/uAMPS/bsagent.h
ns-234-leach/mit/uAMPS/bsagent.cc
ns-234-leach/mit/uAMPS/
ns-234-leach/mit/rca/resources/ns-resource.tcl
ns-234-leach/mit/rca/resources/ns-resource-manager.tcl
ns-234-leach/mit/rca/resources/ns-neighbor-resource.tcl
ns-234-leach/mit/rca/resources/ns-energy-resource.tcl
ns-234-leach/mit/rca/resources/
ns-234-leach/mit/rca/resource.o
ns-234-leach/mit/rca/resource.h
ns-234-leach/mit/rca/resource.cc
ns-234-leach/mit/rca/rcagent.o
ns-234-leach/mit/rca/rcagent.h
ns-234-leach/mit/rca/rcagent.cc
ns-234-leach/mit/rca/rca-ll.o
ns-234-leach/mit/rca/rca-ll.h
ns-234-leach/mit/rca/rca-ll.cc
ns-234-leach/mit/rca/ns-ranode.tcl
ns-234-leach/mit/rca/energy.o
ns-234-leach/mit/rca/energy.h
ns-234-leach/mit/rca/energy.cc
ns-234-leach/mit/rca/
ns-234-leach/mit/leach_sims/startup.energy
ns-234-leach/mit/leach_sims/leach.save2
ns-234-leach/mit/leach_sims/leach.save1
ns-234-leach/mit/leach_sims/leach.out
ns-234-leach/mit/leach_sims/leach.err
ns-234-leach/mit/leach_sims/leach.energy
ns-234-leach/mit/leach_sims/leach.data
ns-234-leach/mit/leach_sims/leach.alive
ns-234-leach/mit/leach_sims/conditions.txt
ns-234-leach/mit/leach_sims/TDMAschedule.80.txt
ns-234-leach/mit/leach_sims/TDMAschedule.60.txt
ns-234-leach/mit/leach_sims/TDMAschedule.480.txt
ns-234-leach/mit/leach_sims/TDMAschedule.460.txt
ns-234-leach/mit/leach_sims/TDMAschedule.440.txt
ns-234-leach/mit/leach_sims/TDMAschedule.420.txt
ns-234-leach/mit/leach_sims/TDMAschedule.400.txt
ns-234-leach/mit/leach_sims/TDMAschedule.40.txt
ns-234-leach/mit/leach_sims/TDMAschedule.380.txt
ns-234-leach/mit/leach_sims/TDMAschedule.360.txt
ns-234-leach/mit/leach_sims/TDMAschedule.340.txt
ns-234-leach/mit/leach_sims/TDMAschedule.320.txt
ns-234-leach/mit/leach_sims/TDMAschedule.300.txt
ns-234-leach/mit/leach_sims/TDMAschedule.280.txt
ns-234-leach/mit/leach_sims/TDMAschedule.260.txt
ns-234-leach/mit/leach_sims/TDMAschedule.240.txt
ns-234-leach/mit/leach_sims/TDMAschedule.220.txt
ns-234-leach/mit/leach_sims/TDMAschedule.200.txt
ns-234-leach/mit/leach_sims/TDMAschedule.20.txt
ns-234-leach/mit/leach_sims/TDMAschedule.180.txt
ns-234-leach/mit/leach_sims/TDMAschedule.160.txt
ns-234-leach/mit/leach_sims/TDMAschedule.140.txt
ns-234-leach/mit/leach_sims/TDMAschedule.120.txt
ns-234-leach/mit/leach_sims/TDMAschedule.100.txt
ns-234-leach/mit/leach_sims/TDMAschedule.0.txt
ns-234-leach/mit/leach_sims/
ns-234-leach/mit/
ns-234-leach/mac/wireless-phy.h
ns-234-leach/mac/wireless-phy.cc
ns-234-leach/mac/phy.h
ns-234-leach/mac/phy.cc
ns-234-leach/mac/mac.cc
ns-234-leach/mac/mac-sensor.h
ns-234-leach/mac/mac-sensor.cc
ns-234-leach/mac/mac-sensor-timers.h
ns-234-leach/mac/mac-sensor-timers.cc
ns-234-leach/mac/ll.h
ns-234-leach/mac/channel.cc
ns-234-leach/mac/
ns-234-leach/leach_test
ns-234-leach/common/packet.h
ns-234-leach/common/packet.cc
ns-234-leach/common/mobilenode.cc
ns-234-leach/common/
ns-234-leach/apps/app.h
ns-234-leach/apps/app.cc
ns-234-leach/apps/
ns-234-leach/Makefile.in
ns-234-leach/Makefile
ns-234-leach/
cp: cannot create regular file `/home/shantanu/ns-allinone-2.34/ns-2.34/Makefile': Permission denied


why does this happen?
I have edited the path in the setup file to /home/shantanu/

2) i also tried editing the files "Makefile" and "Makefile.in" as following
CC = gcc-4.3
CPP = g++-4.3

but this is possible in "Makefile.in" since "Makefile" is in Read-Only Mode.How can i make the changes in "MakeFile" as well?

Am i missing something here.Please advice how do i go about correcting my mistake

Regards

Last edited by shanky; 02-21-2012 at 02:40 PM.
 
Old 02-21-2012, 04:24 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,402

Rep: Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611
The Makefile is generated from Makefile.in, when you do ./configure.
So the Makefile copy doesn't matter.

For /home/shantanu/ns-allinone-2.34 : You can use the script "leach-HOME-setup234.sh"
http://www.linuxquestions.org/questi...a13-907076/#11
> post #11.

And please use the modified file ns-allinone-2.34/ns-2.34/trace/cmu-trace.h,
post #9.

.
 
Old 02-21-2012, 04:54 PM   #3
shanky
Member
 
Registered: Aug 2011
Posts: 155

Original Poster
Rep: Reputation: Disabled
Hi knudfl ,

thanks for the input and i was going through the post you mentioned.Does the leach-HOME-setup234.sh applicable only to fedora13 or would it work for ubuntu 10.10 ,just wondering because the post was about the packages for fedora 13.I have installed ns-2.34 on ubuntu 10.10

regards
 
Old 02-21-2012, 05:00 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,402

Rep: Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611
The LEACH setup is the same for any Linux OS. Fedora, Ubuntu etc.

The differences can be the compilers to use :
g++ version e.g. 4.4 or 3.4 for Fedora, g++ version 4.1 for Ubuntu 10.10 .
( Not g++-4.3 for Ubuntu 10.10 ).

.

Last edited by knudfl; 02-22-2012 at 03:11 AM.
 
Old 02-22-2012, 02:40 AM   #5
shanky
Member
 
Registered: Aug 2011
Posts: 155

Original Poster
Rep: Reputation: Disabled
Hi knudfl,

I am little confused.According to the post i was referring to it was said that g++-4.3 is required for ubuntu 10.10 and i followed the steps accordingly.Please explain whether i have made any mistake

regards
 
Old 02-22-2012, 03:19 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,402

Rep: Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611
I have checked it now : A year ago g++-4.3 could be used.

With the current updates, only g++-4.1 will work. (Post #4 was edited to 4.1 ).
( g++-4.1 : When you use an Ubuntu package g++-4.1 )

Ref. an ns-2.34-LEACH test compile from 07 January 2012, Ubuntu 10.10 32bits.



P.S. : Ubuntu : All compiler versions g++-4.1.2 g++-4.2.4 .. .. g++-4.4.4
can usually be used for ns-2.34, when the compilers are not Ubuntu/Debian style.

.

Last edited by knudfl; 02-22-2012 at 03:51 AM.
 
Old 02-26-2012, 11:12 AM   #7
shanky
Member
 
Registered: Aug 2011
Posts: 155

Original Poster
Rep: Reputation: Disabled
Hi knudfl,

I have used leach-HOME-setup234.sh and also modified cmu-trace.h but when i try to patch it
"bash leach-HOME-setup234.sh"
i still get the same error-

cp: cannot create regular file `/home/shantanu/ns-allinone-2.34/ns-2.34/Makefile': Permission denied

i have also changed the path in the setup file to /home/shantanu/ns-allinone-2.34/ns-2
is there something else i am missing out?


is this because i am using compiler gcc-4.3 and have to use gcc-4.1?? is the command sudo apt-get install gcc-4.1 to get it done??
Also can we have any number of compilers installed such as in my case i installed ns2.34 with gcc-4.3 and now need to install it with gcc-4.1?? if yes how is it be done?

Regards and thank you for your patience.

Last edited by shanky; 02-26-2012 at 11:34 AM.
 
Old 02-26-2012, 11:45 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,402

Rep: Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611
#7
Quote:
cp: cannot create regular file `/home/shantanu/ns-allinone-2.34/ns-2.34/Makefile'
The 'cp' command has nothing to do with gcc.

May be you already have a Makefile ? The script is meant for
a clean ns-allinone-2.34 : No Makefile is present.
Suggest : 1) Rename your original Makefile to Makefile-orig
If you want to overwrite an already existing Makefile,
then edit line 22 in leach-HOME-setup234.sh to cp -f or cp -a :
See 'man cp' http://unixhelp.ed.ac.uk/CGI/man-cgi?cp
May be it's an Ubuntu only issue ? I can't reproduce your error.

Or 2) : Start from scratch. And don't do ./install until
the LEACH patching is in place.

.
 
Old 02-26-2012, 11:54 AM   #9
shanky
Member
 
Registered: Aug 2011
Posts: 155

Original Poster
Rep: Reputation: Disabled
Hi,

Thanks for your prompt reply.So this is what should be done and please correct me if i am wrong.
in /home/shantanu/ns-allinone-2.34/ns-2.34 the Makefile.in to be renamed to somthing like Makefile-orig.in and then edit line 22 of leach-HOME-setup234.sh
cp Makefile /home/shantanu/ns-allinone-2.34/ns-2.34
to
cp -f or cp -a

and then try patching it again?
so i dont need to get gcc-4.1 installed ?? because i have not done it so far and you mentioned that ubuntu 10.10 needs gcc-4.1.What about that?

Regards
 
Old 02-26-2012, 12:22 PM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,402

Rep: Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611
The script usually works OK in Ubuntu. Don't know why you have issues.

No reason to do anything with Makefile.in unless there's a problem.


Requirements, either : sudo apt-get install g++-4.1
( It's not really about gcc, but g++ ).

Or use gcc41-compat-4.1.2_i386.deb g++41-compat-4.1.2_i386.deb, if 32bits.
gcc41-compat https://docs.google.com/open?id=0B7S...RjNjJhOTZjNjI2
g++41-compat https://docs.google.com/open?id=0B7S...hjMjljN2M2MGU4

.
 
Old 02-27-2012, 10:53 AM   #11
shanky
Member
 
Registered: Aug 2011
Posts: 155

Original Poster
Rep: Reputation: Disabled
Hi knudfl,

The issue has been resolved.It was a mistake from my side,sorry about that but a new error has occured.After patching with leach-HOME-setup234.sh i did "./configure" but then i now get the error

./configure: line 1520: config.log: Permission denied
./configure: line 1530: config.log: Permission denied

What is this and how can it be resolved?

Also when i try to install g++-4.1 and type in the command you told me i get

Reading state information... Done
E: Unable to locate package g++-4.1
E: Couldn't find any package by regex 'g++-4.1'

How to resolve this?


Regards

Last edited by shanky; 02-27-2012 at 10:59 AM.
 
Old 02-27-2012, 11:02 AM   #12
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,402

Rep: Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611
# 11.

It looks like you have used 'sudo' in a previous command.
Then the files are owned by root : You have no access.

May be 'chown -R shantanu ns-allinone-2.34/' will do ?
'man chown' http://www.manpagez.com/man/8/chown/
If not, start from scratch. And no sudo for any command.

.
 
Old 02-27-2012, 11:09 AM   #13
shanky
Member
 
Registered: Aug 2011
Posts: 155

Original Poster
Rep: Reputation: Disabled
I've tried from scratch ,opened a new terminal changed the path /home/shantanu/ns-allinone-2.34/ns-2.34 and then keyed in ./configure
but i get the same error.I also tried the command you gave me chown -R shantanu ns-allinone-2.34/ns-2.34 but then it gives me the error that change ownership for various files is not permitted.Or have i made a mistake somewhere?
 
Old 02-27-2012, 11:53 AM   #14
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,402

Rep: Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611Reputation: 3611
#13.

Sorry, should be 'sudo chown -R shantanu ns-allinone-2.34/'
... if you have files marked with "owner root".
 
Old 02-27-2012, 12:24 PM   #15
shanky
Member
 
Registered: Aug 2011
Posts: 155

Original Poster
Rep: Reputation: Disabled
heyy it worked with what you told me..I did make clean && make after that when i did ./test it gives me permission denied.is this again because of sudo.I did open a new terminal and tried it again but gives me the same.should i do it using chown again??
 
  


Reply


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
LEACH protocol installation on NS2.27 Scofield Linux - General 255 03-08-2012 05:19 PM
Regarding leach 2.34 installation on Fedora 14 khushbushah Linux - General 2 02-13-2012 03:49 AM
LEACH installation geethamit Linux - Software 1 11-01-2011 03:58 PM
LEACH installation geethamit Linux - Software 1 10-17-2011 10:45 AM
Leach Installation on NS2 Asmaa Seyam Linux - General 3 10-19-2010 12:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:32 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration