NS2 for Eclipse

Eclipse is an open source development platform comprised of extensible frameworks, tools and runtimes for building, deploying and managing software across the lifecycle. A large and vibrant ecosystem of major technology vendors, innovative start-ups, universities, research institutions and individuals extend, complement and support the Eclipse platform.



Set up NS2 for Eclipse under Linux:

  • Download Eclipse SDK
  • Download Eclipse C++ Development Tooling
  • Extract Eclipse SDK to a folder, i.e. /home/username/eclipse
  • Extract Eclipse CDT to the same folder

  • Download NS2
  • Extract NS2 to a folder, i.e. /home/username/ns-allinone-2.29
  • Edit Makefile if necessary (see note below for details)
  • Build NS2

  • Start Eclipse
  • Choose your ns2 folder as your workspace folder, default:/home/username/ns-allinone-2.29
  • Create new C++ Project
    • Select File->New->Project...
    • Select C++->Standard C++ Make Project
    • Click Next
    • Enter ns-2.29 as your project name
    • Click Finish
  • Create a Launch Configuration
    • Select Run->Debug...
    • Select C/C++ Local Application
    • Click "New Launch Configuration"
    • Under Project, click Browse and select "ns-2.29"
    • Under C/C++ Application, click Search Project and select "ns"
    • Click Apply
    • Click Close

Note: The debugger needs debug information to be generated by the compiler. To make the compiler generate these informations, you have to edit the NS2 makefile. Edit ".../ns-allinone-2.29/ns-2.29/Makefile" or edit ".../ns-allinone-2.29/ns-2.29/Makefile.in" and run "./configure" after that. Add those lines anywhere:

CCOPT = -g # Hinzufügen der "-g"-Option
DEFINE = -DNDEBUG # L?schen des NoDebug-Flags
DEFINE = -DDEBUG # Hinzufügen des Debug-Flags

Additional Note: Eclipse creates project and workspace files in the NS2 folder.These should be excluded from CVS checkins and patch creations. Add those files to your cvsignore, respectively delete them from your patchfile after creating it.


Set up NS2 for Eclipse under Windows

You need cygwin to run NS2 under Windows.

  • Download Cygwin
  • Install Cygwin
    • Run setup.exe
    • Choose a root directory, i.e. c:\cygwin
    • Make sure, unix/binary text file type is selected
    • Click Next
    • Choose a package directory, this is where your downloaded files will be put in
    • Select an internet connection and a download mirror
    • Make sure you install the following packages:
      xorg-x11-bin, xorg-x11-bin-dlls, xorg-x11-devel, xorg-x11-libs-data, xorg-x11-etc, gcc, gcc-g++, gawk, tar, gzip, make, patch, perl, w32api
    • Start cygwin.bat to create a user
  • Download Eclipse SDK
  • Download Eclipse C++ Development Tooling
  • Extract Eclipse SDK to a folder, i.e. c:\eclipse
  • Extract Eclipse CDT to the same folder

  • Download NS2
  • Extract NS2 to a cygwin folder, i.e. c:\cygwin\home\username\ns-allinone-2.29
  • Edit Makefile if necessary (see note below for details)
  • Build NS2
    • Start Cygwin.bat to get into cygwin shell
    • cd to your NS2-directory, default: /home/username/ns-allinone-2.29
    • Type "./install"
    • Type "./validate" if you want to validate your build
    • These steps may take a while
  • Start Eclipse
  • Choose your ns2 folder as your workspace folder, default:c:\cygwin\home\username\ns-allinone-2.29
  • Create new C++ Project
    • Select File->New->Project...
    • Select C++->Standard C++ Make Project
    • Click Next
    • Enter ns-2.29 as your project name
    • Click Finish
  • Change the Binary Parser
    • Select Project->Properties
    • Select C/C++ Make Project
    • In the Binary Parser Tab, select Cygwin PE Parser and PE Windows Parser
    • Click OK
  • Create a Launch Configuration
    • Select Run->Debug...
    • Select C/C++ Local Application
    • Click "New Launch Configuration"
    • Under Project, click Browse and select "ns-2.29"
    • Under C/C++ Application, click Search Project and select "ns.exe"
    • Click Apply
    • Click Close

Note: The debugger needs debug information to be generated by the compiler. To make the compiler generate these informations, you have to edit the NS2 makefile. Edit ".../ns-allinone-2.29/ns-2.29/Makefile" or edit ".../ns-allinone-2.29/ns-2.29/Makefile.in" and run "./configure" after that. Add those lines anywhere:

CCOPT = -g # Hinzufügen der "-g"-Option
DEFINE = -DNDEBUG # L?schen des NoDebug-Flags
DEFINE = -DDEBUG # Hinzufügen des Debug-Flags

Additional Note: Eclipse creates project and workspace files in the NS2 folder.These should be excluded from CVS checkins and patch creations. Add those files to your cvsignore, respectively delete them from your patchfile after creating it.

FROM :http://wcms1.rz.tu-ilmenau.de/fakia/NS2-for-Eclipse.6025.0.html

留言

這個網誌中的熱門文章

序曲Overture

Tomcat並存