설치에 앞서 :

우분투의 apt-get을 통한 패키지 다운로드는 /etc/apt/source.list에 등록 되어 있는 서버의 주소로 부터 해당 패키지를 검색하여 설치 된다.

그러므로, 많은 서버의 주소가 있을 수록, 설치 할 수 있는 패키지의 갯수는 늘어날 것이다. 물론 서버 한개가 가지고 있는 패키지 갯수가 많으므로, 보통의 패키지는 설치 하는데 찾지 못하는 경우는 드물 것이다.

글 내용 중 apt-get을 하여 해당 패키지를 검색 했을 때, 찾지 못하는 경우, 기존 source.list를 글 중간 쯤에 있는 source.list 내용으로 바꾸어 시도 해 보도록 하자.

그럼, 일단 NS2 2.29를 받자

wget http://www.isi.edu/nsnam/dist/ns-allinone-2.29.tar.gz or http://jaist.dl.sourceforge.net/sourceforge/nsnam/ns-allinone-2.30.tar.gz

설정의 일관성을 위해 이 파일을 자신의 홈 디렉토리에 옮겨 놓도록 하자.

root인        경우  : mv ./ns-allinone-2.28.tar.gz /root

일반유저인 경우 : mv ./ns-allinone-2.28.tar.gz /home/any

    - 편의상 유저는 any로 하며 일반유저의 기준으로 한다.

압축을 풀고

     

$ cd /home/any

$ tar zxf ns-allinone-2.29.tar.gz

NS2 설치의 최적화를 위하여 NS2 진행을 잠시 보류 한다.

필요한 라이브러리 설치

   

$ apt-get install -f libxt-dev libxt6 libsm-dev libsm6 libice-dev libice6

$ apt-get install libx11-dev

    - 이 패키지를 설치하지 않고, ns2를 인스톨 하게 되면

    - XLib 관련 헤더파일이 없다고 xgraph.c 파일을 컴파일 할 때 오류가 나올 것이다. $ apt-get install gcc g++ make (유분투 최초 설치자라면..)

NS2 2.29버젼은 GCC 4.0이상에 최적화 되어 있다..하위버젼에서 잘 돌아갈수도 있으나..

GCC 버젼 또한 맞춰 주도록 하자.

단, 아래의 사이트는 기존 GCC 버젼을 업그레이드 하는 것이므로, GCC 3.0이상 버젼이 설치 되어 있어야 한다.

설치 되어 있지 않다면, apt-get install gcc라 치면 자동으로 설치 될 것이다.

GCC 설치

  $ wget ftp://ftp.dti.ad.jp/pub/lang/gcc/releases/gcc-4.1.1/gcc-4.1.1.tar.bz2

  $ cd gcc-4.1.1

  $ ./configure

  $ make && make install

만약 설치 도중 Texinfo 파일 관련 에러가 발생한다면, Texinfo package 또한 설치 해야 된다

apt-get install texinfo로 하면 된다.

다시 ./configure 하고 make를 시도 해야 정상적으로 설치 될 것이다.

마지막으로 gcc 버젼을 확인한다.

   

$ gcc --version

g++ (GCC) 4.1.1

Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

이제 본격적으로 NS 설치 관련 환경설정을 해 보자.

xgraph Makefile의 파일을 변경한다.

   

$  cd /home/any/ns-allinone-2.29
$ cd xgraph-12.1
$ ./configure
$ vi Makefile

Add -L/usr/X11R6/lib파일에서  85번째 라인을 수정 (NS2.29 버젼의 경우를 강조한다.)  

xgraph_LDADD = $(ADDITIONAL_LIBS) $(X_LIBS)

                $(X_PRE_LIBS) $(X_EXTRA_LIBS) -lX11 -lm

이렇게 변경한다.

 

xgraph_LDADD = $(ADDITIONAL_LIBS) $(X_LIBS) $(X_PRE_LIBS)  

              $(X_EXTRA_LIBS) -L/usr/X11R6/lib -lX11 -lm

gt-itm는 bin 디렉토리가 만들어져 있어야 한다.  

$ cd ../gt-itm
$ mkdir bin ( 있다면 굳이 지우고 하지 않아도 된다. )
$ cd src
$ make

gt-itm 와 sgb2ns는 sgb 패키지를 요구한다.

 

apt-get install sgb

  - 만약 sgb 패키지를 찾을 수 없다는 식의 에러 메세지가 나온다면

  - apt의 sources.list를 변경할 필요가 있다.

     하는 방법은 아래와 같다.

$ vi /etc/apt/sources.list

   아래의 내용을 추가한다.

deb-src http://au.archive.ubuntu.com/ubuntu hoary main restricted

deb http://au.archive.ubuntu.com/ubuntu hoary-updates main restricted

deb-src http://au.archive.ubuntu.com/ubuntu hoary-updates main restricted

deb http://au.archive.ubuntu.com/ubuntu hoary universe

deb-src http://au.archive.ubuntu.com/ubuntu hoary universe

deb http://security.ubuntu.com/ubuntu hoary-security main restricted

deb-src http://security.ubuntu.com/ubuntu hoary-security main restricted

deb http://security.ubuntu.com/ubuntu hoary-security universe

