1、添加源
sudo vim /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse
sudo apt-get update
2、编写脚本安装依赖包
vim pre.sh
#!/bin/sh
sudo apt-get install gcc g++ python python3 -y
sudo apt-get install gcc g++ python python3 python3-dev -y
sudo apt-get install python3-setuptools git mercurial -y
sudo apt-get install qt5-default mercurial -y
sudo apt-get install gir1.2-goocanvas-2.0 python-gi python-gi-cairo python-pygraphviz python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython ipython3 -y
sudo apt-get install openmpi-bin openmpi-common openmpi-doc libopenmpi-dev -y
sudo apt-get install autoconf cvs bzr unrar -y
sudo apt-get install gdb valgrind -y
sudo apt-get install uncrustify -y
sudo apt-get install doxygen graphviz imagemagick -y
sudo apt-get install texlive texlive-extra-utils texlive-latex-extra texlive-font-utils texlive-lang-portuguese dvipng latexmk -y
sudo apt-get install python3-sphinx dia -y
sudo apt-get install gsl-bin libgsl-dev libgsl23 libgslcblas0 -y
sudo apt-get install tcpdump -y
sudo apt-get install sqlite sqlite3 libsqlite3-dev -y
sudo apt-get install libxml2 libxml2-dev -y
sudo apt-get install cmake libc6-dev libc6-dev-i386 libclang-dev llvm-dev automake -y
sudo apt-get install python-pip -y
pip install cxxfilt -y
sudo apt-get install libgtk2.0-0 libgtk2.0-dev -y
sudo apt-get install vtun lxc -y
sudo apt-get install libboost-signals-dev libboost-filesystem-dev -y
sudo apt-get install python-dev python-pygraphviz python-kiwi python-pygoocanvas python-gnome2 gir1.2-goocanvas-2.0 python-rsvg -y
保存脚本退出,获取root权限
chmod +x pre.sh
./pre.sh
3、下载ns3源码,解压
tar xjf ns-allinone-3.30.tar.bz2
4、配置(cd ns3.30)
./waf configure --build-profile=debug --enable-examples --enable-tests
5、编译
./waf
6、测试
./test.py -c core
7、运行
./waf --run scratch/scratch-simulator
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
安装3.28
1、添加源
sudo vim /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse
sudo apt-get update
2、编写脚本安装依赖包
vim pre.sh
#!/bin/sh
sudo apt-get install gcc g++ python -y
sudo apt-get install gcc g++ python python-dev -y
sudo apt-get install mercurial -y
sudo apt-get install bzr -y
sudo apt-get install gdb valgrind -y
sudo apt-get install gsl-bin libgsl0-dev libgsl0ldbl -y
sudo apt-get install flex bison libfl-dev -y
sudo apt-get install g++-3.4 gcc-3.4 -y
sudo apt-get install tcpdump -y
sudo apt-get install sqlite sqlite3 libsqlite3-dev -y
sudo apt-get install libxml2 libxml2-dev -y
sudo apt-get install libgtk2.0-0 libgtk2.0-dev -y
sudo apt-get install vtun lxc -y
sudo apt-get install uncrustify -y
sudo apt-get install doxygen grphviz imagemagick -y
sudo apt-get install texlive texlive-extra-untils texlive-latex-extra -y
sudo apt-get install python-sphinx dia -y
sudo apt-get install python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev -y
sudo apt-get install libboost-signals-dev libboost-filesystem-dev -y
sudo apt-get install openmpi* -y
sudo apt-get install qt4-dev-tools libqt4-dev -y
sudo apt-get install cmake libc6-dev libc6-dev-i386 g++-multilib -y
sudo apt-get install python-dev python-pygraphviz python-kiwi python-pygoocanvas python-gnome2 gir1.2-goocanvas-2.0 python-rsvg -y
sudo apt-get install ipython
保存脚本退出,获取root权限
chmod +x pre.sh
./pre.sh
3、下载ns3源码,解压
tar xjf ns-allinone-3.28.tar.bz2
4、
./build.py --enable-examples
5、./waf
6、./waf --run examples/tutorial/third --vis