HOW TO install nam for ns2 on debian

Debian is convinent to install software packages for the tool aptl. Like many other packages ,we can use “apt-get install ns2″ to install the ns2.

Another package nam can be installed in the same way like “apt-get install nam”,but it can not work correctly.The error message is like

random() called in nam
Random is not portable, please use Random::uniform()instead.

It is necessary to edit the source code and reinstall the package.So we can get the source code from the debian server through “apt-get source nam”. Here ,maybe you have to install the dpkg-dev.

Using grep random/(/) *.cc, we can find the definition of the function random() in random.cc. We should modify it like this,just like the error message have reffered.

random()

{
return (long)Random::uniform();
/*printf("random() called in ns./nRandom is not portable, please use Random::uniform() instead./n");
abort();*/
}
/* It is borrowed from L.Wood at http://www.isi.edu/nsnam/archive/ns-users/webarch/1999/msg02165.html

After the modification is finished ,we should configure the code use “./configure”. Unfortrunately, we get another several errors. Now read the error message carefully,we discovered that we should install several packages ” tcl8.5-dev;tk8.5-dev;libotcl1-dev;tclcl-dev”.

Then “./configure” again ,we can finish it smoothly.After the command “make” and “make install “,the nam package can be installed succesfully.

It is useful to copy the nam file which located in /usr/local/bin/ to /usr/bin/ in order to use the nam command directly and globally.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值