NS-3安装说明

来源:互联网 发布:淘宝联盟引流人数60 编辑:程序博客网 时间:2024/04/29 23:01
一、系统需要满足的要求(针对Ubuntu 9.10,其他版本需要相应修改,但基本是可用的,如10.04)
*minimal requirements for C++ (release): This is the minimal set of packages needed to run ns-3 from a released tarball.
 sudo apt-get install gcc g++ python
*minimal requirements for Python (release): This is the minimal set of packages needed to work with Python bindings from a released tarball.
 sudo apt-get install gcc g++ python python-dev
*Mercurial is needed to work with ns-3 development repositories.
 sudo apt-get install mercurial
*Running python bindings from the ns-3 development tree (ns-3-dev) requires bazaar
 sudo apt-get install bzr
*Debugging:
 sudo apt-get install gdb valgrind 
*GNU Scientific Library (GSL) support for more accurate WiFi error models
 sudo apt-get install gsl-bin libgsl0-dev libgsl0ldbl
*The Network Simulation Cradle (nsc) requires the flex lexical analyzer and bison parser generator:
 sudo apt-get install flex bison
*To install gcc-3.4 for some Network Simulation Cradle (nsc) stacks:
 sudo apt-get install g++-3.4 gcc-3.4 (不用执行,10.04的gcc版本为4.4.3,只要不是4.1和4.2就行)
*To read pcap packet traces
 sudo apt-get install tcpdump
*Database support for statistics framework
 sudo apt-get install sqlite sqlite3 libsqlite3-dev
*Xml-based version of the config store (requires libxml2 >= version 2.7)
 sudo apt-get install libxml2 libxml2-dev
*A GTK-based configuration system
 sudo apt-get install libgtk2.0-0 libgtk2.0-dev
*To experiment with virtual machines and ns-3
 sudo apt-get install vtun lxc
*Support for utils/check-style.py code style check program
 sudo apt-get install uncrustify
*Doxygen and related inline documentation:
 sudo apt-get install doxygen graphviz imagemagick
 sudo apt-get install texlive texlive-pdf texlive-latex-extra texlive-generic-extra texlive-generic-recommended
*The ns-3 manual and tutorial are written in reStructuredText for Sphinx (doc/tutorial, doc/manual, doc/models), and figures typically in dia:
 sudo apt-get install python-sphinx dia texlive texlive-pdf texlive-latex-extra texlive-extra-utils texlive-generic-recommended
*Support for Gustavo Carneiro's ns-3-pyviz visualizer
 sudo apt-get install python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev
*Support for openflow module (requires some boost libraries)
 sudo apt-get install libboost-signals-dev libboost-filesystem-dev


二、NS3下载
(1)使用Mercurial下载 (下载dev版本)
 cd
 mkdir repos
 cd repos
 hg clone http://code.nsnam.org/ns-3-allinone
---------------------------------------------------------
 ./download.py -n ns-3-dev


(2)下载 realse tarball
 cd
 mkdir tarballs
 cd tarballs
 wget http://www.nsnam.org/releases/ns-allinone-3.6.tar.bz2 (此处根据版本号作相应修改,如ns-allinone-3.13.tar.bz2)
 tar xjf ns-allinone-3.6.tar.bz2
------------------------------------------------------------


三、构建NS3
./build.py --enable-exmaples --enable-tests
进到ns-3-dev或ns-3文件夹下
./waf -d(optimized or debug) --enable-examples --enable-tests configure #这一步是配置
./waf #这一步是使用waf构建ns3


四、测试NS3
./test.py -c core
出现"92 of 92 tests passed (92 passed, 0 failed, 0 crashed, 0 valgrind errors)"说明安装成功,这个信息非常重要
./waf --run hello-simulator
出现"Hello Simulator"信息,恭喜你现在正式成为ns3的用户(若没有出现"Hello Simulator",请确定waf构建是否使用-d debug)
原创粉丝点击