ubuntu16.04上安装ns3.25

因为论文需要,又重新在电脑上安装了NS3。

NS3的安装步骤分为以下几步:

  1. 下载依赖包
  2. 下载ns3.25并解压
  3. 编译
  4. 配置编译
  5. 测试
  6. 跑一个简单的例子  

1、下载依赖包

 将相关命令写进脚本,并执行脚本。如果相关的包定位不到,可以更换源,参考在ubuntu上更新镜像源

#!/bin/sh
#!/bin/sh
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 libgsl-dev libgsl2  
sudo apt-get install flex bison libfl-dev 
sudo apt-get install g++-4.4 gcc-4.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 texi2html       
sudo apt-get install python-sphinx dia        
sudo apt-get install python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev  
sudo apt-get install qt4-qmake   
sudo apt-get install qt4-dev-tools 
sudo apt-get install libboost-signals-dev libboost-filesystem-dev
sudo apt-get install openmpi-bin openmpi-doc libopenmpi-dev
chmod +x mysetup
./mysetup

2、 下载ns3.25并解压

cd
mkdir tarballs
cd tarballs
wget http://www.nsnam.org/release/ns-allinone-3.25.tar.bz2
tar -xjvf ns-allinone-3.25.tar.bz2

3、编译 

cd ns-allinone-3.25
sudo ./build.py

编译成功后结果如下图: 

ubuntu16.04上安装ns3.25_第1张图片

 

4、配置编译

cd ns-3.25
sudo ./waf clean   
sudo ./waf -d debug --enable-example --enable-tests configure   
sudo ./waf 

ubuntu16.04上安装ns3.25_第2张图片

ubuntu16.04上安装ns3.25_第3张图片

 

5、测试

sudo ./test.py –c core

ubuntu16.04上安装ns3.25_第4张图片

 

 

6、跑一个简单的例子 

sudo ./waf  --run hello-simulator

ubuntu16.04上安装ns3.25_第5张图片

至此,安装成功,撒花! 

你可能感兴趣的:(ns3)