LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-04-2013, 02:19 AM   #1
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Rep: Reputation: 22
NS-2.27 on Ubuntu 12.04


Hi all,
Need quick answer, can I install NS-2.27 on Ubuntu 12.04?
I have Ubuntu 12.04 i686 with gcc 41 & g++ 41 installed.
I have followed all thread related to NS-2.27 installation but can't find the answer, and I also have tried to install with the guide for Ubuntu 9.10 but failed due to gcc issue.

If I can't use NS-2.27 on Ubuntu 12.04, please let me know what ubuntu distro can run ns-2.27 without problem.

I need NS-2.27 to run Leach simulation.
Please don't tell me to use NS-2.34, I am facing problem running Leach on NS-2.34 that drives me crazy

--------------------------------------------
Dear Sir knudfl, need your help.
Please answer if you found this thread

Last edited by mhmdmahdi; 12-04-2013 at 02:31 AM.
 
Old 12-04-2013, 04:53 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153
Ubuntu 12.04 - i686 is one of the easy ones :
1. $ tar xvf ns-allinone-2.27.tar.gz && patch -p0 < ns-2.27-gcc410.patch
2. $ cd ns-allinone-2.27/ && export CC=gcc41 CXX=g++41 && ./install

The older Ubuntu versions are complicated (but no gcc issues !) :
* Please read http://www.linuxquestions.org/questions/tags/ns227/
→ #3 http://www.linuxquestions.org/questi...10-a-782356/#3

Leach info http://www.linuxquestions.org/questions/tags/leach/
Leach Makefile.in http://www.linuxquestions.org/questi...atch-791222/#4
→ post #4.

-

Last edited by knudfl; 12-04-2013 at 04:58 AM.
 
1 members found this post helpful.
Old 12-04-2013, 05:28 AM   #3
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Original Poster
Rep: Reputation: 22
Hi knudfl, thanks for helping.
a little confused about Makefile.
after successfully install NS 2.27, if i use 1-LEACH-Makefile-modified to re-make NS, do I need to remove original Makefile?


Quote:
Originally Posted by knudfl View Post
Ubuntu 12.04 - i686 is one of the easy ones :
1. $ tar xvf ns-allinone-2.27.tar.gz && patch -p0 < ns-2.27-gcc410.patch
2. $ cd ns-allinone-2.27/ && export CC=gcc41 CXX=g++41 && ./install

-

Last edited by mhmdmahdi; 12-04-2013 at 06:02 AM.
 
Old 12-04-2013, 06:01 AM   #4
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Original Poster
Rep: Reputation: 22
-- update ---

After successfully install NS 2.27, i do this step:

$ cd ns-allinone-2.27/ns-2.27/
$ tar xvf mit.tar.gz
$ ./configure
$ mv Makefile Makefile.org
$ make clean
make: *** No rule to make target `clean'. Stop.
$ make -f 1-LEACH-Makefile-modified

but got this error.

Quote:
...
./mac/mac.h:142: warning: ‘class Tap’ has virtual functions but non-virtual destructor
./mac/mac.h:150: warning: ‘class MacHandlerResume’ has virtual functions but non-virtual destructor
./mac/mac.h:158: warning: ‘class MacHandlerSend’ has virtual functions but non-virtual destructor
tclsh8.4 bin/tcl-expand.tcl tcl/lib/ns-lib.tcl tcl/lib/ns-diffusion.tcl | tcl2c++ et_ns_lib > gen/ns_tcl.cc
/bin/sh: 1: tclsh8.4: not found
/bin/sh: 1: tcl2c++: not found
make: *** [gen/ns_tcl.cc] Error 127
Any hints how to solve this?

I changed 1-LEACH-Makefile-modified before run "make -f 1-LEACH-Makefile-modified"
CC=gcc41
CPP=g++41
/home/Administrator/ns-allinone-2.27/ --> /home/mhmdmahdi/ns-allinone-2.27/

Last edited by mhmdmahdi; 12-04-2013 at 06:11 AM.
 
Old 12-04-2013, 06:17 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153
#3, #4.
Quote:
$ cd ns-allinone-2.27/ns-2.27/
$ tar xvf mit.tar.gz
$ ./configure
$ mv Makefile Makefile.org
$ make clean
make: *** No rule to make target `clean'. Stop.
$ make -f 1-LEACH-Makefile-modified
"./configure" is wrong : $ export CC=gcc41 CXX=g++41 && ./configure
And don't use the old Makefile's.

