Make examples not be built by default
parent
46d63e113b
commit
1f9ea7d2ef
|
@ -48,17 +48,17 @@ us a note on ns-developers mailing list. </p>
|
||||||
|
|
||||||
<h2>Changes to build system:</h2>
|
<h2>Changes to build system:</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li><b>Tests are no longer built by default in ns-3</b>
|
<li><b>Examples and tests are no longer built by default in ns-3</b>
|
||||||
<p>
|
<p>
|
||||||
You can now make tests be built in ns-3 in two ways.
|
You can now make examples and tests be built in ns-3 in two ways.
|
||||||
<ol>
|
<ol>
|
||||||
<li> Using build.py when ns-3 is built for the first time:
|
<li> Using build.py when ns-3 is built for the first time:
|
||||||
<pre>
|
<pre>
|
||||||
./build.py --enable-tests
|
./build.py --enable-examples --enable-tests
|
||||||
</pre>
|
</pre>
|
||||||
<li> Using waf once ns-3 has been built:
|
<li> Using waf once ns-3 has been built:
|
||||||
<pre>
|
<pre>
|
||||||
./waf configure --enable-tests
|
./waf configure --enable-examples --enable-tests
|
||||||
</pre>
|
</pre>
|
||||||
</ol>
|
</ol>
|
||||||
</p></li>
|
</p></li>
|
||||||
|
|
|
@ -36,8 +36,8 @@ The resulting binaries are placed in build/<debuglevel>/srcpath.
|
||||||
|
|
||||||
Other waf usages include:
|
Other waf usages include:
|
||||||
|
|
||||||
1. ./waf configure --enable-tests
|
1. ./waf configure --enable-examples --enable-tests
|
||||||
Turn on unit tests.
|
Turn on examples and tests.
|
||||||
|
|
||||||
2. ./waf --doxygen
|
2. ./waf --doxygen
|
||||||
Run doxygen to generate documentation
|
Run doxygen to generate documentation
|
||||||
|
|
|
@ -768,7 +768,7 @@ Ubuntu installation command is:::
|
||||||
sudo apt-get install libgtk2.0-0 libgtk2.0-dev
|
sudo apt-get install libgtk2.0-0 libgtk2.0-dev
|
||||||
|
|
||||||
To check whether it is configured or not, check the output of the
|
To check whether it is configured or not, check the output of the
|
||||||
./waf configure --enable-tests step:::
|
./waf configure --enable-examples --enable-tests step:::
|
||||||
|
|
||||||
---- Summary of optional NS-3 features:
|
---- Summary of optional NS-3 features:
|
||||||
Threading Primitives : enabled
|
Threading Primitives : enabled
|
||||||
|
@ -776,7 +776,7 @@ To check whether it is configured or not, check the output of the
|
||||||
GtkConfigStore : not enabled (library 'gtk+-2.0 >= 2.12' not found)
|
GtkConfigStore : not enabled (library 'gtk+-2.0 >= 2.12' not found)
|
||||||
|
|
||||||
In the above example, it was not enabled, so it cannot be used until a suitable
|
In the above example, it was not enabled, so it cannot be used until a suitable
|
||||||
version is installed and ./waf configure --enable-tests; ./waf is rerun.
|
version is installed and ./waf configure --enable-examples --enable-tests; ./waf is rerun.
|
||||||
|
|
||||||
Usage is almost the same as the non-GTK-based version, but there
|
Usage is almost the same as the non-GTK-based version, but there
|
||||||
are no ConfigStore attributes involved:::
|
are no ConfigStore attributes involved:::
|
||||||
|
|
|
@ -73,7 +73,7 @@ The --enable-wifi flag may be skipped if you don't intend on using Click with Wi
|
||||||
Once Click has been built successfully, change into the ns-3 directory and
|
Once Click has been built successfully, change into the ns-3 directory and
|
||||||
configure ns-3 with Click Integration support::
|
configure ns-3 with Click Integration support::
|
||||||
|
|
||||||
$: ./waf configure --enable-tests --with-nsclick=/path/to/click/source
|
$: ./waf configure --enable-examples --enable-tests --with-nsclick=/path/to/click/source
|
||||||
|
|
||||||
If it says 'enabled' beside 'NS-3 Click Integration Support', then you're good to go.
|
If it says 'enabled' beside 'NS-3 Click Integration Support', then you're good to go.
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ If you already built |ns3| without MPI enabled, you must re-build:::
|
||||||
|
|
||||||
Configure |ns3| with the --enable-mpi option:::
|
Configure |ns3| with the --enable-mpi option:::
|
||||||
|
|
||||||
./waf -d debug configure --enable-tests --enable-mpi
|
./waf -d debug configure --enable-examples --enable-tests --enable-mpi
|
||||||
|
|
||||||
Ensure that MPI is enabled by checking the optional features shown from the
|
Ensure that MPI is enabled by checking the optional features shown from the
|
||||||
output of configure.
|
output of configure.
|
||||||
|
|
|
@ -143,7 +143,7 @@ the library. From the "openflow" directory, run:::
|
||||||
link to an ns-3 build with this OpenFlow switch module, run from the ns-3-dev
|
link to an ns-3 build with this OpenFlow switch module, run from the ns-3-dev
|
||||||
(or whatever you have named your distribution):::
|
(or whatever you have named your distribution):::
|
||||||
|
|
||||||
$ ./waf configure --enable-tests --with-openflow=path/to/openflow
|
$ ./waf configure --enable-examples --enable-tests --with-openflow=path/to/openflow
|
||||||
|
|
||||||
#3 Under ``---- Summary of optional NS-3 features:`` you should see:::
|
#3 Under ``---- Summary of optional NS-3 features:`` you should see:::
|
||||||
|
|
||||||
|
|
|
@ -164,7 +164,7 @@ Using the ``build.py`` script in ns-3-allinone directory, NSC will be enabled by
|
||||||
default unless the platform does not support it. To disable it when building
|
default unless the platform does not support it. To disable it when building
|
||||||
|ns3|, type:::
|
|ns3|, type:::
|
||||||
|
|
||||||
./waf configure --enable-tests --disable-nsc
|
./waf configure --enable-examples --enable-tests --disable-nsc
|
||||||
|
|
||||||
Building and validating
|
Building and validating
|
||||||
+++++++++++++++++++++++
|
+++++++++++++++++++++++
|
||||||
|
|
|
@ -48,7 +48,7 @@ Steps in doing an ns-3 release
|
||||||
- cd ns-3.x
|
- cd ns-3.x
|
||||||
- ./test.py
|
- ./test.py
|
||||||
- ./test.py -g
|
- ./test.py -g
|
||||||
- ./waf -d optimized --enable-tests configure
|
- ./waf -d optimized --enable-examples --enable-tests configure
|
||||||
- ./waf
|
- ./waf
|
||||||
- ./test.py
|
- ./test.py
|
||||||
- ./test.py -g
|
- ./test.py -g
|
||||||
|
|
|
@ -64,11 +64,12 @@ as well.
|
||||||
``test.py`` is very flexible in allowing the user to specify the number
|
``test.py`` is very flexible in allowing the user to specify the number
|
||||||
and kind of tests to run; and also the amount and kind of output to generate.
|
and kind of tests to run; and also the amount and kind of output to generate.
|
||||||
|
|
||||||
Before running ``test.py``, make sure that ns3's tests have been built by doing the following
|
Before running ``test.py``, make sure that ns3's examples and tests
|
||||||
|
have been built by doing the following
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
./waf configure --enable-tests
|
./waf configure --enable-examples --enable-tests
|
||||||
./waf
|
./waf
|
||||||
|
|
||||||
By default, ``test.py`` will run all available tests and report status
|
By default, ``test.py`` will run all available tests and report status
|
||||||
|
|
|
@ -249,10 +249,10 @@ already have done a
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
./waf -d debug --enable-tests configure
|
./waf -d debug --enable-examples --enable-tests configure
|
||||||
|
|
||||||
in order to configure the project to perform debug builds that include
|
in order to configure the project to perform debug builds that include
|
||||||
tests. You will also have done a
|
examples and tests. You will also have done a
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
|
|
|
@ -264,12 +264,12 @@ breath and type the following:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
./build.py --enable-tests
|
./build.py --enable-examples --enable-tests
|
||||||
|
|
||||||
Because we are working with tests in this tutorial, and because they
|
Because we are working with examples and tests in this tutorial, and
|
||||||
are not built by default in |ns3|, the argument for build.py tells it
|
because they are not built by default in |ns3|, the arguments for
|
||||||
to build them for us. In the future you can build |ns3| without tests
|
build.py tells it to build them for us. In the future you can build
|
||||||
if you wish.
|
|ns3| without examples and tests if you wish.
|
||||||
|
|
||||||
You will see lots of typical compiler output messages displayed as the build
|
You will see lots of typical compiler output messages displayed as the build
|
||||||
script builds the various pieces you downloaded. Eventually you should see the
|
script builds the various pieces you downloaded. Eventually you should see the
|
||||||
|
@ -300,12 +300,12 @@ Probably the most useful configuration change you can make will be to
|
||||||
build the optimized version of the code. By default you have configured
|
build the optimized version of the code. By default you have configured
|
||||||
your project to build the debug version. Let's tell the project to
|
your project to build the debug version. Let's tell the project to
|
||||||
make an optimized build. To explain to Waf that it should do optimized
|
make an optimized build. To explain to Waf that it should do optimized
|
||||||
builds that include the tests, you will need to execute the
|
builds that include the examples and tests, you will need to execute the
|
||||||
following command,
|
following command,
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
./waf -d optimized --enable-tests configure
|
./waf -d optimized --enable-examples --enable-tests configure
|
||||||
|
|
||||||
This runs Waf out of the local directory (which is provided as a convenience
|
This runs Waf out of the local directory (which is provided as a convenience
|
||||||
for you). As the build system checks for various dependencies you should see
|
for you). As the build system checks for various dependencies you should see
|
||||||
|
@ -379,11 +379,11 @@ would not be enabled and a message would be displayed. Note further that there
|
||||||
a feature to use the program ``sudo`` to set the suid bit of certain programs.
|
a feature to use the program ``sudo`` to set the suid bit of certain programs.
|
||||||
This is not enabled by default and so this feature is reported as "not enabled."
|
This is not enabled by default and so this feature is reported as "not enabled."
|
||||||
|
|
||||||
Now go ahead and switch back to the debug build that includes the tests.
|
Now go ahead and switch back to the debug build that includes the examples and tests.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
./waf -d debug --enable-tests configure
|
./waf -d debug --enable-examples --enable-tests configure
|
||||||
|
|
||||||
The build system is now configured and you can build the debug versions of
|
The build system is now configured and you can build the debug versions of
|
||||||
the |ns3| programs by simply typing,
|
the |ns3| programs by simply typing,
|
||||||
|
@ -396,11 +396,11 @@ Some waf commands are meaningful during the build phase and some commands are va
|
||||||
in the configuration phase. For example, if you wanted to use the emulation
|
in the configuration phase. For example, if you wanted to use the emulation
|
||||||
features of |ns3|, you might want to enable setting the suid bit using
|
features of |ns3|, you might want to enable setting the suid bit using
|
||||||
sudo as described above. This turns out to be a configuration-time command, and so
|
sudo as described above. This turns out to be a configuration-time command, and so
|
||||||
you could reconfigure using the following command that also includes the tests
|
you could reconfigure using the following command that also includes the examples and tests
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
./waf -d debug --enable-sudo --enable-tests configure
|
./waf -d debug --enable-sudo --enable-examples --enable-tests configure
|
||||||
|
|
||||||
If you do this, waf will have run sudo to change the socket creator programs of the
|
If you do this, waf will have run sudo to change the socket creator programs of the
|
||||||
emulation code to run as root. There are many other configure- and build-time options
|
emulation code to run as root. There are many other configure- and build-time options
|
||||||
|
@ -499,10 +499,10 @@ type the following,
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
./waf -d debug --enable-tests configure
|
./waf -d debug --enable-examples --enable-tests configure
|
||||||
|
|
||||||
to tell ``waf`` to build the debug versions of the |ns3|
|
to tell ``waf`` to build the debug versions of the |ns3|
|
||||||
programs that includes the tests. You must still build
|
programs that includes the examples and tests. You must still build
|
||||||
the actual debug version of the code by typing,
|
the actual debug version of the code by typing,
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
6
utils.py
6
utils.py
|
@ -85,10 +85,10 @@ def read_config_file():
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
# By default, all modules will be enabled, examples will be enabled,
|
# By default, all modules will be enabled, examples will be disabled,
|
||||||
# and tests will be disabled.
|
# and tests will be disabled.
|
||||||
modules_enabled = ['all_modules']
|
modules_enabled = ['all_modules']
|
||||||
examples_enabled = True
|
examples_enabled = False
|
||||||
tests_enabled = False
|
tests_enabled = False
|
||||||
|
|
||||||
# See if the ns3 configuration file exists in the current working
|
# See if the ns3 configuration file exists in the current working
|
||||||
|
@ -111,7 +111,7 @@ def read_config_file():
|
||||||
modules_enabled = ['all_modules']
|
modules_enabled = ['all_modules']
|
||||||
|
|
||||||
# Read in whether examples should be enabled or not.
|
# Read in whether examples should be enabled or not.
|
||||||
value_if_missing = True
|
value_if_missing = False
|
||||||
examples_enabled = get_bool_from_file(dot_ns3rc_path, 'examples_enabled', value_if_missing)
|
examples_enabled = get_bool_from_file(dot_ns3rc_path, 'examples_enabled', value_if_missing)
|
||||||
|
|
||||||
# Read in whether tests should be enabled or not.
|
# Read in whether tests should be enabled or not.
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
modules_enabled = ['all_modules']
|
modules_enabled = ['all_modules']
|
||||||
|
|
||||||
# Set this equal to true if you want examples to be run.
|
# Set this equal to true if you want examples to be run.
|
||||||
examples_enabled = True
|
examples_enabled = False
|
||||||
|
|
||||||
# Set this equal to true if you want tests to be run.
|
# Set this equal to true if you want tests to be run.
|
||||||
tests_enabled = False
|
tests_enabled = False
|
||||||
|
|
4
wscript
4
wscript
|
@ -30,10 +30,10 @@ import Scripting
|
||||||
|
|
||||||
from utils import read_config_file
|
from utils import read_config_file
|
||||||
|
|
||||||
# By default, all modules will be enabled, examples will be enabled,
|
# By default, all modules will be enabled, examples will be disabled,
|
||||||
# and tests will be disabled.
|
# and tests will be disabled.
|
||||||
modules_enabled = ['all_modules']
|
modules_enabled = ['all_modules']
|
||||||
examples_enabled = True
|
examples_enabled = False
|
||||||
tests_enabled = False
|
tests_enabled = False
|
||||||
|
|
||||||
# Get the information out of the NS-3 configuration file.
|
# Get the information out of the NS-3 configuration file.
|
||||||
|
|
Loading…
Reference in New Issue