歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu 1 2.04下ndnSIM安裝

Ubuntu 1 2.04下ndnSIM安裝

日期:2017/2/28 14:45:52   编辑:Linux教程

終於在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 問題解決

更多Ubuntu相關信息見Ubuntu 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=2

Copyright © Linux教程網 All Rights Reserved