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-13-2010, 12:46 PM   #1
itwitter
LQ Newbie
 
Registered: Dec 2010
Posts: 4

Rep: Reputation: 0
ns-2 simulator work with eclipse


hi,all

I want to use eclipse to compile and debug source code on ns-2 simulator

the question
1.how can i configure the parameter on eclipse , please help to suggest me the step.
2.how can i compile the source code *.cc

thank
 
Old 12-17-2010, 11:34 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,683

Rep: Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284
Welcome to LQ.

After fifteen years of developing ns2, there may not be very much left
to debug with ordinary methods.
http://www.isi.edu/nsnam/ns/

Quote:
How can I compile the source code *.cc
Usually you cannot compile a single file in ns2.
The files.cc have headers (file.h) that will ask for other headers,
in a complex pattern: 29 different locations inside ns-2.xx with *.h .
For that you have a Makefile. ( And a Makefile.in ).

The compiler is c++ (g++): Redhat based like Fedora, CentOS + Mandriva +
PCLinuxOS + Suse : The package name is gcc-c++, providing /usr/bin/g++.
( Some "compat" compilers are available too : Search for c++ ).
Debian based : Ubuntu, Mint etc. : Package name = g++ .
( The compats are g++-** , e.g. g++-3.3 g++-4.1, g++-4.2, g++-4.3 ).
..

Last edited by knudfl; 12-17-2010 at 04:43 PM.
 
Old 12-18-2010, 10:40 AM   #3
itwitter
LQ Newbie
 
Registered: Dec 2010
Posts: 4

Original Poster
Rep: Reputation: 0
thank for your reply
then i want to develop new protocol in ns-2 simulator its want to create file.cc and file.h
how can i do to create and complie it?

Quote:
Originally Posted by knudfl View Post
Welcome to LQ.

After fifteen years of developing ns2, there may not be very much left
to debug with ordinary methods.
http://www.isi.edu/nsnam/ns/


Usually you cannot compile a single file in ns2.
The files.cc have headers (file.h) that will ask for other headers,
in a complex pattern: 29 different locations inside ns-2.xx with *.h .
For that you have a Makefile. ( And a Makefile.in ).

The compiler is c++ (g++): Redhat based like Fedora, CentOS + Mandriva +
PCLinuxOS + Suse : The package name is gcc-c++, providing /usr/bin/g++.
( Some "compat" compilers are available too : Search for c++ ).
Debian based : Ubuntu, Mint etc. : Package name = g++ .
( The compats are g++-** , e.g. g++-3.3 g++-4.1, g++-4.2, g++-4.3 ).
..
 
Old 12-18-2010, 12:13 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,683

Rep: Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284Reputation: 3284
Create a new protocol : write file.cc ( and the included file.h )

... And make an entry in Makefile.in in the relevant section :
Add file.o ( <folder>/<folder>/file.o ) into the middle of the line,
like this example ( for the 'Wimax patch')
http://www.lrc.ic.unicamp.br/wimax_ns2/
Please look for "Installation".


cd ns-allinone-2.34/ns-2.34/ && mv ns ns.org && make clean
&& mv Makefile Makefile.org && ./configure && make .
With some luck, a new 'ns' will then be created.

..
 
  


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
Can't get eclipse to work on Debian Learath Linux - Newbie 3 10-27-2007 05:19 PM
how to work on SKYEYE simulator mayank_linux Linux - Kernel 1 09-26-2007 08:11 AM
My Eclipse dosent work now?? andrewnow Linux - Software 3 06-05-2006 04:46 AM
Start work with eclipse eduardomsilva Programming 4 02-25-2005 10:17 AM
Eclipse won't work Gen. Patton Linux - Software 5 02-08-2004 09:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:03 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