[Ns-developers] Python Bindings for optional ns-3 features
Gustavo Carneiro
gjcarneiro at gmail.com
Fri Mar 20 10:35:09 PDT 2009
2009/3/20 <craigdo at ee.washington.edu>
>
> > You are not supposed to ship generated bindings to another
> > system. Let each system generate its own python bindings
> > using pybindgen (but no gccxml or pygccxml needed).
> > Therefore, I see no problem here.
>
> This is not how I remember the bindings story unfolding. This is also not
> how things have worked since July 8, 2008 when the first Python bindings
> were checked into ns-3-dev. I believe that ever since then bindings were
> generated on one system and distributed along with everything else.
>
> So I think we have a problem that needs to be fixed one way or the other
> (either stop checking in bindings or start filtering them).
>
> I don't recall ever making bindings without using --python-scan (which does
> use gccxml, right?). What are you suggesting doing? I don't get it.
OK, maybe this is a confusion with terminology. There three stages in
creating bindings:
1. "scanning": waf --python-scan uses pybindgen+pygccxml+gccxml to scan
header files and generate the files bindings/python/ns3_module_*.py
2. "generation": during build, the bindings/python/ns3_module_*.py are read
and files build/<variant>/bindings/python/ns3_module_*.cc are generated
3. "compiling": the build/<variant>/bindings/python/ns3_module_*.cc are
compile into a .so file
Right now, and for a long time, the result of 1 is shipped in tarballs (and
mercurial repos). But not the "generated" .cc files; those were never
shipped.
When generating the .cc files, the bindings generated scripts already take
into account which features are enabled or disabled. Of course for new
added features some python code to do this disabling of bindings for
disabled features needs to be added. See bindings/python/ns3modulegen.py.
--
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert
More information about the Ns-developers
mailing list