This HOWTO covers installation on Ubuntu Linux.
[소스 다운 받기]
$ tar xzf ns-allinone-2.28.tar.gz
[GDB debugger를 위한 수정]
1. install 파일 수정
$ vim install
1.1 408번 줄에 더하기 --enable-synbols
./configure --enable-gcc --disable-shared --prefix=$CUR_PATH || die "tcl8.3.2 configuration failed! Exiting ..." becomes,
./configure --enable-symbols --enable-gcc --disable-shared --prefix=$CUR_PATH || die "tcl8.3.2 configuration failed! Exiting ..."
1.2 498번 줄에 더하기 ?enable-debug
./configure || die "tclcl-$TCLCLVER configuration failed! Exiting ..." becomes,
./configure --enable-debug || die "tclcl-$TCLCLVER configuration failed! Exiting ..."
$ vim Makefile.in
82번째 줄에 더하기 -g
3.1 X11/Intrinsic.h 는 otcl1-9 설치시 필요하므로
3.2 /usr/X11R6/include/X11/Xmu/WinUtil.h는 nam-1.1에 필요함
확인 : /usr/include/X11/Xmu/WinUtil.h 에 파일 생성 안되면 아래 링크 이용 http://www.koders.com/cpp/fid8242D9080165DC6920CC93EFAD670C8209C857D0.aspx
4. xgraph Makefile수정하기$ ./configure
$ vim Makefile
4.1 85번째 줄에 더하기 -L/usr/X11R6/lib
xgraph_LDADD = $(ADDITIONAL_LIBS) $(X_LIBS) $(X_PRE_LIBS) $(X_EXTRA_LIBS) -lX11 -lm becomes,
xgraph_LDADD = $(ADDITIONAL_LIBS) $(X_LIBS) $(X_PRE_LIBS) $(X_EXTRA_LIBS) -L/usr/X11R6/lib -lX11 -lm
5. gt-itm 은 sgb2ns에 필요함
5.1 sgb설치를 위한 apt수정
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
5.2 sgb 다운 받기
6. eval 파일 수정
$ vim eval.c
162번째 둘줄로 나누어져 있는 아래 내용을 한줄로 수정
gt-itm 하부에 bin 디렉토리 없으면 생성
$ mkdir bin
$ cd ./gt-itm/src
$ make
8. gt-itm 와 sgb2ns 필요로 하는 라이브러리 링크 하기
$ mkdir lib
$ ln -s /usr/lib/libgb.a /root/ns-allinone-2.28/gt-itm/lib
9. 발생 가능 에러 해결
9.1 tcl 컴파일 에러
에러 메시지:syntax error near unexpected token `)' ./configure: line 7068: ` OSF*)'
해결 : http://mailman.isi.edu/pipermail/ns-users/2006-September/057322.html
- apt-get install autoconf
- rm configure (이전 설정파일 삭제)
./autoconf
./configure
9.2 make: *** [queue/cbq.o] ## 에러 해결 하기
88 #define POWEROFTWO 16
89
90 class CBQueue; <-- 추가된 부분
91
92 class CBQClass : public Connector
46 LINK_DN = 0x0002, // downstream
47 LINK_UN = 0x0004, // undirected
48 };
49
50 class toraAgent; <-- 추가된 부분
51
52 class TORANeighbor {
53 friend class TORADest;
54 friend class toraAgent;
103 typedef list NeighborList;
104 typedef list HashList;
105 typedef list BlackList;
106
107 class DiffRoutingAgent; <-- 추가된 부분
108
109 class DiffusionCoreAgent {
110 public:
111 #ifdef NS_DIFFUSION
112 friend class DiffRoutingAgent;
10. ns컴파일 하기
$ ./install &> compile.out
11. Environmental variables.
#!/bin/sh
# LD_LIBRARY_PATH OTCL_LIB=/home/lucsp/ns-allinone-2.28/otcl-1.9 NS2_LIB=/home/lucsp/ns-allinone-2.28/lib X11_LIB=/usr/X11R6/lib export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:/usr/local/lib
# TCL_LIBRARY export TCL_LIBRARY=/home/lucsp/ns-allinone-2.28/tcl8.4.5/library:/usr/lib
# PATH XGRAPH=/home/lucsp/ns-allinone-2.28/bin:/home/lucsp/ns-allinone-2.28/tcl8.4.5/unix:/home/lucsp/ns-allinone-2.28/tk8.4.5/unix
PATH=$PATH:$XGRAPH:/home/lucsp/ns-allinone-2.28/ns-2.28/
OTCL_LIB=/root/ns-allinone-2.28/otcl-1.9 NS2_LIB=/root/ns-allinone-2.28/lib X11_LIB=/usr/X11R6/lib export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:/usr/local/lib # TCL_LIBRARY export TCL_LIBRARY=/root/ns-allinone-2.28/tcl8.4.5/library:/usr/lib # PATH XGRAPH=/root/ns-allinone-2.28/bin:/root/ns-allinone-2.28/tcl8.4.5/unix:/root/ns-allinone-2.28/tk8.4.5/unix export PATH=$PATH:$XGRAPH:/root/ns-allinone-2.28/bin:/root/ns-allinone-2.28/tcl8.4.5/unix:/root/ns-allinone-2.28/tk8.4.5/unix
작성 : 2006.6.07 by 임헌정
http://www.4ellene.net
참고http://www.ics.mq.edu.au/~phillipl/documents/NS-2.28AllInOne_HOWTO.html

Comments List