(OK)(OK) install NS-3 NS3 - in Fedora 24

来源:互联网 发布:discover it 编辑:程序博客网 时间:2024/05/21 19:36

-----------------------------------------------------------------------------------------------------
https://www.nsnam.org/wiki/Installation
Prerequisites
-----------------------------------------------------------------------------------------------------
dnf install gcc gcc-c++ python python-devel mercurial bzr gsl gsl-devel gtk2 gtk2-devel gdb valgrind doxygen graphviz ImageMagick python-sphinx dia texlive texlive-latex

dnf install flex bison tcpdump sqlite sqlite-devel libxml2 libxml2-devel uncrustify openmpi openmpi-devel boost-devel goocanvas-devel graphviz graphviz-devel

dnf install python-setuptools
dnf install python-kiwi pygoocanvas cmake glibc-devel.i686 glibc-devel.x86_64

dnf install p7zip*

dnf install http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
dnf install unrar


-----------------------------------------------------------------------------------------------------
//PyViz visualizer              : not enabled (Missing python modules: pygraphviz)
dnf install python-devel gnome-python2 gnome-python2-gnomedesktop gnome-python2-rsvg graphviz-python pygoocanvas python-kiwi
dnf install graphviz-devel
easy_install pygraphviz


//Python API Scanning Support   : not enabled (Missing 'pygccxml' Python module)
pip install pygccxml
-----------------------------------------------------------------------------------------------------

[root@localhost fedora23server-share]# scp  /opt/tools/network_simulators/ns3/ns-allinone-3.25.tar.bz2  10.109.253.80:/opt/tools/network_simulators/ns3

cd /opt/tools/network_simulators/ns3
tar xjf ns-allinone-3.25.tar.bz2

-----------------------------------------------------------------------------------------------------

[root@localhost ns-allinone-3.25]# pwd
/opt/tools/network_simulators/ns3/ns-allinone-3.25

[root@localhost ns-allinone-3.25]# hg clone http://code.nsnam.org/bake

[root@localhost bake]# pwd
/opt/tools/network_simulators/ns3/ns-allinone-3.25/bake

[root@localhost bake]# ./bake.py check
 > Python - OK
 > GNU C++ compiler - OK
 > Mercurial - OK
 > CVS - OK
 > GIT - OK
 > Bazaar - OK
 > Tar tool - OK
 > Unzip tool - OK
 > Unrar tool - OK
 > 7z  data compression utility - OK
 > XZ data compression utility - OK
 > Make - OK
 > cMake - OK
 > patch tool - OK
 > autoreconf tool - OK

 > Path searched for tools: /usr/lib64/qt-3.3/bin /usr/lib64/ccache /usr/local/bin /usr/local/sbin /usr/bin /usr/sbin /root/bin bin

[root@localhost bake]#
./bake.py configure -e ns-3.25
./bake.py show

./bake.py deploy
or
./bake.py download
./bake.py build


[root@localhost bake]# ./bake.py deploy

Downloading, building and installing the selected modules and dependencies.

Please, be patient, this may take a while!

 >> Searching for system dependency g++ - OK
 >> Searching for system dependency setuptools - OK
 >> Searching for system dependency pygoocanvas - OK
 >> Searching for system dependency pygraphviz - OK
 >> Searching for system dependency python-dev - OK
 >> Downloading gccxml-ns3 (target directory:gccxml) - OK
 >> Searching for system dependency qt4 - OK
 >> Downloading pygccxml - OK
 >> Downloading netanim-3.107 - OK
 >> Downloading pybindgen-0.17.0.post49+ng0e4e3bc (target directory:pybindgen) - OK
 >> Downloading ns-3.25 - Problem
 > Error:  Critical dependency, module "ns-3.25" failed
   For more information call Bake with --debug and/or -v, -vvv, for full verbose mode (bake --help)

[root@localhost bake]# ls
bake  bakeconf.xml  bakefile.xml  bake.py  doc  examples  generate-binary.py  source  test  TODO
[root@localhost bake]#


-----------------------------------------------------------------------------------------------------
Using a Tarball
-----------------------------------------------------------------------------------------------------

download ns-allinone-3.25.tar.bz2

[root@localhost ns-allinone-3.25]# pwd
/opt/tools/network_simulators/ns3/ns-allinone-3.25
[root@localhost ns-allinone-3.25]#

./build.py --enable-examples --enable-tests

// ./build.py --enable-examples --enable-tests --with-openflow
-----------------------------------------------------------------------------------------------------

