当前位置:   article > 正文

使用WAF编译NS3, DCE_ns30中waf编译

ns30中waf编译
使用bake编译,由于bake支持的DCE和ns3的版本较老,所以采用waf来编译ns3,dce

OS: CentOS6.5
预备条件:暂时无
说明:暂时未考虑使用pybindgen,所以未编译是物。

编译步骤:
ns3
1 下载最新ns3

# Download ns-3
hg clone http://code.nsnam.org/ns-3.23

2 编译ns3,将其安装到build目录,头文件安装到include目录
cd ns-3.23
# Configure
./waf configure --enable-examples -d optimized --prefix=/home/gftp/tool/network/dce/build \
                --includedir=/home/gftp/tool/network/dce/include/ns-3.23
# Build and install in the directory specified by
# --prefix parameter
./waf build
./waf install

这是build出来的结果:无python绑定的
Modules built:
antenna                   aodv                      applications             
bridge                    buildings                 config-store             
core                      csma                      csma-layout              
dsdv                      dsr                       energy                   
fd-net-device             flow-monitor              internet                 
lr-wpan                   lte                       mesh                     
mobility                  mpi                       netanim (no Python)      
network                   nix-vector-routing        olsr                     
point-to-point            point-to-point-layout     propagation              
sixlowpan                 spectrum                  stats                    
tap-bridge                test (no Python)          topology-read            
uan                       virtual-net-device        wave                     
wifi                      wimax                    

Modules not built (see ns-3 tutorial for explanation):
brite                     click                     openflow                 
visualizer               

[root@gdc1000 ns-3.23]#

3 产生linux net栈仿真
# Clone net-next-sim
git clone https://github.com/thehajime/net-next-sim.git
cd net-next-sim
# Select a kernel version
git checkout sim-ns3-3.10.0-branch
# Configure and build
make defconfig OPT=yes ARCH=sim
make library OPT=yes ARCH=sim
cd ..
生成ld -shared --verbose | ./arch/sim/generate-linker-script.py > arch/sim/linker.lds
  LIB   libsim-linux3.10.0.so

4 编译dce

hg clone http://code.nsnam.org/ns-3-dce  -r dce-1.6
./waf configure --with-ns3=/home/gftp/tool/network/dce/build --enable-opt \
                --enable-kernel-stack=/home/gftp/tool/network/dce/source/net-next-sim/arch \
                --prefix=/home/gftp/tool/network/dce/build
配置结果:
[root@gdc1000 ns-3-dce]# ./waf configure --with-ns3=/home/gftp/tool/network/dce/build --enable-opt \
>                 --enable-kernel-stack=/home/gftp/tool/network/dce/source/net-next-sim/arch \
>                 --prefix=/home/gftp/tool/network/dce/build
Setting top to                           : /home/gftp/tool/network/dce/source/ns-3-dce 
Setting out to                           : /home/gftp/tool/network/dce/source/ns-3-dce/build 
Checking for 'gcc' (c compiler)          : /usr/local/bin/gcc 
Checking for 'g++' (c++ compiler)        : /usr/local/bin/g++ 
Checking for program pkg-config          : /usr/bin/pkg-config 
Checking for pkg-config version >= '0.0.0' : yes 
Checking for -Wl,--soname=foo              : yes 
Checking for ns3-core (ns3.23)             : yes 
Checking for ns3-network (ns3.23)          : yes 
Checking for ns3-internet (ns3.23)         : yes 
Checking for ns3-point-to-point (ns3.23)   : yes 
Checking for ns3-tap-bridge (ns3.23)       : yes 
Checking for ns3-netanim (ns3.23)          : yes 
Checking for ns3-wifi (ns3.23)             : yes 
Checking for ns3-csma (ns3.23)             : yes 
Checking for ns3-mobility (ns3.23)         : yes 
Checking for ns3-point-to-point-layout (ns3.23) : yes 
Checking for ns3-mpi (ns3.23)                   : yes 
Checking for ns3-lte (ns3.23)                   : yes 
Checking for ns3-visualizer (None)              : not found 
Checking for ns3-applications (ns3.23)          : yes 
Checking for ns3-fd-net-device (ns3.23)         : yes 
Checking for header stdint.h                    : yes 
Checking for header inttypes.h                  : yes 
Checking for header sys/inttypes.h              : not found 
Checking for header sys/types.h                 : yes 
Checking for header sys/stat.h                  : yes 
Checking for header dirent.h                    : yes 
Checking for library dl                         : yes 
Checking for glibc get_cpu_features             : yes 
Checking for glibc __secure_getenv              : yes 
Checking for header valgrind/valgrind.h         : not found 
Checking for header valgrind/memcheck.h         : not found 
Checking for header sim.h                       : yes 
Checking for 'gcc' (c compiler)                 : /usr/local/bin/gcc 
Checking for ns3-flow-monitor (ns3.23)          : yes 
Checking for header hook-manager.h              : not found 
Checking for program valgrind                   : /usr/bin/valgrind 
Checking for program doxygen                    : /usr/bin/doxygen 
Checking for header netinet/sctp.h              : not found 
Checking for program python                     : /usr/bin/python 
Checking for python version                     : (2, 6, 6, 'final', 0) 
Checking for library python2.6 in LIBDIR        : yes 
Checking for program python2.6-config,python-config-2.6,python2.6m-config : /usr/bin/python2.6-config 
Checking for header Python.h                                              : yes 
Checking for pybindgen location                                           : not found 
Python module pybindgen                                                   : not found 
pybindgen missing => no python bindings
---- Summary of optional NS-3 features:
Static build                  : not enabled (option --enable-static not selected)
Logging                       : enabled
Assert checks                 : enabled
Code coverage                 : not enabled (option --enable-gcov not selected)
Example programs              : enabled
Test programs                 : enabled
Debug Symbols                 : enabled
ELF magic loader              : not enabled (elf-loader not found)
Aspect-based tracing          : not enabled (libaspect not found)
sctp-tools-dev                : not enabled (sctp-tools (netinet/sctp.h) not found)
'configure' finished successfully (2.135s)
[root@gdc1000 ns-3-dce]# 



./waf build
./waf install

安装的结果
Waf: Entering directory `/home/gftp/tool/network/dce/source/ns-3-dce/build'
+ install /home/gftp/tool/network/dce/build/include/ns3/netlink-socket-factory.h (from netlink/netlink-socket-factory.h)
+ install /home/gftp/tool/network/dce/build/include/ns3/dce-manager.h (from model/dce-manager.h)
+ install /home/gftp/tool/network/dce/build/include/ns3/task-scheduler.h (from model/task-scheduler.h)
+ install /home/gftp/tool/network/dce/build/include/ns3/netlink-socket-address.h (from netlink/netlink-socket-address.h)
+ install /home/gftp/tool/network/dce/build/include/ns3/task-manager.h (from model/task-manager.h)
+ install /home/gftp/tool/network/dce/build/include/ns3/netlink-module.h (from build/include/ns3/netlink-module.h)
+ install /home/gftp/tool/network/dce/build/include/ns3/socket-fd-factory.h (from model/socket-fd-factory.h)
+ install /home/gftp/tool/network/dce/build/include/ns3/loader-factory.h (from model/loader-factory.h)
+ install /home/gftp/tool/network/dce/build/include/ns3/dce-application.h (from model/dce-application.h)



声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/211496
推荐阅读
相关标签
  

闽ICP备14008679号