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 https://itunes.apple.com/tr/app/xcode/id497799835?mt=12
  2. Install Xcode
  3. Download and install command line tools. You can type `xcode-select –install` terminal or https://developer.apple.com/downloads/index.action
  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 http://www.nsnam.org or get with mercuriel `hg clone http://code.nsnam.org/ns-3-dev`
  6. Change ns3 directory and run `./waf -d debug configure`

Configure Eclipse

  1. Download Eclipse IDE for C/C++ Developers from http://www.eclipse.org/downloads/
  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