Configure Eclipse NS3 on Mac OS X 10.10 Yosemite

To get ns3 running with Mac OS X 10.10 Yosemite:

Configure Development Environment

  1. Download Xcode from Apple App Store
  2. Install Xcode
  3. Download and install command line tools. You can type `xcode-select –install` terminal or
  4. gdb 7 has some problems with on Mac OS X so, install gdb 6 with macports using `sudo port install gdb-apple` or homebrew
  5. Download ns3 source code using web site or get with mercuriel `hg clone`
  6. Change ns3 directory and run `./waf -d debug configure`

Configure Eclipse

  1. Download Eclipse IDE for C/C++ Developers from
  2. From eclipse New->New Project select C++ Project
  3. Point location of the ns3 and name it
  4. Right click on the project and properties, C/C++ Build change build command to waf `${workspace_loc:/NS3Dev}/waf` and build directory to `${workspace_loc:/NS3Dev}/build`
  5. Change incremental build all to build
  6. Now build project
  7. If you get unnecessary errors,from Eclipse Preferences->C/C++->Code Analysis uncheck Syntax and Semantic Erros

Signing gdb

Mac OS X requires gdb to be signed to access memory locations so:

  1. Open Keychain Access, Keychain Access->Certificate Assistant->Create a Certificate…
  2. Name the cert as `gdb-cert` select `Self Signed Root` and `Code Signing` also check override defaults
  3. Next, until “Specify a Location The Certificate” and select `System`
  4. Find cert in Keychain Access and if its not trusted trust the cert.
  5. From terminal sign the gdb `sudo codesign -s gdb-cert $(which gdb)`

Configure Eclipse Debugger

  1. Debug Configurations add new configuration
  2. Select C/C++ Application from list `build/scratch/scratch-simulator`
  3. In Environmental’s tab select new and add `DYLD_LIBRARY_PATH` variable and `${workspace_loc:/NS3Dev}/build` value
  4. In debug section select debugger path to gdb

2 thoughts on “Configure Eclipse NS3 on Mac OS X 10.10 Yosemite

  • Alex

    Thanks for the post… I was able to install and build everything, but my ns-3 application is crashing… are you using gcc/g++ or clang?

    • merturk

      I’m using clang but it should work with gcc48 too.

Leave a Reply

Your email address will not be published. Required fields are marked *