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.

댓글 3개:

  1. You don't have to do those "ln -s" stuffs, just use these commands when you configure the source code:
    To configure otcl:
    ./configure --with-tcl-ver=8.5.11 --with-tk-ver=8.5.11
    To configure tcltcl:
    ./configure --with-otcl=../otcl-1.14 --with-tcl-ver=8.5.11 --with-tk-ver=8.5.11
    To configure ns:
    ./configure --with-otcl=../otcl-1.14 --with-tclcl=../tclcl-1.20 --with-tcl-ver=8.5.11 --with-tk-ver=8.5.11

    These commands allow the configure scripts to search for the required libs in the parent directory.
    It is not proper to make a soft-link from a user directory to a root directory.

    답글삭제
  2. Yes you are right, But it does not work properly in my mac (If it proper work in my mac, all-in-one package should be installed).
    Many mac os user(after snow leopard) suffer from same problem. I solve problem using symbolic link, and it properly installed.
    And It is not harm to your system because it just symbolic link( just single file for linking).

    답글삭제
  3. 제가 사실은 내가이 블로그에 처음에 방문에 저는 매우 도움이 읽고 볼 수있는 정보, 좋은 물건 찾아 블로그를 볼 정말 좋은 오전, 내가 감사 모든 친구들과 내 페이스 북에 공유 갈거야 하고 유지
    http://www.ptvsports.pk/

    답글삭제

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...