NS2安装笔记 - NS2.34 Under Ubuntu9.10.doc_第1页
NS2安装笔记 - NS2.34 Under Ubuntu9.10.doc_第2页
NS2安装笔记 - NS2.34 Under Ubuntu9.10.doc_第3页
NS2安装笔记 - NS2.34 Under Ubuntu9.10.doc_第4页
NS2安装笔记 - NS2.34 Under Ubuntu9.10.doc_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

NS2安装笔记 - NS2.34 Under Ubuntu9.10 分类: NS2 2010-01-02 08:58 1934人阅读 评论(1) 收藏 举报参考书推荐:NS与网络模拟 - 徐雷鸣等1. NS2下载 官网提供最新版本的下载: /nsnam/ns/ , 我下载的版本是NS2.34, 下载的文件为ns-allinone-2.34.tar.gz 。 下载完后将它解压缩到主文件夹下(我的是 /home/yanna): tar xvfz ns-allinone-2.34.tar.gz2. 需要用到的软件包 build-essentialtcl8.4 tcl8.4-dev tk8.4 tk8.4-devlibxmu-devlibxmu-headerssudo apt-get install g+3. 安装 cd /home/yanna/ns-allinone-2.34 sudo ./install4. 出错处理ld -shared -o libotcl.so otcl.ootcl.o: In function OTclDispatch:/home/yanna/ns-allinone-2.34/otcl-1.13/otcl.c:495: undefined reference to _stack_chk_fail_localotcl.o: In function Otcl_Init:/home/yanna/ns-allinone-2.34/otcl-1.13/otcl.c:2284: undefined reference to _stack_chk_fail_localld: libotcl.so: hidden symbol _stack_chk_fail_local isnt definedld: final link failed: Nonrepresentable section on outputmake: * libotcl.so 错误 1cd ns-2.34; ./validateotcl-1.13 make failed! Exiting .See /nsnam/ns/ns-problems.html for problems 在官网上有解决方案,应该是个BUG,会在以后版本中解决:For Ubuntu 9.10 (karmic), you may encounter this error in the linking of otcl:otcl.o: In function OTclDispatch:/home/ns/ns-allinone-2.34/otcl/otcl.c:495: undefined reference to _stack_chk_fail_localotcl.o: In function Otcl_Init:/home/ns/ns-allinone-2.34/otcl/otcl.c:2284: undefined reference to _stack_chk_fail_localld: libotcl.so: hidden symbol _stack_chk_fail_local isnt definedld: final link failed: Nonrepresentable section on outputmake: * libotcl.so Error 1This error is because the linker being used is ld -shared instead of gcc -shared. If you edit one line in otcl-1.13/configure, and rerun install , it should work:- configure.orig 2009-11-02 12:14:52.556167945 -0800+ configure 2009-11-02 12:17:28.966706099 -0800 -6301,7 +6301,7 ;Linux*)SHLIB_CFLAGS=-fpic- SHLIB_LD=ld -shared+ SHLIB_LD=gcc -sharedSHLIB_SUFFIX=.soDL_LIBS=-ldlSHLD_FLAGS=This will be fixed in future revisions of ns-2. 改完后重新安装。5. 配置环境变量 安装完成后会看到修改环境变量的提示:Please put /home/yanna/ns-allinone-2.34/bin:/home/yanna/ns-allinone-2.34/tcl8.4.18/unix:/home/yanna/ns-allinone-2.34/tk8.4.18/unixinto your PATH environment; so that youll be able to run itm/tclsh/wish/xgraph.IMPORTANT NOTICES:(1) You MUST put /home/yanna/ns-allinone-2.34/otcl-1.13, /home/yanna/ns-allinone-2.34/lib,into your LD_LIBRARY_PATH environment variable.If it complains about X libraries, add path to your X librariesinto 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/yanna/ns-allinone-2.34/tcl8.4.18/library into your TCL_LIBRARY environmentalvariable. Otherwise ns/nam will complain during startup.After these steps, you can now run the ns validation suite withcd ns-2.34; ./validateFor trouble shooting, please first read ns problems page/nsnam/ns/ns-problems.html. Also search the ns mailing list archivefor related posts . 回到主文件夹,修改bash配置文件.bashrc:sudo gedit /.bashrc 在文件最后加上:PATH=$PATH:/home/yanna/ns-allinone-2.34/bin:/home/yanna/ns-allinone-2.34/tcl8.4.18/unix:/home/yanna/ns-allinone-2.34/tk8.4.18/unixLD_LIBRARY_PATH=/home/yanna/ns-allinone-2.34/otcl-1.13:/home/yanna/ns-allinone-2.34/libTCL_LIBRARY=$TCL_LIBRARY:/home/yanna/ns-allinone-2.34/tcl8.4.18/library6. 安装验证 安装结束后的提示中也告诉我们如何验证是否正确安装: cd ns-2.34 ./validate 另外,也可以打开一个新终端进行试运行: 输入ns,如果显示一个%则说明已正确安装。如果提示“command not found”则重新启动试试。 安装Ubuntu 11.04操作系统只是简单的一步,ns2的安装才是令人头大的关键。按照网上的指示,似乎安装ns2很简单,只要解压、安装就能成功,可事实是,由于我下载的版本很高,很多文件并没有相应的更新,在安装过程中,要手动修改文件。1、更新Ubuntu系统文件,虽然系统是最新版本的,但是不代表里面的文件都是最新的,需要更新。打开Ubuntu的终端,里面依次输入命令sudo apt-get updatesudo apt-get upgradesudo apt-get dist-upgrade即可。这里首次采用sudo时,需要用户密码,也就是安装Ubuntu时设置的。2、为了更好的安装ns2,还需要进行一些package的安装,打开终端,输入sudo apt-get install build-essentialsudo apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-devsudo apt-get install libxmu-dev libxmu-headers3、在/projects/nsnam/files/上可以下载到ns-allinone-2.34.tar.gz,版本,将其放在/home/yourfile/下,这里yourfile是用户自己定义的文件名,在终端中输入tar xvfz ns-allinone-2.34.tar.gzcd /home/yourfile/ns-allinone-2.34./install4、上述安装会出现两个问题,导致ns2安装不能成功,这也是以前的版本为出现过的。这两个问题都需要手动修改一些文件。问题1、上述安装结束后,出现tcl8.4.18 make failed! Exiting!搜索网上解决方案如下,cd/home/yourfile/ns-allinone-2.34cd otcl-1.13sudo geditconfigure.in在弹出的窗口文件中的77行处的SHLIB_LD=ld-shared 改为 SHLIB_LD=gcc-shared后保存退出。sudo geditconfigure在弹出的窗口文件中的6304行处的SHLIB_LD=ld-shared 改为SHLIB_LD=gcc-shared 后保存退出。问题2、出现mobile/nakagami.cc:183:73: error: cannot callconstructor mobile/nakagami.cc:185:67: error: for a function-style cast, remove the redundant :GammaRandomVariablemake: * mobile/nakagami.o 等,cd/home/yourfile/ns-allinone-2.34cd ns-2.34sudo gedittools 在弹出的窗口文件中找到219行,删除 :GammaRandomVariablesudo geditmobile 在弹出的窗口文件中找到183行,删除 :ErlangRandomVariable,找到185行,删除 :GammaRandomVariable5、至此,重新运行./install应该能顺利安装ns2,此时需呀地环境变量进行路径的设置sudo gedit .bashrc在弹出的窗口文件最后输入exportPATH=$PATH:/home/yourfile/ns-allinone-2.34/bin:/home/yourfile/ns-allinone-2.34/tcl8.4.18/unix:/home/yourfile/ns-allinone-2.34/tk8.4.18/unixexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/yourfile/ns-allinone-2.34/otcl-1.13:/home/yourfile/ns-all

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论