Thread: [pygccxml-development] Re: My log
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-05-27 18:00:21
|
On 5/27/06, Lakin Wecker <lak...@gm...> wrote: > Sorry. I was not clear. There is an exception raised (see the bottom > of my log). Because I'm not yet familiar enough with py++, I thought > that this exception might be caused by one of the issues that you had > mentioned, (maybe #2?). And, because you were planning on fixing #2 > tonight, I thought I would not waste my time trying to solve this > problem until after it is fixed. Good. I start to fix it, right after I answer this mail :-). In most cases, just report the bug, with the way to reproduce it. > I will work on this for my next version. This is okay. I will try to guide you. You can take a look on some "big" scripts: pyplusplus_dev/exampples/boost_dev/dev/, date_time and random are good. --=20 Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Lakin W. <lak...@gm...> - 2006-05-27 18:12:11
|
I don't mind switching to a public mailing list at all. It will be benificial to have all of this recorded somewhere. On 5/27/06, Roman Yakovenko <rom...@gm...> wrote: > On 5/27/06, Lakin Wecker <lak...@gm...> wrote: > > Here is the script that I'm currently using and the results: > > http://lakin.weckers.net/ogre/OgrePython.py > > http://lakin.weckers.net/ogre/pyplusplus.log > > > > Maybe this is one of the issues you were talking about. > > > > To start this project, these are the rules that I have come up with: > > 1) protected and private members aren't necessary. (I think this is a safe > > general rule to start out with, there may be some exceptions in the future, > > but none that I can think of currently). > > 2) Ogre will name methods starting with a '_' when they need them to be > > public (For internal use), but don't think that they should be part of the > > API. > > 3) There are a number of abstract base classes , Like GPUProgram, which are > > needed for the C++ api, but may not be necessary in the python API. (I'm > > not yet sure of this.) > > Excuse me, but I think I don't understand something. I talked about > next issues: > 1. Ogre SharedPtr class. We will have to create manual wrapper for this class. > I could be wrong, but it should be very similar to code from boost.python > library that works with boost.shared_ptr class > > 2. include bitset header - resolved > > 3. unnamed classes - this one I should solve this evening. > What are the issues you are talking about. Sorry. I was not clear. There is an exception raised (see the bottom of my log). Because I'm not yet familiar enough with py++, I thought that this exception might be caused by one of the issues that you had mentioned, (maybe #2?). And, because you were planning on fixing #2 tonight, I thought I would not waste my time trying to solve this problem until after it is fixed. > I took a look on your script. You are doing good. Your script is missing call > policies: > > http://boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.call_policies > > For example Ogre defines "clone" member function, that returns raw pointer to > new object. > > mb.member_functions( 'clone' ).call_policies \ > = module_builder.call_policies.return_value_policy( > module_builder.call_policies.manage_new_object ) You're right, this is something that needs to be taken care of, although, I had not yet realized it. I will work on this for my next version. > Another issue, I found in your script: you write all generated code into > single file. I am almost sure, that most of compilers will not handle this. > You can use another API provided by module_builder_t class: > > mb.split_module( directory name ) I knew this was an issue and was going to investigate it, but you've answered my question already. Thanks. > All generated code will be split to multiple files, using classic C++ strategy: > 1 class == source + header files. > > You may have some issues using this API - template instantiations. > In python "vector<int>" is illegal name, so py++ replace is with something > ugly: "vector_less_int_more" or something like this. The name could be too > long, so file system will not let py++ to create file with such name. > You should give > an alias to the class: > > mb.class_( 'vector<int>' ).alias = "VectorOfInt" Ok, I will check into this. Thanks for your help. > Any way I am online and ready for hard work :-). Ok, sounds good. Me too. Lakin > P.S. > If you don't mind, I would like to switch to public mailing list. I am > almost sure, that > the issues you have, other people will have too. I would like to share > my answer. > Here is a page where you can subscribe to py++ mailing list( low traffic): > > https://lists.sourceforge.net/lists/listinfo/pygccxml-development > > Thanks. > -- > Roman Yakovenko > C++ Python language binding > http://www.language-binding.net/ > |
From: Roman Y. <rom...@gm...> - 2006-05-27 19:23:04
|
On 5/27/06, Lakin Wecker <lak...@gm...> wrote: > I've update from svn, and done some of your optimizations that you > mentioned, but I still get the error. The log file has been cut: tail pyplusplus.log Alias: address Ignore: True Signature: [u'::Ogre::EdgeListBuilder::Geometry *', [u'::Ogre::EdgeListBuilder::Geometry &']] Call policies: None Use keywords: True Use signature: True Use default arguments: True member_function_t: 'address' location: [/usr/include/c++/4.0.3/ext/new_allocator.h]:78 artificial: 'Fals~ What is the error you are talking about. It works fine on my computer. uname -a Linux umka 2.6.15-22-386 #1 PREEMPT Sun May 7 15:49:09 UTC 2006 i686 GNU/Li= nux And I am using Ogre 1.2 > I've reuploaded the log and the python file. > > Lakin --=20 Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Roman Y. <rom...@gm...> - 2006-05-27 20:12:37
|
Another issue, that you will have is absolute paths in generated code. There are 2 ways to solve it: mb =3D module_builder_t( ... ) mb.build_code_creator( ... ) #This will replace all include headers, except boost.python related mb.code_creator.replace_included_headers( ['Ogre.h'] ) #Or another approach: mb.code_creator.user_defined_directories( 'my dir' ) In this case py++ will generate code and will calculate include headers relatively to 'my dir' directory --=20 Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Lakin W. <lak...@gm...> - 2006-05-27 20:13:08
|
forwarding to the list as well. ---------- Forwarded message ---------- From: Lakin Wecker <lak...@gm...> Date: May 27, 2006 1:08 PM Subject: Re: My log To: Roman Yakovenko <rom...@gm...> I've update from svn, and done some of your optimizations that you mentioned, but I still get the error. I've reuploaded the log and the python file. Lakin On 5/27/06, Roman Yakovenko <rom...@gm...> wrote: > Okay. The error you reported has been fixed. pyplusplus did not take into > account that member variable can hold pointer to function. This has been fixed. > File that contains the fix is attached. Please put it into > pyplusplus/decl_wrappers > directory. ( It is also committed to repository ) > > Also I want to give you few tips: > > 1. Speed could be improved: > from pygccxml import parser > > ogre_header \ > = parser.create_cached_source_fc( r" path to/Ogre.h", "path > to/ogre.xml" ) ] > > mb = module_builder_t( [ogre_header], .... ) > > It will create xml file in location you specify and will reuse it > every time. Thus you > will save time by not invoking gccxml every time. > > IT IS UP TO YOU to remove the xml file if you change source files. You can > remove the XML file from ogre build scripts. > > You can read more about this function in pygccxml_dev/docs/design.rest file. > > 2. Cool feature: > > mb.calldefs( access_type_matcher_t( 'protected' ) ).exclude() > mb.calldefs( access_type_matcher_t( 'protected' ) ).exclude() > > is equal to: > > mb.calldefs( ~access_type_matcher_t( 'public' ) ).exclude() > > > -- > Roman Yakovenko > C++ Python language binding > http://www.language-binding.net/ > > > |
From: Roman Y. <rom...@gm...> - 2006-05-27 20:29:52
|
On 5/27/06, Lakin Wecker <lak...@gm...> wrote: > I've update from svn, and done some of your optimizations that you > mentioned, but I still get the error. > > I've reuploaded the log and the python file. I could be wrong, but it seems to me, that you did not updated the file. --=20 Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Lakin W. <lak...@gm...> - 2006-05-28 05:06:28
|
*Resending to the list* .. (sorry for all the direct mails, roman. It's late and I'm tired) I updated to revision 168, and this time I actually installed it after updating. :) I also added your tip for excluding the absolute paths. You were right, the files were not properly uploaded, although I am not sure what went wrong. This time I've uploaded them and checked that they worked. The links are at the bottom of the letter, but there are no problems, so I provide them only for a reference. Currently, I'm getting ready to really start working on the bindings. I need to have a look at the Ogre classes and decide what needs to be exported, and what doesn't. Additionally, I should look at the call policies as you have mentioned. Thanks again for your help, and see you tomorrow. Lakin http://lakin.weckers.net/ogre/OgrePython.py http://lakin.weckers.net/ogre/pyplusplus.log.bz2 On 5/27/06, Roman Yakovenko <rom...@gm...> wrote: > On 5/27/06, Lakin Wecker <lak...@gm...> wrote: > > I've update from svn, and done some of your optimizations that you > > mentioned, but I still get the error. > > > > I've reuploaded the log and the python file. > I could be wrong, but it seems to me, that you did not updated the file. > -- > Roman Yakovenko > C++ Python language binding > http://www.language-binding.net/ > > > ------------------------------------------------------- > All the advantages of Linux Managed Hosting--Without the Cost and Risk! > Fully trained technicians. The highest number of Red Hat certifications i= n > the hosting industry. Fanatical Support. Click to learn more > http://sel.as-us.falkag.net/sel?cmdlnk&kid=107521&bid$8729&dat=121642 > _______________________________________________ > pygccxml-development mailing list > pyg...@li... > https://lists.sourceforge.net/lists/listinfo/pygccxml-development > |
From: Roman Y. <rom...@gm...> - 2006-05-28 05:26:25
|
On 5/28/06, Lakin Wecker <lak...@gm...> wrote: > I updated to revision 168, and this time I actually installed it after > updating. :) :-) > Currently, I'm getting ready to really start working on the bindings. > I need to have a look at the Ogre classes and decide what needs to be > exported, and what doesn't. May I give you small advice? I saw on PyOgre page few examples, how to use PyOgre. Just peak up one of them( the smallest ) and make it work. If it works for you - fine, peak another example. If not :-( - you know where to find me. > > Thanks again for your help, and see you tomorrow. My pleasure. > Lakin > > http://lakin.weckers.net/ogre/OgrePython.py > http://lakin.weckers.net/ogre/pyplusplus.log.bz2 --=20 Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Lakin W. <lak...@gm...> - 2006-05-28 17:33:26
|
I've tried using the boost date_time bindings as an example of how to build the library once the cpp files are generated. So I copied the sconscript and hacked it to compile the files. There are some things that need to be fixed in my script, such as the python path is hardcoded, and the cpp path is hardcoded, but I was just hoping to hack together something that works, and then clean it up The following links show you the sconscript I used, and the log is generated from running: scons -f sconscript >& Scons.log http://lakin.weckers.net/ogre/sconscript http://lakin.weckers.net/ogre/Scons.log any thoughts on where I can investigate this? Lakin |
From: Roman Y. <rom...@gm...> - 2006-05-28 17:46:37
|
On 5/28/06, Lakin Wecker <lak...@gm...> wrote: > I've tried using the boost date_time bindings as an example of how to > build the library once the cpp files are generated. So I copied the > sconscript and hacked it to compile the files. There are some things > that need to be fixed in my script, such as the python path is > hardcoded, and the cpp path is hardcoded, but I was just hoping to > hack together something that works, and then clean it up > > The following links show you the sconscript I used, and the log is > generated from running: > scons -f sconscript >& Scons.log > > http://lakin.weckers.net/ogre/sconscript > http://lakin.weckers.net/ogre/Scons.log > > any thoughts on where I can investigate this? Yes, you can read it :-). cpp/Overlay2DElementsIterator.pypp.cpp:26: instantiated from here /usr/include/boost/python/detail/invoke.hpp:88: error: no match for call to '(const boost::python::detail::specify_a_return_value_policy_to_wrap_functions_retu= rning<Ogre::OverlayContainer*>) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (Ogre::OverlayContainer*)' You did not set call policies :-(. from pyplusplus import utils mb =3D module_builder_t( ... ) utils.missing_call_policies.print_ ( mb.code_creator ) utils.missing_call_policies.exclude( mb.code_creator ) Basically next code will print all function, that are missing call policies and then will remove them. May be it will work, may be not ( hint pure virtual functions ). > Lakin --=20 Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |
From: Lakin W. <lak...@gm...> - 2006-05-28 18:01:50
|
Right. I never realized that boost would return error messages in such a way, but it makes sense. I will work on this. Lakin On 5/28/06, Roman Yakovenko <rom...@gm...> wrote: > On 5/28/06, Lakin Wecker <lak...@gm...> wrote: > > I've tried using the boost date_time bindings as an example of how to > > build the library once the cpp files are generated. So I copied the > > sconscript and hacked it to compile the files. There are some things > > that need to be fixed in my script, such as the python path is > > hardcoded, and the cpp path is hardcoded, but I was just hoping to > > hack together something that works, and then clean it up > > > > The following links show you the sconscript I used, and the log is > > generated from running: > > scons -f sconscript >& Scons.log > > > > http://lakin.weckers.net/ogre/sconscript > > http://lakin.weckers.net/ogre/Scons.log > > > > any thoughts on where I can investigate this? > > Yes, you can read it :-). > > cpp/Overlay2DElementsIterator.pypp.cpp:26: instantiated from here > /usr/include/boost/python/detail/invoke.hpp:88: error: no match for > call to '(const > boost::python::detail::specify_a_return_value_policy_to_wrap_functions_returning<Ogre::OverlayContainer*>) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > (Ogre::OverlayContainer*)' > > You did not set call policies :-(. > > from pyplusplus import utils > > mb = module_builder_t( ... ) > > utils.missing_call_policies.print_ ( mb.code_creator ) > utils.missing_call_policies.exclude( mb.code_creator ) > > Basically next code will print all function, that are missing call policies > and then will remove them. May be it will work, may be not > ( hint pure virtual functions ). > > > Lakin > -- > Roman Yakovenko > C++ Python language binding > http://www.language-binding.net/ > |
From: Roman Y. <rom...@gm...> - 2006-05-27 18:48:43
Attachments:
variable_wrapper.py
|
Okay. The error you reported has been fixed. pyplusplus did not take into account that member variable can hold pointer to function. This has been fi= xed. File that contains the fix is attached. Please put it into pyplusplus/decl_wrappers directory. ( It is also committed to repository ) Also I want to give you few tips: 1. Speed could be improved: from pygccxml import parser ogre_header \ =3D parser.create_cached_source_fc( r" path to/Ogre.h", "path to/ogre.xml" ) ] mb =3D module_builder_t( [ogre_header], .... ) It will create xml file in location you specify and will reuse it every time. Thus you will save time by not invoking gccxml every time. IT IS UP TO YOU to remove the xml file if you change source files. You c= an remove the XML file from ogre build scripts. You can read more about this function in pygccxml_dev/docs/design.rest f= ile. 2. Cool feature: mb.calldefs( access_type_matcher_t( 'protected' ) ).exclude() mb.calldefs( access_type_matcher_t( 'protected' ) ).exclude() is equal to: mb.calldefs( ~access_type_matcher_t( 'public' ) ).exclude() --=20 Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |