Difference between revisions of "HOWTO get ns-3 running on Mac OS X (10.6.2 Intel)"

From Nsnam
Jump to: navigation, search
Line 24: Line 24:
  
 
Note that you can use also MacPorts (http://www.macports.org/) instead of Fink. It's really a matter of your personal choice.
 
Note that you can use also MacPorts (http://www.macports.org/) instead of Fink. It's really a matter of your personal choice.
 +
 +
'''2a) Install MacPorts'''
 +
 +
Some people prefer MacPorts to fink.  If you are using MacPorts, you can ignore the above about fink and move to step 3.
  
 
'''3) Install Mercurial'''
 
'''3) Install Mercurial'''
  
Download and install Mercurial from http://mercurial.selenic.com/wiki/Download
+
* MacPorts:  sudo port install mercurial
Choose the latest binary package. Either you can choose to install mercurial trough MacPorts or Fink, but make sure to have a recent version (1.4.2 or better)
+
* Binaries:  http://mercurial.selenic.com/wiki/DownloadChoose the latest binary package. Either you can choose to install mercurial through MacPorts or Fink, but make sure to have a recent version (1.4.2 or better)
* MacPorts has a recent version:  sudo port install mercurial
+
 
* Also, there is a self extracting binary installer dmg file for OS 10.6.2 (mercurial-1.6.3)
 
* Also, there is a self extracting binary installer dmg file for OS 10.6.2 (mercurial-1.6.3)
  

Revision as of 20:55, 21 October 2011

The installation instructions included in this page are not meant to be comprehensive and represent only one of the many ways of getting ns-3 to build in a Snow Leopard Mac OS X system. Commands (>>) should be run from a Terminal window. Mac OS X does not support all of the features of ns-3, but core functionality is provided. Check http://www.nsnam.org/wiki/index.php/Installation for further details on what is and what is not supported on Mac OS X.

1) Install XCode

You will find XCode in the Mac OS X Install DVD that came with your Mac. Alternatively, you can download the most recent version of XCode from the Apple Developer Connection website (http://developer.apple.com/mac/). The XCode development environment includes the gcc compiler and critical libraries required to build applications to be run in Mac OS X.

2) Install Fink

2.1) Download Fink source release version 0.29.10 from http://downloads.sourceforge.net/fink/fink-0.29.10.tar.gz

2.2) Extract the contents of the file and enter open up the Terminal in the resulting folder.

2.3) Install Fink (during the interactive installation process, select the 32 bit installation).

>> ./bootstrap

2.4) Execute a script in order to setup the environment variables for Fink.

>> /sw/bin/pathsetup.sh (assuming a default install folder).

2.5) Install updated packages, if available.

>> fink selfupdate

Note that you can use also MacPorts (http://www.macports.org/) instead of Fink. It's really a matter of your personal choice.

2a) Install MacPorts

Some people prefer MacPorts to fink. If you are using MacPorts, you can ignore the above about fink and move to step 3.

3) Install Mercurial

  • MacPorts: sudo port install mercurial
  • Binaries: http://mercurial.selenic.com/wiki/Download. Choose the latest binary package. Either you can choose to install mercurial through MacPorts or Fink, but make sure to have a recent version (1.4.2 or better)
  • Also, there is a self extracting binary installer dmg file for OS 10.6.2 (mercurial-1.6.3)

4) Download source code

>> hg clone http://code.nsnam.org/ns-3-allinone

>> cd ns-3-allinone

>> ./download.py

5) Build the local repository

>> ./build.py

6) Test the installation

>> cd ns-3-dev

>> ./test.py

Possible issues

There is a known bug involving -arch directive. If you get an error about linking and object architecture mismatch, check if you have an environment variable "CFLAGS=-arch i386" or similar. If you do, try disabling it.