2012년 2월 18일 토요일

Install NS2.35 to Mac OS(Lion)

You have experienced otcl compile failures when you install all-in-one package to your mac.
(Like this : Undefined symbols for architecture x86_64)


I find a way to install ns-2.35 version to mac OS (Lion 64bit).

You needs tcl8.5.11, tk8.5.11, tclcl-1.20, otcl-1.14, and ns-2.35.

You can get files via "http://www.isi.edu/nsnam/ns/ns-build.html"

I assume that your folder locate in /Users/kwangjo/Documents/ns

Open terminal and goto the folder.

! You should install Xcode before doing follow instruction.

1. Change superuser mode
  • sudo su
  • tar xvfz "PACKAGES"

2. compile tcl8.5.11
  • cd /Users/kwangjo/Documents/ns/tcl8.5.11
  • cd unix
  • ./configure --enable-framework --enable-64bit
  • make
  • make test
  • ## you should pass all test.
  • make install
3. compile tk8.5.11

  • cd /Users/kwangjo/Documents/ns/tk8.5.11
  • ./configure --enable-framework --enable-64bit
  • make
  • make install

4. compile otcl-1.14
! Before compile, you should make library link and include link.

  • ln -s /Users/kwangjo/Documents/ns/tk8.5.11/library /usr/share/tk8.5
  • ln -s /Users/kwangjo/Documents/ns/tcl8.5.11/library /usr/share/tcl8.5
  • ln -s /Users/kwangjo/Documents/ns/tk8.5.11/generic /usr/include/tk8.5
  • ln -s /Users/kwangjo/Documents/ns/tcl8.5.11/generic /usr/include/tcl8.5
  • cp /Users/kwangjo/Documents/ns/tcl8.5.11/unix/*.h /Users/kwangjo/Documents/ns/tcl8.5.11/generic
  • cd /Users/kwangjo/Documents/ns/otcl-1.14
  • ./configure
  • make

5. compile tclcl-1.20

  • cd /Users/kwangjo/Documents/ns/tclcl-1.20
  • ./configure
  • make


! You can compile ns-2.35 with normal user mode(this compile do not need super user mode)
6. compile ns-2.35

  • cd /Users/kwangjo/Documents/ns/ns-2.35
  • ./configure
  • make
  • ##For accurate simulation you should pass validation tool.
  • ./validate
You should get report like this :
   "validate overall report: all tests passed"

Now you get compiled ns2 simulator on your mac.

RPI is not good handling DHT11

Hello? This is failure story about converting c code to python. There is GPIO controlling library on Python such as RPI, wiringPI. But...