Ubuntu 1 2.04下ndnSIM安装


终于在Ubuntu 1 2.04下把ndnSim装上了~~中间碰到很多error,好在一一解决了,把经验分享一下~~

1、NS3开发环境设置

sudo apt-get install gcc g++ python python-dev //C++和python安装,必装
sudo apt-get install mercurial //NS3代码维护使用的源码版本控制管理系统 分布式版本控制系统
sudo apt-get install bzr //运行python绑定ns-3-dev需要bazaar这个组件
sudo apt-get install libgtk2.0-0 libgtk2.0-dev //基于GTK的配置系统
sudo apt-get install gdb valgrind //调试工具
sudo apt-get install doxygen graphviz imagemagick  //文档生成器
//doxygen安装出错,直接安装:
sudo git clone https://github.com/doxygen/doxygen.git
cd doxygen
sudo ./configure
sudo make
sudo make install
sudo apt-get install texlive texlive-pdf texlive-latex-extra //文档生成器,从源代码中生成说明文档
sudo apt-get install texinfo dia texlive-extra-utils texi2html //ns-3手册和tutorial编写查看工具
sudo apt-get install flex bison //仿真必需的词法分析器和语法分析生成器
sudo apt-get install libgoocanvas-dev //部分移动场景仿真的可视化测试需要这个组件
sudo apt-get install tcpdump //读取pcap的packet traces,即包嗅探器
sudo apt-get install sqlite sqlite3 libsqlite3-dev //支持统计特性的数据库软件
sudo apt-get install libxml2 //xml的配置存储软件
sudo apt-get install python-pygraphviz python-kiwi python-pygoocanvas //Gustavo's ns-3-pyviz的可视化软件

sudo apt-get install python-pygccxml
sudo apt-get install qt4-qmake

2、NS3安装  ns-3-allinone
http://www.nsnam.org/下载最新ns3  ns-allinone-3.17.tar.bz2
tar xjf ns-allinone-3.17.tar.bz2
cd ns-allinone-3.17.tar.bz2
sudo ./build.py
cd ns-3.17
sudo ./waf -d optimized configure
sudo ./waf -d debug --enable-examples --enable-tests configure  //配置
sudo ./waf  //使用waf构建ns3

测试NS3
./test.py -c core  出现:152 of 155 tests passed ,3 skipped, 0 failed, 0 crashed, 0 valgrind errors

sudo ./waf --run hello-simulator 出现:Hello Simulator


3. NDNSIM安装
前期准备:参考http://ndnsim.net/faq.html#installing-boost-libraries

boost中,用到了别的函数库,所以为了使用boost中相应的功能,需要先安装系统中可能缺失的库 

apt-get install mpi-default-dev  #安装mpi库

安装libboost:
 wget http://downloads.sourceforge.net/project/boost/boost/1.53.0/boost_1_53_0.tar.bz2
 tar jxf boost_1_53_0.tar.bz2
 cd boost_1_53_0
 ./bootstrap.sh
修改tools/build/v2/user-config.jam文件,在最后面加上一行“using mpi ;”(注意mpi后面有个空格,然后一个分号 )
 sudo ./b2 --prefix=/usr/local install

下载ndn:
cd /opt
sudo mkdir ndnSIM
cd ndnSIM 
sudo git clone git://github.com/cawka/ns-3-dev-ndnSIM.git ns-3
sudo git clone git://github.com/cawka/pybindgen.git pybindgen 
sudo git clone git://github.com/NDN-Routing/ndnSIM.git ns-3/src/ndnSIM

安装
cd pybindgen
sudo ./waf configure
sudo ./waf
cd ../ns-3
sudo ./waf configure --boost-includes=/usr/local/include --boost-libs=/usr/local/lib --enable-examples
sudo ./waf

测试:
sudo ./waf --run=ndn-simple
如果出现说libboost_*.so.1.53.0:cannot open shared object fiel:No such file or directory
则:sudo cp /usr/local/lib/libboost_*so.1.53.0 /usr/lib 问题解决

相关内容

    暂无相关文章