Professional Documents
Culture Documents
Build
Build
Waf is a Python-based
build system (http://www.freehackers.org/~tnagy/waf.html)
Note: We've added a wiki page with more complete build instructions
than the quick ones you find below:
http://www.nsnam.org/wiki/Installation
https://code.launchpad.net/~gjc/waf/cmd
To build ns-3 with waf type the commands from the top-level directory:
1. ./waf configure [options]
2. ./waf
To see valid configure options, type ./waf --help. The most important
option is -d <debug level>. Valid debug levels (which are listed in
waf --help) are: "debug" or "optimized", with debug being default. It is
also possible to change the flags used for compilation with (e.g.):
CXXFLAGS="-O3" ./waf configure. By default, ns-3 is built as debug code,
with examples and tests disabled, and with python bindings enabled.
[ Note: Unlike some other build tools, to change the build target,
the option must be supplied during the configure stage rather than
the build stage (i.e., "./waf -d optimized" will not work; instead, do
"./waf -d optimized configure; ./waf" ]
3. ./waf --doxygen
Run doxygen to generate documentation
5. ./waf --shell
Starts a nested system shell with modified environment to run ns3 programs.
6. ./waf distclean
Cleans out the entire build/ directory
7. ./waf dist
The command 'waf dist' can be used to create a distribution tarball.
It includes all files in the source directory, except some particular
extensions that are blacklisted, such as back files (ending in ~).
def build(bld):
module = bld.create_ns3_module('ns3-mymodule', ['core'])
module.source = [
'model/ns3-mymodule.cc',
'helper/ns3-mymodule-helper.cc',
]
headers = bld.new_task_gen(features=['ns3header'])
headers.module = 'ns3-mymodule'
headers.source = [
'model/ns3-mymodule.h',
'helper/ns3-mymodule-helper.h',
]
if bld.env.ENABLE_EXAMPLES:
bld.add_subdirs('examples')
# bld.ns3_python_bindings()