Ubuntu上安装ns2-2.34

步骤1

下载ns-allinone-2.34

$ tar zxf ns-allinone-2.34.tar.gz

步骤2

sudo apt-get install build-essential    # GCC

sudo apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev   # for TCL and TK

sudo apt-get install libxmu-dev libxmu-headers    # for nam

步骤3

./install

出现的错误

问题1

ld -shared-o libotcl.so otcl.o
otcl.o: Infunction `OTclDispatch':
/usr/ns-allinone-2.34/otcl-1.13/otcl.c:495:undefined reference to `__stack_chk_fail_local'
otcl.o: Infunction `Otcl_Init':
/usr/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'tdefined
ld: finallink failed: Nonrepresentable section on output
make: ***[libotcl.so]错误1
otcl-1.13make failed! Exiting ...

$ cd ns-allinone-2.34/otcl-1.13

$ gedit configure.in

把77行处的:
SHLIB_LD="ld -shared",
改为;

SHLIB_LD="gcc -shared"

$ gedit configure

将6304行处的:

SHLIB_LD="ld -shared"

改为:

SHLIB_LD="gcc -shared"

问题2

tools/ranvar.cc: In member function ‘virtual double GammaRandomVariable::value()’:

tools/ranvar.cc:219:70: error: cannot call constructor ‘GammaRandomVariable::GammaRandomVariable’ directly

tools/ranvar.cc:219:70: error:  for a function-style cast, remove the redundant ‘::GammaRandomVariable’

make: *** [tools/ranvar.o]错误1

Ns make failed!

See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

在ns-allinone-2.33/ ns-2.33/tools文件夹下,找到报错提示中的ranvar.cc文件,打开找到对应的219行删除::GaammaRandomVariable,保存,

即:将219行的

return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);

改为:

return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);

问题3

mac/mac-802_11Ext.h: In member function ‘u_int32_t PHY_MIBExt::getHdrLen11()’:
mac/mac-802_11Ext.h:176:19: error: expected primary-expression before ‘struct’
mac/mac-802_11Ext.h:176:41: error: ‘dh_body’ was not declared in this scope
mac/mac-802_11Ext.h:176:51: error: ‘offsetof’ was not declared in this scope

在ns-allinone-2.34\ns-2.34\mac\mac-802_11Ext.h 文件添加#include <cstddef>
然后重新安装

问题4

mobile/nakagami.cc: In member function ‘virtual double Nakagami::Pr(PacketStamp*, PacketStamp*, WirelessPhy*)’:

mobile/nakagami.cc:183:73: error: cannot call constructor ‘ErlangRandomVariable::ErlangRandomVariable’ directly

mobile/nakagami.cc:183:73: error:  for a function-style cast, remove the redundant ‘::ErlangRandomVariable’

mobile/nakagami.cc:185:67: error: cannot call constructor ‘GammaRandomVariable::GammaRandomVariable’ directly

mobile/nakagami.cc:185:67: error:  for a function-style cast, remove the redundant ‘::GammaRandomVariable’

在ns-allinone-2.34/ ns-2.34/ mobile文件夹下,找到报错提示中的nakagami.cc文件,打开找到对应的183行删除::ErlangRandomVariable,保存,

即:将183行的

resultPower = ErlangRandomVariable::ErlangRandomVariable(Pr/m, int_m).value();

改为:

resultPower = ErlangRandomVariable(Pr/m, int_m).value();

在ns-allinone-2.34/ ns-2.34/ mobile文件夹下,找到报错提示中的nakagami.cc文件,打开找到对应的185行删除::GammaRandomVariable,保存,

即:将185行的

resultPower = GammaRandomVariable::GammaRandomVariable(m, Pr/m).value();

改为:

resultPower = GammaRandomVariable(m, Pr/m).value();

步骤4

设置环境变量

# gedit ~/.bashrc

export LD_LIBRARY_PATH=/root/NS2/ns-allinone-2.34/otcl-1.13:/root/NS2/ns-allinone-2.34/lib:$LD_LIBRARY_PATH
export TCL_LIBRARY=/root/NS2/ns-allinone-2.34/tcl8.4.18/library
export PATH=/root/NS2/ns-allinone-2.34/bin:/root/NS2/ns-allinone-2.34/tcl8.4.18/unix:/root/NS2/ns-allinone-2.34/tk8.4.18/unix:$PATH

Ubuntu上安装ns2-2.34的更多相关文章

  1. 使用PPA在Ubuntu上安装php5.4~5.6,7

    使用PPA在Ubuntu上安装php5.4~5.6,7 sudo apt-get install software-properties-common sudo add-apt-repository ...

  2. 在Ubuntu上安装Chrome Driver和Firefox Driver

    在Ubuntu上安装Chrome Driver和Firefox Driver 此文章只介绍Chrome Driver(Firefox Driver和该步骤相同) 下载链接:http://chromed ...

  3. [异常解决] ubuntu上安装JLink驱动遇到的坑及给后来者的建议

    一.前言 最近将整个电脑格式化,改成了linux操作系统 希望这样能让自己在一个新的世界探索技术.提升自己吧- win上的工具用多了,就不想变化了- 继上一篇<ubuntu上安装虚拟机遇到的问题 ...

  4. Ubuntu上安装Robomongo及添加到启动器

    到目前为止,Robomongo仍是MongoDB最好的客户端管理工具,如需在Ubuntu上安装Robomongo,可直接从官网下载.tar.gz压缩包进行解压,然后直接运行bin目录下的robomon ...

  5. 在 Ubuntu 上安装 Android Studio

    在 Ubuntu 上安装 Android Studio http://www.linuxidc.com/Linux/2013-05/84812.htm 打开terminal,输入以下命令 sudo a ...

  6. Ubuntu上安装Karma失败对策

    在Ubuntu上安装Karma遇到超时 timeout 错误.Google了一下,国外的码农给了一个快捷的解决方案,实测可行,贴在这里: sudo apt-get install npm nodejs ...

  7. 在Ubuntu上安装LAMP服务器

    1.安装Ubuntu上安装LAMP apt-get install lamp-server^ 2.安装过程中设置MySql密码 3.测试 创建index.php var/www/html/index. ...

  8. [译]How to Setup Sync Gateway on Ubuntu如何在ubuntu上安装sync-gateway

    参考文章https://hidekiitakura.com/2015/03/21/how-to-setup-sync-gateway-on-ubuntudigitalocean/ 在此对作者表示感谢 ...

  9. 在Ubuntu上安装JDK、Ant、Jmeter和Jenkins

    一.前期准备 1. 在win7下载VMware.Ubuntu(用迅雷下比较快) 2. 安装完VMware后新建虚拟机,选择iso: 3. 具体配置参考如下,至此Ubantu安装完成 二.在Ubuntu ...

随机推荐

  1. 关于ES、PES、PS/TS 码流

    一.基本概念 )ES   ES--Elementary  Streams  (原始流)是直接从编码器出来的数据流,可以是编码过的视频数据流(H.264,MJPEG等),音频数据流(AAC),或其他编码 ...

  2. Keynote of Python III

    [Keynote of Python III] 1.许多大型网站是用Python开发的,例如YouTube.Instagram,还有国内的豆瓣.很多大公司,包括Google.Yahoo等,甚至NASA ...

  3. Codeforces Round #243

    CF 243  DIV1 & DIV2 DIV2的A和B都太水,直接暴力搞就可以的. DIV2A /* ******************************************** ...

  4. J. Bottles 二维费用背包问题

    http://codeforces.com/contest/730/problem/J 3 4    36    1 90   45   40 其实可以知道,选出多少个瓶子呢?是确定的,当然选一些大的 ...

  5. PHP 数组函数整理

    如果你已经使用了一段时间PHP的话,那么,你应该已经对它的数组比较熟悉了——这种数据结构允许你在单个变量中存储多个值,并且可以把它们作为一个集合进行操作. 经常,开发人员发现在PHP中使用这种数据结构 ...

  6. Scrum会议(Beta版本)

    组名:天天向上 组长:王森 组员:张政.张金生.林莉.胡丽娜 代码地址:HTTPS:https://git.coding.net/jx8zjs/llk.git SSH:git@git.coding.n ...

  7. 【转载】PHP.INI配置:Session配置详细说明教程

    网上有很多PHP.INI文件配置的中文说明,但是对于PHP初学者来说在进行PHP运行环境搭建配置时还是容易一头雾水,今天换一种角度来分享如何进行php.ini配置,以求达到解决实际问题的效果,开篇以P ...

  8. 用sql从一张表更新数据到另外一张表(多表数据迁移)

    update TBL_1 A, TBL_2 B, TBL_3 Cset a.email=c.email_addrwhere a.user_id=b.user_id and b.un_id=c.un_i ...

  9. python工具的安装

    下载: python安装包:python-2.7.3.msi pywin32-218.win32-py2.7.exe setuptools安装包:setuptools-0.6c11.win32-py2 ...

  10. framebuff 显示子系统

     #include <unistd.h> #include <stdio.h> #include <fcntl.h> #include <linux/fb.h ...