Installing ns2 (2.35) on Mac OSX Lion

Turns out that installing ns2.35 on Mac OSX Lion 10.7.5 wasn’t as painful as other blogs said [Blog1][Blog2][Blog3]. [Blog1] and its comments presented useful information. So here is a quick summary of what I had to do (as of Jan 30, 2013).

1. Downloaded ns2 from sourceforge, untarred ns-allinone-2.35.tar.gz


2. The standard install script and a modification recommended in one of the blogs [here] blew up in a whole lot of places.

In particular when the standard script is linking the files, it throws up:

Undefined symbols for architecture x86_64:

As recommended, the way to solve it is by installing tcl8.5.10, tk8.5.10, tclcl-1.20, otcl-1.14, and ns-2.35 in that order with 64-bit enabled. I guess the install script can be modified, but I don’t have time for that now.

3. To compile tcl8.5.11

Navigate to ns/tcl8.5.10/unix in the download, configure with 64-bit compilation enabled, make and make install

cd tcl8.5.10/unix
./configure --enable-framework --enable-64bit
make test
## you should pass all test.
sudo make install

4. To compile tk8.5.10

Navigate to tk8.5.10/unix in the download folder, configure with 64-bit compilation enabled, make and make install

cd tk8.5.10/unix
./configure --enable-framework --enable-64bit
sudo make install

5. To compile otcl-1.14

Navigate into the otcl-1.14 directory, configure, move a couple headers to an alternate location, make

cd otcl-1.14/
./configure --with-tcl-ver=8.5.10 --with-tk-ver=8.5.10
cp tcl8.5.10/unix/*.h tcl8.5.10/generic/

If you tried make without copying the headers above, you will get error: tclUnixPort.h: No such file or directory and then Make goes beserk.

6. To compile tclcl-1.20

Navigate to tclcl-1.20/, configure, make

cd tclcl-1.20
./configure --with-otcl=../otcl-1.14 --with-tcl-ver=8.5.10 --with-tk-ver=8.5.10

7. To compile ns-2.35

Navigate to ns-2.35, configure, make, run validation tests

cd ns-2.35
./configure --with-otcl=../otcl-1.14 --with-tclcl=../tclcl-1.20 --with-tcl-ver=8.5.10 --with-tk-ver=8.5.10

Note here that we are specifying absolute path for otcl-1.14 and tclcl-1.20 here; since tcl-8.5.10 & tk8.5.10 was installed in their default Library locations (make install), we do not need to specify the same. To learn more, type ./configure –help.

Now run validation, take a long break

##(Validation can take 1-30 hours to run.)

Finally, you will get this:

"validate overall report: all tests passed"

8. That’s it. ns2 is now installed on the Mac OSX Lion. Wasn’t painful at all. Some intelligent changes in the standard install script would make it a no-brainer.


Leave a Reply