Re: [pygccxml-development] Help with single header setup
Brought to you by:
mbaas,
roman_yakovenko
From: Brendan D. <Bre...@di...> - 2009-07-31 21:50:24
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Thanks Roman, this helps me out.<br> <br> <blockquote cite="mid:746...@ma..." type="cite"> <pre wrap=""><!----> Interesting. I would like to investigate the problem. Is this an open source project? </pre> </blockquote> Unfortunately the project is proprietary in-house software. Using the single header rather than passing all of the headers to module_builder seems to solve the memory issue. It was the fact that classes are included by default when you pass headers in individually, and not included by default when included into a single header, that was throwing me off.<br> <br> Now I just have to solve the multi-module dependency errors that have started to show up, although I didn't get them when I was using the method of passing all headers individually. I'll be sure to ask more questions if I hit another roadblock. <br> <br> The Py++ project is quite nice, by the way. Thanks for providing it, and offering help.<br> <br> ~Brendan<br> <br> <blockquote cite="mid:746...@ma..." type="cite"> <pre wrap=""> </pre> <blockquote type="cite"> <pre wrap="">I read the section of documentation that said putting all of the headers into a single header is the way to go. This is where I'm stuck, and I don't have a lot of time to try and figure it out. Here's a greatly simplified version of what I'm currently doing. Can anyone tell me what I need to be doing instead? Foo.h: class Foo { public: Foo(void) { } void test(void) { } }; headers.h: #include "Foo.h" generate.py: from pyplusplus import module_builder GCCXML = '/path/to/gccxml' mb = module_builder.module_builder_t(files=['headers.h'], gccxml_path=GCCXML) mb.build_code_creator(module_name='_test') targets = mb.split_module('build') When I run generate.py, it produces _test.main.cpp: #include "boost/python.hpp" #include "headers.h" namespace bp = boost::python; BOOST_PYTHON_MODULE(_test){ } If instead of headers.h I pass Foo.h to module_builder_t, then it builds fine, except this is the case where in my large project it consumes far too much memory and takes too long. I tried having the pygccxml parser generate an xml for headers.h and passing that to module_builder, but that didn't work either. Looking at the xml file I do see the Foo declarations though, so it's just module_builder that's ignoring them. Any ideas would be greatly appreciated. I'm using the SVN version, on Linux (if that matters). </pre> </blockquote> <pre wrap=""><!----> The following documents should help you: * <a class="moz-txt-link-freetext" href="http://language-binding.net/pyplusplus/documentation/tutorials/module_builder/module_builder.html">http://language-binding.net/pyplusplus/documentation/tutorials/module_builder/module_builder.html</a> * <a class="moz-txt-link-freetext" href="http://language-binding.net/pygccxml/query_interface.html">http://language-binding.net/pygccxml/query_interface.html</a> In general you can write: mb.class_( 'Foo' ).include() </pre> </blockquote> <br> </body> </html> |