There is a reason for the new LEACH `Makefile.in'.
Then you don't have to edit the Makefile :
cd ns-allinone-2.27ns-2.27/ && export CC=gcc41 CXX=g++41 && ./configure
* Which create a Makefile that fits your OS / ns-allinone-2.27/lib/* etc.

The proof way is of course to put everything leach : {mit/ Makefile.in}
in place in a fresh unpacked ns-allinone-2.27.tar.gz, and do the build
commands : $ patch -p0 < ns-2.27-gcc410.patch
$ cd ns-allinone-2.27/ && export CC=gcc41 CXX=g++41 && ./install

-

Last edited by knudfl; 12-04-2013 at 07:17 AM.
 
Old 12-04-2013, 06:41 AM   #6
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Original Poster
Rep: Reputation: 22
$ export CC=gcc41 CXX=g++41 && ./configure
$ make clean
$ make

got this error

Quote:
...
mac/wireless-phy.cc: In member function ‘virtual void WirelessPhy::sendDown(Packet*)’:
mac/wireless-phy.cc:320: error: ‘min’ was not declared in this scope
make: *** [mac/wireless-phy.o] Error 1

Last edited by mhmdmahdi; 12-04-2013 at 06:43 AM.
 
Old 12-04-2013, 07:24 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153
# 6 .
Quote:
$ export CC=gcc41 CXX=g++41 && ./configure
$ make clean
$ make
Probably :
$ make distclean && export CC=gcc41 CXX=g++41 && ./configure && make

? Are you sure that the new **Makefile.in.txt was renamed to Makefile.in,
and copied to ns-allinone-2.27/ns-2.27/ ?

-
 
Old 12-04-2013, 07:57 AM   #8
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Original Poster
Rep: Reputation: 22
i'm sorry sir,
the errors gone, just need to add a line in wireless-phy.cc

#define min(a,b) (((a)>(b))?(b): (a))

but still got weird leach.out related to "Warning!!! No Cluster Head ADVs were heard!" issues.
have no idea why this is happen, I think something prevent the simulation to running well on my computer.
looking to downgrade my OS now, i hope that can solve my problem.
any suggestion what distro i should use?

Quote:
Originally Posted by knudfl View Post
# 6 .

Probably :
$ make distclean && export CC=gcc41 CXX=g++41 && ./configure && make

? Are you sure that the new **Makefile.in.txt was renamed to Makefile.in,
and copied to ns-allinone-2.27/ns-2.27/ ?

-

Last edited by mhmdmahdi; 12-04-2013 at 08:05 AM.
 
  


Reply

Tags
leach, ns2


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
How to Install Ubuntu 12.10 or Upgrade to Ubuntu 12.10 (Quantal Quetzal) from Ubuntu allu john sudhakar Linux - Newbie 1 10-26-2012 12:59 AM
LXer: Hereā??s Two Method That is Helping Ubuntu User to Upgrade Ubuntu 11.10/10.04 to Ubuntu 12.04 LT LXer Syndicated Linux News 0 05-12-2012 07:50 PM
LXer: Ubuntu live CD will let you upgrade to newer Ubuntu versions Ubuntu 11.04 Development LXer Syndicated Linux News 0 03-01-2011 04:20 PM
LXer: Ubuntu Restricted Extras - Lets Ubuntu Play Everything [Ubuntu for Beginners Sc LXer Syndicated Linux News 0 04-20-2010 01:10 AM


All times are GMT -5. The time now is 10:17 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration