NS-3安装

Ubuntu 16.04安装顺利,Ubuntu 18.04不成功。
NS-3和Ubuntu 16.04更配哦


  • 下载安装包

sudo apt-get install gcc g++ Python
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
sudo apt-get install g++-3.4 gcc-3.4
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-pdf texlive-latex-extra texlive-generic-extra texlive-generic-recommended
sudo apt-get install texinfo dia texlive texlive-pdf texlive-latex-extra texlive-extra-utils texlive-generic-recommended
sudo apt-get install python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev
sudo apt-get install libboost-signal-dev libboost-filesystem-dev
  • 使用bake安装

hg clone http://code.nsnam.org/bake
export BAKE_HOME=`pwd`/bake
export PATH=$PATH:$BAKE_HOME
export PYTHONPATH=$PYTHONPATH:$BAKE_HOME

检查之前预装的包:bake.py check
输出:

> Python - OK
 > GNU C++ compiler - OK
 > Mercurial - OK
 > Git - OK
 > Tar tool - OK
 > Unzip tool - OK
 > Make - OK
 > cMake - OK
 > patch tool - OK


 > Path searched for tools:(一些路径)

碰到没有安装的包利用sudo apt-get install 指令再安装一下

安装ns-3:

bake.py configure -e ns-3.26
bake.py deploy 

要很久,中间存在problem提示也不用管
最后输出successfully finished即可

编译 ns-3

进入~/home/source/ns-3.26 (也可能是别的路径,进入ns-3.26文件夹即可)

./waf configure --build-profile=debug --enable-examples --enable-tests
./waf build

编译完成之后,测试

./test.py -c core
./waf --run hello-simulator

输出Hello Simulator则成功


Reference

你可能感兴趣的:(NS-3安装)