# Build NetAnim
Entering directory `netanim-3.107'
 =>  qmake -v
Could not find qmake in the default path
 =>  qmake-qt4 -v
QMake version 2.01a
Using Qt version 4.8.7 in /usr/lib64
qmake-qt4 found
 =>  qmake-qt4 NetAnim.pro
 =>  make
make: Nothing to be done for 'first'.
Leaving directory `netanim-3.107'
# Building examples (by user request)
# Building tests (by user request)
# Build NS-3
Entering directory `./ns-3.25'
 =>  /usr/bin/python waf configure --enable-examples --enable-tests --with-pybindgen ../pybindgen-0.17.0.post49+ng0e4e3bc
Setting top to                           : /opt/tools/network_simulators/ns3/ns-allinone-3.25/ns-3.25
Setting out to                           : /opt/tools/network_simulators/ns3/ns-allinone-3.25/ns-3.25/build
Checking for 'gcc' (C compiler)          : /usr/lib64/ccache/gcc
Checking for cc version                  : 5.3.1
Checking for 'g++' (C++ compiler)        : /usr/lib64/ccache/g++
Checking for compilation flag -Wl,--soname=foo support : ok
Checking for program 'python'                          : /usr/bin/python
Checking for python version                            : (2, 7, 11, 'final', 0)
python-config                                          : /usr/bin/python-config
Asking python-config for pyembed '--cflags --libs --ldflags' flags : yes
Testing pyembed configuration                                      : yes
Asking python-config for pyext '--cflags --libs --ldflags' flags   : yes
Testing pyext configuration                                        : yes
Checking for compilation flag -fvisibility=hidden support          : ok
Checking for compilation flag -Wno-array-bounds support            : ok
Checking for pybindgen location                                    : ../pybindgen-0.17.0.post49+ng0e4e3bc (given)
Checking for python module 'pybindgen'                             : 0.17.0.post49+ng0e4e3bc
Checking for pybindgen version                                     : 0.17.0.post49+ng0e4e3bc
Checking for code snippet                                          : yes
Checking for types uint64_t and unsigned long equivalence          : no
Checking for code snippet                                          : no
Checking for types uint64_t and unsigned long long equivalence     : yes
Checking for the apidefs that can be used for Python bindings      : gcc-LP64
Checking for internal GCC cxxabi                                   : complete
Checking for python module 'pygccxml'                              : not found
Checking boost includes                                            : 1_58
Checking boost libs                                                : ok
Checking for boost linkage                                         : ok
Checking for click location                                        : not found
Checking for program 'pkg-config'                                  : /usr/bin/pkg-config
Checking for 'gtk+-2.0' >= 2.12                                    : yes
Checking for 'libxml-2.0' >= 2.7                                   : yes
Checking for type uint128_t                                        : not found
Checking for type __uint128_t                                      : yes
Checking high precision implementation                             : 128-bit integer (default)
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 header stdlib.h                                       : yes
Checking for header signal.h                                       : yes
Checking for header pthread.h                                      : yes
Checking for header stdint.h                                       : yes
Checking for header inttypes.h                                     : yes
Checking for header sys/inttypes.h                                 : not found
Checking for library rt                                            : yes
Checking for header sys/ioctl.h                                    : yes
Checking for header net/if.h                                       : yes
Checking for header net/ethernet.h                                 : yes
Checking for header linux/if_tun.h                                 : yes
Checking for header netpacket/packet.h                             : yes
Checking for NSC location                                          : not found
Checking for OpenFlow location                                     : not found
Checking for 'sqlite3'                                             : yes
Checking for header linux/if_tun.h                                 : yes
Checking for python module 'gtk'                                   : ok
Checking for python module 'goocanvas'                             : 0.14.1
Checking for python module 'pygraphviz'                            : not found
Checking for program 'sudo'                                        : /usr/bin/sudo
Checking for program 'valgrind'                                    : /usr/bin/valgrind
Checking for 'gsl'                                                 : yes
python-config                                                      : /usr/bin/libgcrypt-config
Checking for libgcrypt                                             : yes
Checking for compilation flag -Wno-error=deprecated-d... support   : ok
Checking for compilation flag -Wno-error=deprecated-d... support   : ok
Checking for compilation flag -fstrict-aliasing support            : ok
Checking for compilation flag -fstrict-aliasing support            : ok
Checking for compilation flag -Wstrict-aliasing support            : ok
Checking for compilation flag -Wstrict-aliasing support            : ok
Checking for program 'doxygen'                                     : /usr/bin/doxygen
---- Summary of optional NS-3 features:
Build profile                 : debug
Build directory               :
Python Bindings               : enabled
Python API Scanning Support   : not enabled (Missing 'pygccxml' Python module)
BRITE Integration             : not enabled (BRITE not enabled (see option --with-brite))
NS-3 Click Integration        : not enabled (nsclick not enabled (see option --with-nsclick))
GtkConfigStore                : enabled
XmlIo                         : enabled
Threading Primitives          : enabled
Real Time Simulator           : enabled
File descriptor NetDevice     : enabled
Tap FdNetDevice               : enabled
Emulation FdNetDevice         : enabled
PlanetLab FdNetDevice         : not enabled (PlanetLab operating system not detected (see option --force-planetlab))
Network Simulation Cradle     : not enabled (NSC not found (see option --with-nsc))
MPI Support                   : not enabled (option --enable-mpi not selected)
NS-3 OpenFlow Integration     : not enabled (OpenFlow not enabled (see option --with-openflow))
SQlite stats data output      : enabled
Tap Bridge                    : enabled
PyViz visualizer              : not enabled (Missing python modules: pygraphviz)
Use sudo to set suid bit      : not enabled (option --enable-sudo not selected)
Build tests                   : enabled
Build examples                : enabled
GNU Scientific Library (GSL)  : enabled
Gcrypt library                : enabled
'configure' finished successfully (9.068s)
 =>  /usr/bin/python waf build
Waf: Entering directory `/opt/tools/network_simulators/ns3/ns-allinone-3.25/ns-3.25/build'


