mac os 10.6 10.7环境下成功搭建ns2 (ns -allinone-2.34)仿真环境

<p>首先,我想说的经历了一整天的安装ns2的痛苦折磨,终于成功地搭建好了ns2的仿真环境。本人有过在ubuntu 10.10下成功搭建ns2仿真环境的经历。但是,总体来说,在mac下还是与在ubuntu 下有很多的不同。不然,也不用折磨了我一天,为了做个记录,同时给各位同行提供一下安装的方法,本人现在详细的说下安装过程。<p>   1 确保安装了x code。<p> 2 首先,得下载ns-allinone-2.34的压缩包。这个网上能够找到链接。这里就不提供链接了。下载后,以我的为例,我的放在desktop上。然后在终端进入到desktop下,输入命令:tar xvfz ns-allinone-2.34 进行解压缩。<p>3 这是一个非常重要的步骤,就是要对ns-allinone-2.34的文件进行修改。打开方式选择小如果不修改,直接进行第4步骤(./install)的话,最后提示找不到x11 库而以失败告终。install 文件的修改按照网上的那篇 可怕的ns2世界中的博客进行。http://ns2dalingege.blogbus.com/logs/66591956.html<p>4 在该目录下./install<p>成功后出现如下类似信息。<p><br><p><br><p>into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.<br/><br><br/>IMPORTANT NOTICES:<br/><br><br/>(1) You MUST put /Users/magicstudio/desktop/ns-allinone-2.34/otcl-1.13, /Users/magicstudio/desktop/ns-allinone-2.34/lib, <br/>    into your LD_LIBRARY_PATH environment variable.<br/>    If it complains about X libraries, add path to your X libraries <br/>    into LD_LIBRARY_PATH.<br/>    If you are using csh, you can set it like:<br/><span class="Apple-tab-span" style="white-space:pre"> setenv LD_LIBRARY_PATH <paths><br/>    If you are using sh, you can set it like:<br/><span class="Apple-tab-span" style="white-space:pre"> export LD_LIBRARY_PATH=<paths><br/><br><br/>(2) You MUST put /Users/magicstudio/desktop/ns-allinone-2.34/tcl8.4.18/library into your TCL_LIBRARY environmental<br/>    variable. Otherwise ns/nam will complain during startup.<br/><br><br/><br><br/>After these steps, you can now run the ns validation suite with<br/>cd ns-2.34; ./validate<br/><br><br/>For trouble shooting, please first read ns problems page <br/>http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive<br/>for related posts.<br><p><p>剩下的事情是修改环境变量。<p><p>5 <p><br><p><p>修改两个环境变量.bashrc  .bash_profile 都是在home目录下进行的。用cd ~命令。<p>在该目录下ls -a 并没有发现这两个文件,需要自己创建。<p><p>1 .bashrc<p>echo "PATH=/Users/magicstudio/desktop/ns-allinone-2.34/bin:$PATH" > .bashrc<br><p><br><p>2 .bash_profile里的内容为:<p><p>open -e .bash_profile 后,<p>输入:<p>export PATH=$PATH:/Users/magicstudio/desktop/ns-allinone-2.34/bin:/Users/magicstudio/desktop/ns-allinone-2.34/tcl8.4.18/unix:/magicstudio/desktop/ns-allinone-2.34/tk8.4.18/unix<br/><br><br/>export LD_LIBRARY_PATH=/Users/magicstudio/desktop/ns-allinone-2.34/otcl-1.13:/Users/magicstudio/desktop/ns-allinone-2.34/lib<br/><br><br/>export TCL_LIBRARY=/Users/magicstudio/desktop/ns-allinone-2.34/tcl8.4.18/library<br><p><br><p><br><p>然后,source .bash_profile<p><br><p>就成功了!!!!!!!
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值