doc/tutorial/source/getting-started.rst
changeset 11670 61dae169dc6a
parent 11544 cfaf2d65b33c
equal deleted inserted replaced
11669:277cc5cd06a7 11670:61dae169dc6a
    94 (substitute the appropriate version numbers, of course)::
    94 (substitute the appropriate version numbers, of course)::
    95 
    95 
    96   $ cd
    96   $ cd
    97   $ mkdir workspace
    97   $ mkdir workspace
    98   $ cd workspace
    98   $ cd workspace
    99   $ wget http://www.nsnam.org/release/ns-allinone-3.23.tar.bz2
    99   $ wget http://www.nsnam.org/release/ns-allinone-3.24.tar.bz2
   100   $ tar xjf ns-allinone-3.23.tar.bz2
   100   $ tar xjf ns-allinone-3.24.tar.bz2
   101 
   101 
   102 If you change into the directory ``ns-allinone-3.23`` you should see a
   102 If you change into the directory ``ns-allinone-3.24`` you should see a
   103 number of files::
   103 number of files and directories:
       
   104 
       
   105 ::
   104 
   106 
   105   $ ls
   107   $ ls
   106   bake      constants.py   ns-3.23               README
   108   bake      constants.py   ns-3.24                            README
   107   build.py  netanim-3.106  pybindgen-0.17.0.886  util.py
   109   build.py  netanim-3.106  pybindgen-0.17.0.post41+ngd10fa60  util.py
   108 
   110 
   109 You are now ready to build the base |ns3| distribution.
   111 You are now ready to build the base |ns3| distribution and may skip ahead
       
   112 to the section on building |ns3|.
   110 
   113 
   111 Downloading |ns3| Using Bake
   114 Downloading |ns3| Using Bake
   112 ++++++++++++++++++++++++++++
   115 ++++++++++++++++++++++++++++
   113 
   116 
   114 Bake is a tool for distributed integration and building, 
   117 Bake is a tool for distributed integration and building, 
   161 will be to use those scripts to download and build the |ns3|
   164 will be to use those scripts to download and build the |ns3|
   162 distribution of your choice.
   165 distribution of your choice.
   163 
   166 
   164 There are a few configuration targets available:
   167 There are a few configuration targets available:
   165 
   168 
   166 1.  ``ns-3.23``:  the module corresponding to the release; it will download
   169 1.  ``ns-3.24``:  the module corresponding to the release; it will download
   167     components similar to the release tarball.
   170     components similar to the release tarball.
   168 2.  ``ns-3-dev``:  a similar module but using the development code tree
   171 2.  ``ns-3-dev``:  a similar module but using the development code tree
   169 3.  ``ns-allinone-3.23``:  the module that includes other optional features
   172 3.  ``ns-allinone-3.24``:  the module that includes other optional features
   170     such as click routing, openflow for |ns3|, and the Network Simulation
   173     such as click routing, openflow for |ns3|, and the Network Simulation
   171     Cradle
   174     Cradle
   172 4.  ``ns-3-allinone``:  similar to the released version of the allinone
   175 4.  ``ns-3-allinone``:  similar to the released version of the allinone
   173     module, but for development code.
   176     module, but for development code.
   174 
   177 
   182 You can find the latest version  of the
   185 You can find the latest version  of the
   183 code either by inspection of the repository list or by going to the 
   186 code either by inspection of the repository list or by going to the 
   184 `"ns-3 Releases"
   187 `"ns-3 Releases"
   185 <http://www.nsnam.org/releases>`_
   188 <http://www.nsnam.org/releases>`_
   186 web page and clicking on the latest release link.  We'll proceed in
   189 web page and clicking on the latest release link.  We'll proceed in
   187 this tutorial example with ``ns-3.23``.
   190 this tutorial example with ``ns-3.24``.
   188 
   191 
   189 We are now going to use the bake tool to pull down the various pieces of 
   192 We are now going to use the bake tool to pull down the various pieces of 
   190 |ns3| you will be using.  First, we'll say a word about running bake.
   193 |ns3| you will be using.  First, we'll say a word about running bake.
   191 
   194 
   192 bake works by downloading source packages into a source directory,
   195 bake works by downloading source packages into a source directory,
   208 several bake use cases do not require setting PATH and PYTHONPATH as above,
   211 several bake use cases do not require setting PATH and PYTHONPATH as above,
   209 full builds of ns-3-allinone (with the optional packages) typically do.
   212 full builds of ns-3-allinone (with the optional packages) typically do.
   210 
   213 
   211 Step into the workspace directory and type the following into your shell::
   214 Step into the workspace directory and type the following into your shell::
   212 
   215 
   213   $ ./bake.py configure -e ns-3.23
   216   $ ./bake.py configure -e ns-3.24
   214 
   217 
   215 Next, we'l ask bake to check whether we have enough tools to download
   218 Next, we'l ask bake to check whether we have enough tools to download
   216 various components.  Type::
   219 various components.  Type::
   217 
   220 
   218   $ ./bake.py check
   221   $ ./bake.py check
   251 
   254 
   252   $ ./bake.py download
   255   $ ./bake.py download
   253 
   256 
   254 should yield something like::
   257 should yield something like::
   255 
   258 
   256    >> Searching for system dependency pygoocanvas - OK
   259    >> Downloading gccxml-ns3 (target directory:gccxml) - OK
   257    >> Searching for system dependency python-dev - OK
   260    >> Searching for system dependency python-dev - OK
   258    >> Searching for system dependency pygraphviz - OK
   261    >> Searching for system dependency pygraphviz - OK
   259    >> Downloading pybindgen-0.17.0.886 - OK
   262    >> Searching for system dependency pygoocanvas - OK
       
   263    >> Searching for system dependency setuptools - OK
   260    >> Searching for system dependency g++ - OK
   264    >> Searching for system dependency g++ - OK
   261    >> Searching for system dependency qt4 - OK
   265    >> Searching for system dependency qt4 - OK
       
   266    >> Downloading pygccxml - OK
   262    >> Downloading netanim-3.106 - OK
   267    >> Downloading netanim-3.106 - OK
   263    >> Downloading ns-3.23 - OK    
   268    >> Downloading pybindgen-0.17.0.post41+ngd10fa60 (target directory:pybindgen) - OK
   264 
   269    >> Downloading ns-3.24 - OK
   265 The above suggests that three sources have been downloaded.  Check the
   270 
       
   271 The above suggests that five sources have been downloaded.  Check the
   266 ``source`` directory now and type ``ls``; one should see::
   272 ``source`` directory now and type ``ls``; one should see::
   267 
   273 
   268   $ ls
   274   $ ls
   269   netanim-3.106  ns-3.23  pybindgen-0.17.0.886
   275   gccxml  netanim-3.106  ns-3.24  pybindgen  pygccxml  pygccxml-1.0.0.zip
   270 
   276 
   271 You are now ready to build the |ns3| distribution.
   277 You are now ready to build the |ns3| distribution.
   272 
   278 
   273 Building |ns3|
   279 Building |ns3|
   274 **************
   280 **************
   283 configuration and work with |ns3| will typically involve using the
   289 configuration and work with |ns3| will typically involve using the
   284 native |ns3| build system, Waf, to be introduced later in this tutorial.  
   290 native |ns3| build system, Waf, to be introduced later in this tutorial.  
   285 
   291 
   286 If you downloaded
   292 If you downloaded
   287 using a tarball you should have a directory called something like 
   293 using a tarball you should have a directory called something like 
   288 ``ns-allinone-3.23`` under your ``~/workspace`` directory.  
   294 ``ns-allinone-3.24`` under your ``~/workspace`` directory.  
   289 Type the following::
   295 Type the following::
   290 
   296 
   291   $ ./build.py --enable-examples --enable-tests
   297   $ ./build.py --enable-examples --enable-tests
   292 
   298 
   293 Because we are working with examples and tests in this tutorial, and
   299 Because we are working with examples and tests in this tutorial, and
   299 
   305 
   300 You will see lots of typical compiler output messages displayed as the build
   306 You will see lots of typical compiler output messages displayed as the build
   301 script builds the various pieces you downloaded.  Eventually you should see the
   307 script builds the various pieces you downloaded.  Eventually you should see the
   302 following::
   308 following::
   303 
   309 
   304    Waf: Leaving directory `/path/to/workspace/ns-allinone-3.23/ns-3.23/build'
   310    Waf: Leaving directory `/path/to/workspace/ns-allinone-3.24/ns-3.24/build'
   305    'build' finished successfully (6m25.032s)
   311    'build' finished successfully (6m25.032s)
   306   
   312   
   307    Modules built:
   313    Modules built:
   308    antenna                   aodv                      applications             
   314    antenna                   aodv                      applications             
   309    bridge                    buildings                 config-store             
   315    bridge                    buildings                 config-store             
   321    
   327    
   322    Modules not built (see ns-3 tutorial for explanation):
   328    Modules not built (see ns-3 tutorial for explanation):
   323    brite                     click                     openflow                 
   329    brite                     click                     openflow                 
   324    visualizer               
   330    visualizer               
   325 
   331 
   326    Leaving directory `./ns-3.23'
   332    Leaving directory `./ns-3.24'
   327 
   333 
   328 Regarding the portion about modules not built::
   334 Regarding the portion about modules not built::
   329 
   335 
   330   Modules not built (see ns-3 tutorial for explanation):
   336   Modules not built (see ns-3 tutorial for explanation):
   331   brite                     click                     openflow                 
   337   brite                     click                     openflow                 
   347 
   353 
   348   $ ./bake.py build
   354   $ ./bake.py build
   349 
   355 
   350 and you should see something like::
   356 and you should see something like::
   351 
   357 
   352   >> Building pybindgen-0.17.0.886 - OK
   358   >> Building gccxml-ns3 - OK
       
   359   >> Building pygccxml - OK
   353   >> Building netanim-3.106 - OK
   360   >> Building netanim-3.106 - OK
   354   >> Building ns-3.23 - OK
   361   >> Building pybindgen-0.17.0.post41+ngd10fa60 - OK
   355 
   362   >> Building ns-3.24 - OK
   356 *Hint:  you can also perform both steps, download and build by calling 'bake.py deploy'.*
   363 
       
   364 *Hint:  you can also perform both steps, download and build, by calling 'bake.py deploy'.*
   357 
   365 
   358 If there happens to be a failure, please have a look at what the following
   366 If there happens to be a failure, please have a look at what the following
   359 command tells you; it may give a hint as to a missing dependency::
   367 command tells you; it may give a hint as to a missing dependency::
   360 
   368 
   361   $ ./bake.py show
   369   $ ./bake.py show