ns-3安装及python binding

ns-3安装及python binding

1 环境说明及前置依赖包

1.1 环境说明

ubuntu 16.04

1.2 前置依赖包

sudo apt-get install gcc g++ python python-dev mercurial python-setuptools git qt5-default python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev ipython
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 
sudo apt-get install libgoocanvas-2.0-9
sudo apt-get install openmpi-bin openmpi-common openmpi-doc libopenmpi-dev autoconf cvs bzr unrar gdb valgrind uncrustify
sudo apt-get install doxygen graphviz imagemagick
sudo apt-get install python-sphinx dia 
sudo apt-get install tcpdump
sudo apt-get install sqlite sqlite3 libsqlite3-dev
sudo apt-get install libxml2 libxml2-dev
sudo apt-get install cmake libc6-dev libc6-dev-i386 libclang-6.0-dev llvm-6.0-dev automake 
sudo apt-get install libgtk2.0-0 libgtk2.0-dev
sudo apt-get install vtun lxc
sudo apt-get install libboost-signals-dev libboost-filesystem-dev

sudo pip install cxxfilt

2 利用bake安装ns-3.29及依赖

cd /opt
sudo git clone https://gitlab.com/nsnam/bake.git
sudo chmod -R 777 bake
cd bake
export BAKE_HOME=`pwd`
export PATH=$PATH:$BAKE_HOME:$BAKE_HOME/build/bin
export PYTHONPATH=$PYTHONPATH:$BAKE_HOME:$BAKE_HOME/build/lib
./bake.py configure -e ns-3.29 -e pygccxml-1.9.1
./bake.py check
./bake.py download
./bake.py build

3 lib

cd /opt/bake/build/lib
sudo cp libns3-dev-* /usr/local/lib
sudo cp pkgconfig/ /usr/local/lib/ -R

cd /opt/bake/build/lib/python2.7/site-packages
sudo cp ns/ /usr/local/lib/python2.7/dist-packages -R
sudo cp visualizer/ /usr/local/lib/python2.7/dist-packages/ -R 

sudo ldconfig

4、 扫描

cd bake
export BAKE_HOME=`pwd`
export PATH=$PATH:$BAKE_HOME/build/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$BAKE_HOME/build/lib
export PYTHONPATH=$PYTHONPATH:$BAKE_HOME/build/lib

cd source/ns-3.29
 ./waf --apiscan=lte

你可能感兴趣的:(SDN)