首页 > 代码库 > 1、安装和在eclipse中配置ns-3(ubuntu12.04)
1、安装和在eclipse中配置ns-3(ubuntu12.04)
安装ns3的一系列包,脚本如下:
#!/bin/sh
sudo apt-get install gcc g++ python python-pygccxml
sudo apt-get install gcc g++ python python-dev
sudo apt-get install mercurial
sudo apt-get install bzr
sudo apt-get install gdb valgrind
sudo apt-get install gsl-bin libgsl0-dev libgsl0ldbl
sudo apt-get install flex bison libfl-dev
sudo apt-get install tcpdump
sudo apt-get install sqlite sqlite3 libsqlite3-dev
sudo apt-get install libxml2 libxml2-dev
sudo apt-get install libgtk2.0-0 libgtk2.0-dev
sudo apt-get install vtun lxc
sudo apt-get install uncrustify
sudo apt-get install doxygen graphviz imagemagick
sudo apt-get install texlive texlive-extra-utils texlive-latex-extra
sudo apt-get install python-sphinx dia
sudo apt-get install python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev
sudo apt-get install libboost-signals-dev libboost-filesystem-dev
sudo apt-get install python-gnome2 python-gnomedesktop python-rsvg
sudo apt-get install ipython
sudo apt-get install qt4-dev-tools
sudo apt-get install gnuplot
sudo apt-get install wireshark*
在eclipse中配置ns3
Help->"Install New Software..."输入网站,全选。
http://download.eclipse.org/tools/cdt/releases/kepler
Import导入项目之后,右击项目,设置,
C/C++ Builder的Builder Settings标签中:
去掉“Use default build command”和“Generate Makefile automatically”前面的勾
设置Build command: ${workspace_loc:/ns-3.19/waf}
设置Build directory: ${workspace_loc:/ns-3.19//build}
C/C++ Builder的Behaviour标签中:
全选Workbench Build Behavior中的复选框都选上,前2个值为空,最后一个是clean。
设置eclipse执行程序使用外部工具
Run->External Tools->Externel tools Configurations,在Program中右键选择New,name可以设置为ns3-waf-3.19,在location中设置${workspace_loc:/ns-3.19/waf},在working directory 中设置${workspace_loc:/ns-3.19},argument中设置为--run "${string_prompt}"。
最后单击run选择程序,可以选择scratch-simulator来执行仿真。