Python bindings generation and module loading (waf)

25 views
Skip to first unread message

gabriel...@gmail.com

unread,
Dec 27, 2018, 12:12:54 AM12/27/18
to ns-3-users
Hi,


I've been working on replacing waf with CMake, but I've hit some problems with the python bindings generation.

I spent some time looking at the waf scripts, at the source and manual of Pybindgen and at the wiki, but didn't manage to figure out how exactly it works and what are the steps to produce the source files, nor how to load the python module.


From what I read on the waf files, I think it calls something like:

python2 ns3/bindings/python/ns3modulegen-modular.py ns3/src/${libname}/ ${arch} ${libname} ns3/src/${libname}/bindings/${module_src})
python2 ./bindings/modulegen__${arch}.py 2> ns3/src/${libname}/bindings/ns3modulegen.log)

assuming ${arch} = gcc_LP64 or ILP32; ${libname} = core, wifi, internet, network, etc; ${module_src} = the python bindings for the current module.
        
It generated some output files, that I've managed to compile to output into the library (at least for the ns3 core component/library), but I'm completely lost on how am I supposed to load it into python and check if everything is working.


I wanted to know if there is some documentation about the steps required to generate those files or if anyone knows how it works, so that I can replicate it on CMake. 


Thank you for any help you can provide.

Best regards.
Reply all
Reply to author
Forward
0 new messages