皮皮彭的blog

用脚趾头想一想

« 我毕业了我的ubuntu 8.10安装配置经验(Intrepid Ibex) »

ubuntu8.04下安装配置ns

1.下载ns 2.33安装包

首先从网上下载ns 2.33 all in one安装包(http://nchc.dl.sourceforge.net/sourceforge/nsnam/ns-allinone-2.33.tar.gz),最好在sourceforge页面选择合适镜像进行下载(如澳大利亚的很快),下载完成后将其放在你想要存放的目录下。
之后在终端下解压:tar –xzvf ns-allinone-2.33.tar.gz,这样安装包内的文件就被解压到了该目录下。cd至该目录下。

2.必要的依赖包,一个都不能少

sudo apt-get install -f build-essential libxt-dev libxt6 libsm-dev libsm6 libice-dev libice6 libxmu-dev  tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev

3. 安装ns 2.33

./install

安装过程耗时不少,若成功,最后显示:
Ns-allinone package has been installed successfully.
Here are the installation places:
tcl8.4.18: /home/tnt/ns-allinone-2.33/{bin,include,lib}
tk8.4.18: /home/tnt/ns-allinone-2.33/{bin,include,lib}
otcl: /home/tnt/ns-allinone-2.33/otcl-1.13
tclcl: /home/tnt/ns-allinone-2.33/tclcl-1.19
ns: /home/tnt/ns-allinone-2.33/ns-2.33/ns
nam: /home/tnt/ns-allinone-2.33/nam-1.13/nam
xgraph: /home/tnt/ns-allinone-2.33/xgraph-12.1
gt-itm: /home/tnt/ns-allinone-2.33/itm, edriver, sgb2alt, sgb2ns, sgb2comns, sgb2hierns

Please put /home/tnt/ns-allinone-2.33/bin:/home/tnt/ns-allinone2.33/tcl8.4.18/unix:/home/tnt/ns-allinone-2.33/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/tnt/ns-allinone-2.33/otcl-1.13, /home/tnt/ns-allinone-2.33/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
If you are using sh, you can set it like:
export LD_LIBRARY_PATH=

(2) You MUST put /home/tnt/ns-allinone-2.33/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.33; ./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.

4. 按照提示,配置环境变量

输入:gedit  ~/.bashrc ,将下面的代码加入.bashrc 文件的尾部。

下面是代码例子: (改动相应的目录和版本号,其它的地方不要修改)
export PATH="$PATH:/home/nsuser/ns-allinone-2.33/bin:/home/nsuser/ns-allinone-2.33/tcl8.4.18/unix:/home/nsuser/ns-allinone-2.33/tk8.4.18/unix"

export LD_LIBRARY_PATH="$LD_LIBRARY:/home/nsuser/ns-allinone-2.33otcl-1.13:/home/nsuser/ns-allinone-2.33/lib"

export TCL_LIBRARY="$TCL_LIBRARY:/home/nsuser/ns-allinone-2.33/tcl8.4.18/library"

完成后,在终端中输入下面代码: source ~/.bashrc 应用刚才加入的环境变量。

5. 输入:ns

若出现提示符%,表示ns安装成功,

如果出现这样的错误:你在终端下键入“ns”,可能会出现下面的错误提示: The program 'ns' is currently not installed. You can install it by typing: sudo apt-get install host '''(不要安装host)''' Make sure you have the 'universe' component enabled bash: ns: command not found
这是因为你的环境变量尚未设置好。确定你的~/.bashrc文件设置正确,并被写入进~ /.bashrc中了,然后重启电脑。

6. 还可以验证NS2。进入终端输入cd /ns-allinone-2.33/ns-2.33,./validate(这可能会花相当相当长一段时间)。

验证结束你将会看到如下信息:
These messages are NOT errors and can be ignored:
warning: using backward compatibility mode
This test is not implemented in backward compatibility mode

validate overall report: all tests passed

7. sudo apt-get install gawk

(for gawk)

  sudo apt-get install gnuplot

(for gnuplot)

 

8.调试工具tcldebug的安装:

参考:http://nsnam.isi.edu/nsnam/index.php?title=Installing_tcl-debug_for_ns-allinone-2.31&redirect=no

1).下载 tcl-debug( 地址 http://expect.nist.gov/tcl-debug/tcl-debug.tar.gz),以版本2.33为例,解压到ns-allinone-2.33目录下面。

2).

$ cd ~/ns-allinone-2.33/tcl-debug-2.0$ $ ./configure --with-tcl=/home/pengkuny/ns-allinone-2.33/tcl8.4.18/unix/ #配置并且编译tcl-debug$ make
3).$ cd ~/ns-allinone-2.33/ns-2.33$ ./configure --with-tcldebug  #重新配置NS-2以便启用tcl-debug$ make clean #删除以前的编译纪录 $ make #重新编译NS-2

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

网站分类

最新评论及回复

最近发表

Search

站点统计

  • 文章总数:114
  • 评论总数:92
  • 引用总数:0
  • 浏览总数:129753
  • 留言总数:19
  • 当前主题:Default主题
  • 当前样式:default2

来源列表

图标汇集

  • RainbowSoft Studio Z-Blog
  • RainbowSoft Studio Z-Blog
  • 本站支持WAP访问
  • 订阅本站的 ATOM 1.0 新闻聚合
  • 订阅本站的 RSS 2.0 新闻聚合

热文排行使用

Powered By Z-Blog 1.8 Spirit Build 80605

版权所有 2007-2008 © 皮皮彭的blog. 保留一切权利. 皖ICP备07009737号.