......
Waf: Leaving directory `/opt/tools/network_simulators/ns3/ns-allinone-3.25/ns-3.25/build'
Build commands will be stored in build/compile_commands.json
'build' finished successfully (9m30.922s)

Modules built:
antenna                   aodv                      applications              
bridge                    buildings                 config-store              
core                      csma                      csma-layout               
dsdv                      dsr                       energy                    
fd-net-device             flow-monitor              internet                  
internet-apps             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             traffic-control           uan                       
virtual-net-device        visualizer                wave                      
wifi                      wimax                     

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

Leaving directory `./ns-3.25'
[root@localhost ns-allinone-3.25]#

-----------------------------------------------------------------------------------------------------


cd ns-3.25
./test.py
-----------------------------------------------------------------------------------------------------
Waf: Entering directory `/opt/tools/network_simulators/ns3/ns-allinone-3.25/ns-3.25/build'
Waf: Leaving directory `/opt/tools/network_simulators/ns3/ns-allinone-3.25/ns-3.25/build'
Build commands will be stored in build/compile_commands.json
'build' finished successfully (8.337s)

Modules built:
antenna                   aodv                      applications              
bridge                    buildings                 config-store              
core                      csma                      csma-layout               
dsdv                      dsr                       energy                    
fd-net-device             flow-monitor              internet                  
internet-apps             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             traffic-control           uan                       
virtual-net-device        visualizer                wave                      
wifi                      wimax                     

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

PASS: TestSuite attributes
PASS: TestSuite callback
......
PASS: TestSuite ns3-wifi-interference
PASS: TestSuite traced-callback-typedef
PASS: TestSuite traced-value-callback
PASS: Example examples/udp/udp-echo
PASS: TestSuite ns3-wifi-msdu-aggregator
PASS: Example examples/tcp/star
......
PASS: Example src/uan/examples/uan-cw-example
PASS: Example src/flow-monitor/examples/wifi-olsr-flowmon.py
PASS: Example examples/wireless/mixed-bg-network
PASS: TestSuite lte-frequency-reuse
356 of 359 tests passed (356 passed, 3 skipped, 0 failed, 0 crashed, 0 valgrind errors)
List of SKIPped tests:
    ns3-tcp-cwnd
    ns3-tcp-interoperability
    nsc-tcp-loss
[root@localhost ns-3.25]#

-----------------------------------------------------------------------------------------------------
Building with Waf
------------------------
Up to this point, we have used either the build.py script, or the bake tool, to get started with building ns-3. These tools are useful for building ns-3 and supporting libraries, and they call into the ns-3 directory to call the Waf build tool to do the actual building. Most users quickly transition to using Waf directly to configure and build ns-3. So, to proceed, please change your working directory to the ns-3 directory that you have initially built.
-----------------------------------------------------------------------------------------------------
[root@localhost ns-3.25]# pwd
/opt/tools/network_simulators/ns3/ns-allinone-3.25/ns-3.25
[root@localhost ns-3.25]#

./waf clean
./waf --build-profile=optimized --enable-examples --enable-tests configure     //do not use this command

./waf --help
./test.py -c core
./waf --run hello-simulator

-----------------------------------------------------------------------------------------------------
// ./waf clean
// ./waf configure --enable-examples --enable-tests
// ./waf clean
// ./waf configure --build-profile=optimized --enable-examples --enable-tests

[root@localhost ns-3.25]# pwd
/opt/tools/network_simulators/ns3/ns-allinone-3.25/ns-3.25
[root@localhost ns-3.25]#

./waf configure --build-profile=debug --enable-examples --enable-tests        //use this command
./waf     //build the debug versions of the ns-3 programs, will take a long time

------------------------------------------------------

cp examples/tutorial/first.cc scratch/myfirst.cc
./waf     //Now build your first example script using waf
./waf --run scratch/myfirst


------------------------------------------------------
[root@localhost ns-3.25]# ./waf --run scratch/myfirst
Waf: Entering directory `/opt/tools/network_simulators/ns3/ns-allinone-3.25/ns-3.25/build'
Waf: Leaving directory `/opt/tools/network_simulators/ns3/ns-allinone-3.25/ns-3.25/build'
Build commands will be stored in build/compile_commands.json
'build' finished successfully (2.072s)
At time 2s client sent 1024 bytes to 10.1.1.2 port 9
At time 2.00369s server received 1024 bytes from 10.1.1.1 port 49153
At time 2.00369s server sent 1024 bytes to 10.1.1.1 port 49153
At time 2.00737s client received 1024 bytes from 10.1.1.2 port 9
[root@localhost ns-3.25]#
------------------------------------------------------

1 0
原创粉丝点击