日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

NS2安装笔记 - Ubuntu9.10

發布時間:2023/12/15 Ubuntu 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 NS2安装笔记 - Ubuntu9.10 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

轉帖:http://blog.csdn.net/wuyanna1989/archive/2010/01/02/5119823.aspx

?

參考書推薦:《NS與網絡模擬》 - 徐雷鳴等

1. NS2下載

?? 官網提供最新版本的下載: http://www.isi.edu/nsnam/ns/ , 我下載的版本是NS2.34, 下載的文件為ns-allinone-2.34.tar.gz 。

?? 下載完后將它解壓縮到主文件夾下(我的是 /home/yanna):

?? tar xvfz ns-allinone-2.34.tar.gz

2. 需要用到的軟件包

?? build-essential

???tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev

???libxmu-dev

3. 安裝

?? cd /home/yanna/ns-allinone-2.34

?? sudo ./install

4. 出錯處理

ld -shared -o libotcl.so otcl.o
otcl.o: In function `OTclDispatch':
/home/yanna/ns-allinone-2.34/otcl-1.13/otcl.c:495: undefined reference to `__stack_chk_fail_local'
otcl.o: In function `Otcl_Init':
/home/yanna/ns-allinone-2.34/otcl-1.13/otcl.c:2284: undefined reference to `__stack_chk_fail_local'
ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined
ld: final link failed: Nonrepresentable section on output
make: *** [libotcl.so] 錯誤 1cd ns-2.34; ./validate
otcl-1.13 make failed! Exiting ...
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

?? 在官網上有解決方案,應該是個BUG,會在以后版本中解決:

For? Ubuntu 9.10 ?(karmic), you may? encounter this error ?in the linking of otcl:

otcl.o: In function `OTclDispatch':
/home/ns/ns-allinone-2.34/otcl/otcl.c:495: undefined reference to `__stack_chk_fail_local'
otcl.o: In function `Otcl_Init':
/home/ns/ns-allinone-2.34/otcl/otcl.c:2284: undefined reference to `__stack_chk_fail_local'
ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined
ld: final link failed: Nonrepresentable section on output
make: *** [libotcl.so] Error 1

This error is because the linker being used is "ld -shared" instead of "gcc -shared".?
If you edit one line in otcl-1.13/configure, and rerun install , it should work:

--- configure.orig 2009-11-02 12:14:52.556167945 -0800
+++ configure 2009-11-02 12:17:28.966706099 -0800
@@ -6301,7 +6301,7 @@
;;
Linux*)
SHLIB_CFLAGS="-fpic"
- SHLIB_LD="ld -shared"
+ SHLIB_LD="gcc -shared"
SHLIB_SUFFIX=".so"
DL_LIBS="-ldl"
SHLD_FLAGS=""

This will be fixed in future revisions of ns-2.?

改完后重新安裝。 5. 配置環境變量 安裝完成后會看到修改環境變量的提示: Please put /home/yanna/ns-allinone-2.34/bin:/home/yanna/ns-allinone-2.34/tcl8.4.18/unix:/home/yanna/ns-allinone-2.34/tk8.4.18/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.

IMPORTANT NOTICES:

(1) You MUST put /home/yanna/ns-allinone-2.34/otcl-1.13, /home/yanna/ns-allinone-2.34/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 /home/yanna/ns-allinone-2.34/tcl8.4.18/library into your TCL_LIBRARY environmental
variable. Otherwise ns/nam will complain during startup.


After these steps, you can now run the ns validation suite with
cd ns-2.34; ./validate

For trouble shooting, please first read ns problems page
http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive
for related posts . 回到主文件夾,修改bash配置文件.bashrc: sudo gedit .bashrc 在文件最后加上:
PATH="$PATH:/home/yanna/ns-allinone-2.34/bin:/home/yanna/ns-allinone-2.34/tcl8.4.18/unix:/home/yanna/ns-allinone-2.34/tk8.4.18/unix"
LD_LIBRARY_PATH="/home/yanna/ns-allinone-2.34/otcl-1.13:/home/yanna/ns-allinone-2.34/lib"

TCL_LIBRARY="$TCL_LIBRARY:/home/yanna/ns-allinone-2.34/tcl8.4.18/library"
6. 安裝驗證 安裝結束后的提示中也告訴我們如何驗證是否正確安裝: cd ns-2.34 ./validate 另外,也可以打開一個新終端進行試運行: 輸入ns,如果顯示一個%則說明已正確安裝。如果提示“command not found”則重新啟動試試。

總結

以上是生活随笔為你收集整理的NS2安装笔记 - Ubuntu9.10的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。