[Ns-developers] ns-3 + waf 1.6.7, merged

Gustavo Carneiro gjcarneiro at gmail.com
Sun Sep 18 16:38:51 PDT 2011


On Sun, Sep 18, 2011 at 16:12, Gustavo Carneiro <gjcarneiro at gmail.com>wrote:

> Hello,
>
> As previously planned, I merged the waf1.6 branch of ns-3.  This upgrades
> ns-3 to the latest WAF release, 1.6.7.
>
> Doubtless some issues will turn up, but don't panic, just report any bugs
> you find and I'll fix it eventually.
>
> For end users, the main difference is that, by default, "build" no longer
> has a subdirectory debug or optimized.  To get different build directories
> for different build types, you can use the waf configure -o xxx option,
> e.g.:
> ./waf configure -o shared
> ./waf configure --enable-static -o static
>
> There is a slight performance issue in waf right now[1], but I'm hoping the
> maintainer gets it fixed soon.
>
> For maintainers of modules, some things to be aware:
>
> 1. No longer need to edit src/wscript to add a module, just create your
> module directory inside src and ns-3 will pick it up;
>
> 2. The ns3headers taskgen needs to be created with a features parameter
> name, the patch to update is like this:
>
>      1.7 <http://code.nsnam.org/ns-3-dev/diff/82cd20da9650/src/csma-layout/wscript#l1.7> -    headers = bld.new_task_gen('ns3header')     1.8 <http://code.nsnam.org/ns-3-dev/diff/82cd20da9650/src/csma-layout/wscript#l1.8> +    headers = bld.new_task_gen(features=['ns3header'])
>
>
> 3. In WAF 1.6, adding -Dxxx options is done via the DEFINES env. var.
> instead of CXXDEFINES;
>
>
Also, CPPPATH is now called INCLUDES.  Don't ask me why.


> 4. Configuration tests now raise exceptions for when the case the test
> fails, they need to be caught, e.g.:
>
>      1.8 <http://code.nsnam.org/ns-3-dev/rev/643cfe62eabf#l1.8> +from waflib.Errors import WafError     1.9 <http://code.nsnam.org/ns-3-dev/rev/643cfe62eabf#l1.9>      1.10 <http://code.nsnam.org/ns-3-dev/rev/643cfe62eabf#l1.10>  def configure(conf):    1.11 <http://code.nsnam.org/ns-3-dev/rev/643cfe62eabf#l1.11>      env = conf.env    1.12 <http://code.nsnam.org/ns-3-dev/rev/643cfe62eabf#l1.12> -    conf.find_program('mpic++', var='MPI')    1.13 <http://code.nsnam.org/ns-3-dev/rev/643cfe62eabf#l1.13> +    try:    1.14 <http://code.nsnam.org/ns-3-dev/rev/643cfe62eabf#l1.14> +        conf.find_program('mpic++', var='MPI')    1.15 <http://code.nsnam.org/ns-3-dev/rev/643cfe62eabf#l1.15> +    except WafError:    1.16 <http://code.nsnam.org/ns-3-dev/rev/643cfe62eabf#l1.16> +        return
>
>
>    Because there are a lot of conf.check(...) calls, I added a new method,
> conf.check_nonfatal() which is like conf.check() but catches the exception
> and returns False if the test fails;
>
> 5. waf env values are always lists now, e.g. env['PYTHON'] returns
> ['/usr/bin/python'], so you may need to add [0] to the value in some places;
>
> Thank you for your patience.
>
> [1] http://code.google.com/p/waf/issues/detail?id=1039
>
> --
> Gustavo J. A. M. Carneiro
> INESC Porto, UTM, WiN, http://win.inescporto.pt/gjc
> "The universe is always one step beyond logic." -- Frank Herbert
>



-- 
Gustavo J. A. M. Carneiro
INESC Porto, UTM, WiN, http://win.inescporto.pt/gjc
"The universe is always one step beyond logic." -- Frank Herbert


More information about the Ns-developers mailing list