ubuntu12.04下安装ns-allinone-2.35

I installed Ns2.35 using ns-allinone-2.35 based on ubuntu system. So here are the steps.


1. Download ns-allinone-2.35 from http://www.isi.edu/nsnam/ns/ns-build.html or http://mac.softpedia.com/progDownload/ns-2-Download-59777.html


2. Now you have to resolve some dependencies.


sudo apt-get install binutils gcc g++ make glibc Xlibs-dev libx11-dev libxmu-dev libxmu-headers


3. Place downloaded file in home directory and type tar -xzvf ns-allinone-2.35.tar.gz
  chown -R ubuntu(your user name)  ns-allinone-2.35


4.cd ns-allinone-2.35


5. Now sudo ./install


Error encountered by me:-


In file included from linkstate/ls.cc:67:0:
linkstate/ls.h: In instantiation of ‘void LsMap::eraseAll() [with Key = int; T = LsIdSeq]’:
linkstate/ls.cc:396:28: required from here
linkstate/ls.h:137:20: error: ‘erase’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
linkstate/ls.h:137:20: note: declarations in dependent base ‘std::map, std::allocator > >’ are not found by unqualified lookup
linkstate/ls.h:137:20: note: use ‘this->erase’ instead
make: *** [linkstate/ls.o] Error 1
Ns make failed!


Solution:


a. Go to ns-allinone-2.35/ns-2.35/linkstate/


b. Now edit ls.h


In line number 137, in place of void eraseAll() { erase(baseMap::begin(), baseMap::end()); }


make it void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }


c. Save the file and again run ./install


Ns-allinone package has been installed successfully.
Here are the installation places:
tcl8.5.10: /home/ubuntu/ns-allinone-2.35/{bin,include,lib}
tk8.5.10: /home/ubuntu/ns-allinone-2.35/{bin,include,lib}
otcl: /home/ubuntu/ns-allinone-2.35/otcl-1.14
tclcl: /home/ubuntu/ns-allinone-2.35/tclcl-1.20
ns: /home/ubuntu/ns-allinone-2.35/ns-2.35/ns
nam: /home/ubuntu/ns-allinone-2.35/nam-1.15/nam
xgraph: /home/ubuntu/ns-allinone-2.35/xgraph-12.2
gt-itm:   /home/ubuntu/ns-allinone-2.35/itm, edriver, sgb2alt, sgb2ns, sgb2comns, sgb2hierns


----------------------------------------------------------------------------------


Please put /home/ubuntu/ns-allinone-2.35/bin:/home/ubuntu/ns-allinone-2.35/tcl8.5.10/unix:/home/ubuntu/ns-allinone-2.35/tk8.5.10/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.


IMPORTANT NOTICES:


(1) You MUST put /home/ubuntu/ns-allinone-2.35/otcl-1.14, /home/ubuntu/ns-allinone-2.35/lib, 
    into your LD_LIBRARY_PATH environment variable.
    If it complains about X libraries, add path to your X libraries 
    into LD_LIBRARY_PATH.
    If you are using csh, you can set it like:
setenv LD_LIBRARY_PATH <paths>
    If you are using sh, you can set it like:
export LD_LIBRARY_PATH=<paths>


(2) You MUST put /home/ubuntu/ns-allinone-2.35/tcl8.5.10/library into your TCL_LIBRARY environmental
    variable. Otherwise ns/nam will complain during startup.


6.
cd ~
sudo vim .bashrc
at the end line add :
export LD_LIBRARY_PATH=$PATH:/home/ubuntu/ns-allinone-2.35/otcl-1.14:/home/ubuntu/ns-allinone-2.35/lib
export TCL_LIBRARY=$PATH:/home/ubuntu/ns-allinone-2.35/tcl8.5.10/library


7.


After these steps, you can now run the ns validation suite with
cd ns-2.35; ./validate


For trouble shooting, please first read ns problems page 
http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive
for related posts.


8. sudo apt-get install gawk (for gawk) ,这个比较快,一分钟


9. sudo apt-get install gnuplot (for gnuplot) 这个5 分钟内可以完成
10. sudo vim /etc/environment

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/ubuntu/ns-allinone-2.35/ns-2.35"

source /etc/environment

or reboot your computer

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值