deb-src http://security.ubuntu.com/ubuntu hoary-security universe

deb http://archive.ubuntu.com/ubuntu hoary multiverse

deb-src http://archive.ubuntu.com/ubuntu hoary multiverse

deb http://archive.ubuntu.com/ubuntu hoary-backports main universe multiverse restricted

저장하고 나와서

$apt-get update 후 위의 내용을 재시도

             

gt-itm과 sgbns의 라이브러리 중 libgb.a 파일은 ns 폴더에 있는 것이 아닌,

설치 되어 있는 라이브러리여야 한다.

정상적으로 sgb가 설치된 경우에 /usr/lib/libgb.a 파일이 존재한다.

  ln -s /usr/lib/libgb.a /home/any/ns-allinone-2.29/gt-itm/lib

이제 설치해 보자.

 

  cd /home/any/ns-allinone-2.29

  ./install

정상적인 경우라면 라이브러리 설정은 어떻게 하라는 메세지와 함께 설치가 완료 될 것이다.

이제 NS2를 위한 환경설정을 해 보자.

  cd ~ <== /home/any여야 할 것이다.

  vi ~/.bash_profile

  NS=~/ns-allinone-2.29

  export PATH=$PATH:$NS/bin:$NS/tcl.8.4.11/unix:$NS/tk8.4.11/unix

export LD_LIBRARY_PATH=$NS/otcl-1.11:$NS/lib

  export TCL_LIBRARY=$NS/tcl8.4.11/library


이제 배쉬 설정을 적용 시켜 보자

source .bash_profile

Please put /root/ns-allinone-2.30/bin:/root/ns-allinone-2.30/tcl8.4.13/unix:/root/ns-allinone-2.30/tk8.4.13/unix into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.
IMPORTANT NOTICES:
(1) You MUST put /root/ns-allinone-2.30/otcl-1.12, /root/ns-allinone-2.30/lib,   into your LD_LIBRARY_PATH environment variable.   If it complains about X libraries, add path to your X libraries   into LD_LIBRARY_PATH.   If you are using csh, you can set it like:                setenv LD_LIBRARY_PATH <paths>   If you are using sh, you can set it like:                export LD_LIBRARY_PATH=<paths>
(2) You MUST put /root/ns-allinone-2.30/tcl8.4.13/library into your TCL_LIBRARY environmental   variable. Otherwise ns/nam will complain during startup.
(3) [OPTIONAL] To save disk space, you can now delete directories tcl8.4.13   and tk8.4.13. They are now installed under /root/ns-allinone-2.30/{bin,include,lib}
After these steps, you can now run the ns validation suite with cd ns-2.30; ./validate vi /etc/profile export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/ns-allinone-2.30/otcl-1.12:/root/ns-allinone-2.30/lib export PATH=$PATH:/root/ns-allinone-2.30/bin:/root/ns-allinone-2.30/tcl8.4.13/unix:/root/ns-allinone-2.30/tk8.4.13/unix export TCL_LIBRARY=$TCL_LIBRARY:/root/ns-allinone-2.30/tcl8.4.13/library
nam 설치가 X11/Xmu/WinUtil.h 없어서 안될경우 /usr/include/X11/Xmu/WinUtil.h 에 아래 링크 파일 추가 http://www.koders.com/cpp/fid8242D9080165DC6920CC93EFAD670C8209C857D0.aspx

마지막으로 ns라고 치면 쉘의 앞 모양인 $가 %로 변하면서 interactive 모드로

전환 되는 것을 볼 수 있을 것이다.. 테스트 : ./ns-2.30/tcl/edu/hidden-terminal 의 XXX.tcl 파일 실행 : ns XXX.tcl            위 작업후 생성되는 nam 파일 실행 : nam XXX.nam [Q] install 스크립트의 L410 번의  ---enable-symbols 2 --enable-symbols 의 --- 가 3개가 아닌 2개???

출처 : http://blog.naver.com/zacronan/40027246408
2006/10/24 17:05 2006/10/24 17:05
TAG
Trackback address :: http://4ellene.net/tt/trackback/1046
  1. Phentermine pill.

    Tracked from Buy phentermine diet pill. 2008/07/18 15:15  삭제

    Phentermine. Lowest online phentermine price. Abuse phentermine. Online phentermine.

Comments List

  1. adioshun 2006/11/25 01:20

    2.28은 다음 링크 참고 : http://www.ics.mq.edu.au/~phillipl/documents/NS-2.28AllInOne_HOWTO.html

  2. adioshun 2006/11/25 01:38

    gcc 에러 보고 되고 있음 : http://blog.naver.com/etenallove/100016553174

  3. lingga 2008/04/30 19:45

    hi I want to build xgraph in SCTP wired network please can you send to me my email khalif_islamic@yahoo.com

  4. rubber duck background 2008/05/23 04:55

  5. deerskin leather gloves 2008/05/23 04:58

    嫄몄

  6. printed latex ballons 2008/05/23 05:33

  7. awesome blowjob videos 2008/05/24 01:02

  8. damien lucas porn 2008/05/24 01:10

  9. plumper stockings and heels 2008/05/24 01:20

  10. sims 2 nightlife nude patch 2008/05/24 01:25

Write a comment.

[로그인][오픈아이디란?]