How to install NS-2 on Mac
Posted by Erwin on December 25, 2011
Mac OS X is originally from UNIX, so it must support NS2 well. We only need to install xcode for develop library. And then modify the configure file in each directories of tcl otcl tctcl nam and so on, adding the corresponding xcode library path… Here is the procedure: ^^:
Before the procedure, you have to check the usability of X11 on your mac OS, because the nam application need it.
1. Downlaod xCode and install…
http://developer.apple.com/tools/xcode/
goto directory: /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib and you can see lots of files…
then it is sure you already have x develop library
2. Down ns2, and extract…
http://sourceforge.net/project/showfiles.php?group_id=149743
3. Modify the file “configure” in each directories in tcl, tctcl, otcl, nam, and so on :
find “ xlibdirs ”
and put “ /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib ” after it
find “ xincdirs ”
and put “ /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include ” after it
4. After modifying all related configure files, you can successfully build ns2 now by input “./install”
5. Set up environment variables:
5.1 input “ echo $SHELL ” and you can see if it is “bash“, which means Bourne Shell. (os X after 10.3 is using Bourne Shell by default)
5.2 modify .profile or .bash_profile at Users/”your name”, add the related variables like this:
======================================================================================================= export NS_HOME=/Users/weicai/ns-allinone-2.30 export PATH=$NS_HOME/tcl8.4.13/unix:$NS_HOME/tk8.4.13/unix:$NS_HOME/bin:$PATH export LD_LIBRARY_PATH=$NS_HOME/tcl8.4.13/unix:$NS_HOME/tk8.4.13/unix:$NS_HOME/otcl-1.12:$NS_HOME/lib:$LD_LIBRARY_PATH export TCL_LIBRARY=$NS_HOME/tcl8.4.13/library =======================================================================================================






