在ns-3中 允许和禁止例子的执行

在ns-3中 允许和禁止例子的执行

首先介绍一种最简单允许 examples 和 tests的方法:
$./waf configure --enable-examples --enable-tests
$./waf build
就OK了。

具体查看当前哪些例子可以执行,见:http://blog.csdn.net/barcodegun/article/details/6899522


其他方法见下面:
===============================
有三种方法:
1.当一次使用 build.py 运行
禁止:  $ ./build.py
允许:   $ ./build.py --enable-examples --enable-tests

2.第一次使用 waf 运行build

禁止:
$./waf configure
$./waf build

允许:
$./waf configure --enable-examples --enable-tests
$./waf build


3.build好之后,使用waf 进行ns-3配置 configuration   
enable/disable examples and tests using the ns-3 configuration file
定义.ns3rc这个文件
$cp utils/.ns3rc .   
//从utils目录中复制到ns根目录
比如,我的安装目录是~/repos/ns-3-allinone/ns-3-dev/
把 ~/repos/ns-3-allinone/ns-3-dev/utils/.ns3rc  复制到 ~/repos/ns-3-allinone/ns-3-dev/.ns3rc
注意, 以.开头的文件是隐藏文件,在 shell 环境中 $ ls -al 命令可以查看。
然后修改  ~/repos/ns-3-allinone/ns-3-dev/ 目录下 .ns3rc文件  $ vim .ns3rc

禁止: # Set this equal to true if you want examples to be run.
examples_enabled = False

# Set this equal to true if you want tests to be run.
tests_enabled = False

允许:
# Set this equal to true if you want examples to be run.
examples_enabled = True

# Set this equal to true if you want tests to be run.
tests_enabled = True


修改这个文件,然后:
$./waf configure
$./waf build



测试:
$ ./test.py -c core

$./waf --run hello-simulator
显示: Hello Simulator


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值