New to xdress, have a few questions

148 views
Skip to first unread message

Thane Brimhall

unread,
Mar 4, 2014, 10:38:01 AM3/4/14
to xdr...@googlegroups.com
Hi all! I love the idea of xdress and I've been trying to get past the learning curve. (Which might I say is surprisingly shallow.) I've done some tweaking on the mypack tutorial project and I think I've gotten the basics down. Now I'm looking at using xdress in a bigger, real project.

I've wanted to wrap two large C++ libraries (Bullet and Ogre) in Cython and I've had some success doing the wrapping by hand. As you can imagine, it's slow, monotonous work. Would xdress be suited to wrapping very large, object-oriented libraries such as those?

I've taken what I've learned from the xdress tutorial and tried applying it to both libraries and I can't seem to get past the error: "ERROR: Document is empty, line 1, column 1". Is there something obvious I'm missing?

I'll admit a great knowledge deficiency when it comes to C++ and compiling stuff... I usually just `make` and `make install`. I appreciate any help; xdress seems to be just the solution I'm looking for!

/Thane Brimhall

Anthony Scopatz

unread,
Mar 5, 2014, 1:17:55 AM3/5/14
to Thane Brimhall, xdress
On Tue, Mar 4, 2014 at 9:38 AM, Thane Brimhall <thane.b...@gmail.com> wrote:
Hi all! I love the idea of xdress and I've been trying to get past the learning curve. (Which might I say is surprisingly shallow.)

Hi Thane!

Thanks for saying so!  This means a lot.
 
I've done some tweaking on the mypack tutorial project and I think I've gotten the basics down. Now I'm looking at using xdress in a bigger, real project.

I've wanted to wrap two large C++ libraries (Bullet and Ogre) in Cython and I've had some success doing the wrapping by hand. As you can imagine, it's slow, monotonous work. Would xdress be suited to wrapping very large, object-oriented libraries such as those?

Yes.  This is why xdress was written.  They may be some rough spots still. But hopefully we can help you get through those.
 
I've taken what I've learned from the xdress tutorial and tried applying it to both libraries and I can't seem to get past the error: "ERROR: Document is empty, line 1, column 1". Is there something obvious I'm missing?

Do you have a repo that we can look at? Alternatively what is the xdressrc.py file you are using?  I am actually not sure where this error is coming from.  What is the output of "xdress --debug"?
 
I'll admit a great knowledge deficiency when it comes to C++ and compiling stuff... I usually just `make` and `make install`. I appreciate any help; xdress seems to be just the solution I'm looking for!

Great!  If you send us some of the info above, we should be able to help.

Be Well
Anthony
 

/Thane Brimhall

--
You received this message because you are subscribed to the Google Groups "xdress" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/xdress/c01a8453-2a1a-4d21-ba70-c060c9dc31fb%40googlegroups.com.

Thane Brimhall

unread,
Mar 5, 2014, 10:43:10 AM3/5/14
to xdress
Hi Anthony! Thanks for the prompt response. I'm starting with Bullet, because that's the smaller library with fewer dependencies. I've started a GitHub repo and pushed my code to it:

https://github.com/pennomi/python-bullet

I've made some changes that let me get farther than I could before. First, I removed the `src/` directory I was previously using and moved all source files up into the root directory where `xdressrc.py` lives. Now when I run `xdress` it avoids the "Document is empty" error. I believe what was causing those is that the included files were not correctly located (ie. if I changed one of the source files to `#include "src/foobar.h"` instead of `#include "foobar.h"` it seemed to alleviate the problem). It's possible I'm doing something wrong in my `xdressrc.py` file that was causing this. I'd prefer to have a dedicated `src/` directory, so any suggestions here?

Note that my `xdressrc.py` file scans the directory structure for *all* `.cpp` files, excludes ones that can't/won't compile (ie. I'm on Linux, so no DX11 stuff), and then uses the autoscanning capabilities to handle all classes and functions in those files. This was the lazy way of doing things, and is probably what is causing my problem. I suppose I could manually go through the list of classes I want to wrap, but where's the fun in that? ;)

Now when I run `xdress`, it successfully scans all files, then I get an error that apparently was an issue some time ago, but was fixed:

autodescribe: describing btKinematicCharacterController
ONLYIN = set(['f66'])
ERROR: btKinematicCharacterController autodescribing failed: found class in '/home/thane/projects/bullet_xdress/BulletDynamics/Character/btKinematicCharacterController.h' ('f40') but expected it in '/home/thane/projects/bullet_xdress/BulletDynamics/Character/btKinematicCharacterController.cpp' ('f66').

Anyway, thanks for the prompt response! You've got a really cool project here and I feel like I'm really close to getting it work. Thank you!

/Thane

Jinsuo Nie

unread,
Mar 5, 2014, 7:03:33 PM3/5/14
to xdr...@googlegroups.com
I am having the exact same problem. What puzzled me is that a number of other .h and .cpp parsed before this one and had no problem.

Anthony Scopatz

unread,
Mar 5, 2014, 9:07:43 PM3/5/14
to Thane Brimhall, xdress
On Wed, Mar 5, 2014 at 9:43 AM, Thane Brimhall <thane.b...@gmail.com> wrote:
Hi Anthony! Thanks for the prompt response. I'm starting with Bullet, because that's the smaller library with fewer dependencies. I've started a GitHub repo and pushed my code to it:

https://github.com/pennomi/python-bullet

I've made some changes that let me get farther than I could before. First, I removed the `src/` directory I was previously using and moved all source files up into the root directory where `xdressrc.py` lives. Now when I run `xdress` it avoids the "Document is empty" error. I believe what was causing those is that the included files were not correctly located (ie. if I changed one of the source files to `#include "src/foobar.h"` instead of `#include "foobar.h"` it seemed to alleviate the problem). It's possible I'm doing something wrong in my `xdressrc.py` file that was causing this. I'd prefer to have a dedicated `src/` directory, so any suggestions here?

Hi Thane, 

You and Jinsuo certainly can have a dedicated src/ dir.  This was changed in the last release to allow source code to live anywhere.  Previously it had to live in a src/ directory and this was a mistake.    To get things to work you probably have to add src to the includes run control parameter in xdressrc.py: 

includes = ['src/']

This lets the parser know that this is a valid directory for header files.  Also note that you still have to refer to the api files by their relative or absolute paths.  That is:

classes = [('*', 'src/filename.cpp')]

I hope this clears things up.  
 
Note that my `xdressrc.py` file scans the directory structure for *all* `.cpp` files,

This is awesome!  I have never seen xdress run on so many files.
 
excludes ones that can't/won't compile (ie. I'm on Linux, so no DX11 stuff), and then uses the autoscanning capabilities to handle all classes and functions in those files. This was the lazy way of doing things, and is probably what is causing my problem. I suppose I could manually go through the list of classes I want to wrap, but where's the fun in that? ;)

Now when I run `xdress`, it successfully scans all files, then I get an error that apparently was an issue some time ago, but was fixed:

autodescribe: describing btKinematicCharacterController
ONLYIN = set(['f66'])
ERROR: btKinematicCharacterController autodescribing failed: found class in '/home/thane/projects/bullet_xdress/BulletDynamics/Character/btKinematicCharacterController.h' ('f40') but expected it in '/home/thane/projects/bullet_xdress/BulletDynamics/Character/btKinematicCharacterController.cpp' ('f66').

So the error message here tells you exactly what the problem is.  Basically, it found the class btKinematicCharacterController in the header file btKinematicCharacterController.h but you only told it to look in the source file btKinematicCharacterController.cpp.  You need to tell it to look in both files since there is often important class information in both.  The only time you shouldn't list the header and the source is when you don't have a header or you don't have a source!

To tell xdress to look in both, replace the API filename with a sequence of filenames:

classes = [('*', ['src/filename.h', 'src/filename.cpp'])]

I submitted a PR to you that implements this fix.  xdress still doesn't make it all the way through but it gets further along.  I think that you'll have to start excluding some other files too.
 
Anyway, thanks for the prompt response! You've got a really cool project here and I feel like I'm really close to getting it work. Thank you!

No worries. I'd say that it is highly unlikely that xdress will work straight out the box but hopefully it won't be too far off.

Be Well
Anthony
 

/Thane



On Tue, Mar 4, 2014 at 11:17 PM, Anthony Scopatz <sco...@gmail.com> wrote:
On Tue, Mar 4, 2014 at 9:38 AM, Thane Brimhall <thane.b...@gmail.com> wrote:
Hi all! I love the idea of xdress and I've been trying to get past the learning curve. (Which might I say is surprisingly shallow.)

Hi Thane!

Thanks for saying so!  This means a lot.
 
I've done some tweaking on the mypack tutorial project and I think I've gotten the basics down. Now I'm looking at using xdress in a bigger, real project.

I've wanted to wrap two large C++ libraries (Bullet and Ogre) in Cython and I've had some success doing the wrapping by hand. As you can imagine, it's slow, monotonous work. Would xdress be suited to wrapping very large, object-oriented libraries such as those?

Yes.  This is why xdress was written.  They may be some rough spots still. But hopefully we can help you get through those.
 
I've taken what I've learned from the xdress tutorial and tried applying it to both libraries and I can't seem to get past the error: "ERROR: Document is empty, line 1, column 1". Is there something obvious I'm missing?

Do you have a repo that we can look at? Alternatively what is the xdressrc.py file you are using?  I am actually not sure where this error is coming from.  What is the output of "xdress --debug"?
 
I'll admit a great knowledge deficiency when it comes to C++ and compiling stuff... I usually just `make` and `make install`. I appreciate any help; xdress seems to be just the solution I'm looking for!

Great!  If you send us some of the info above, we should be able to help.

Be Well
Anthony
 

/Thane Brimhall

--
You received this message because you are subscribed to the Google Groups "xdress" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/xdress/c01a8453-2a1a-4d21-ba70-c060c9dc31fb%40googlegroups.com.


--
You received this message because you are subscribed to the Google Groups "xdress" group.

Anthony Scopatz

unread,
Mar 5, 2014, 9:40:52 PM3/5/14
to Jinsuo Nie, xdress
On Wed, Mar 5, 2014 at 8:28 PM, Jinsuo Nie <ronal...@gmail.com> wrote:

Anthony,

I meant that i have the same problem of getting the same error message.  My source files are in a src tree.  A number of files went through well but just hit one class with this problem.  I am working on windows.  It seams to be a gccxml problem, but i need to figure that out. 

I want to confirm with you that for each api that has a list of source files, e.g., .h and .cpp, xdress basically creates another .cpp to #include them and feed that file to the parser. After that, xdress does not directly feed individual files in the list to the parser, gccxml in my case.  Please confirm my understanding.

Hi Jinsuo,

Yes, this is exactly what happens.

Be Well
Anthony

 

If this is correct, then gccxml may not munipulate the path equally for all files.

Jinsuo

You received this message because you are subscribed to a topic in the Google Groups "xdress" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/xdress/CAPk-6T6h4VRxNytqXZjW%2BX9cbJX8eSuiEVFSVAmApQ_%2Bd%3D8Zwg%40mail.gmail.com.

Thane Brimhall

unread,
Mar 6, 2014, 12:04:59 PM3/6/14
to xdress
Anthony,

This is awesome, now I've got my stuff working with a dedicated `src/` directory! Also, the pull request you submitted worked wonders on getting xdress further in analyzing the full source code. Now I've come to another error blocking me (as you know).

ERROR: type of 'btAlignedObjectArray' could not be determined

From what I can tell, this means I wasn't properly wrapping one of the files I was supposed to. It turns out that the entire implementation of this file was in the `.h`; there is no `.cpp`. Obviously my code wouldn't work here because I wasn't wrapping any `.h` files directly. I've attempted to change this by explicitly adding that specific header file to the `xdressrc.py` configuration, as exhibited here: https://github.com/pennomi/python-bullet/blob/master/xdressrc.py#L31.

This didn't seem to change anything, so I tried using xdress to wrap *just* that `.h` file. Here's the warning message I got:

WARNING: RuntimeWarning: None of these files are present: set(['/home/thane/projects/bullet_xdress/src/LinearMath/btAlignedObjectArray.hxx', '/home/thane/projects/bullet_xdress/src/LinearMath/btAlignedObjectArray.h++', '/home/thane/projects/bullet_xdress/src/LinearMath/btAlignedObjectArray.hpp', '/home/thane/projects/bullet_xdress/src/LinearMath/btAlignedObjectArray.h']); autodescribing will probably fail.

It seems xdress just ignored this file (maybe?), because I didn't see any `.pyx` files created. The warning also seems incorrect, because the file `/home/thane/projects/bullet_xdress/src/LinearMath/btAlignedObjectArray.h` actually *does* exist on my system. Unfortunately, I can't just ignore the files that need btAlignedObjectArray, because some of the fundamental classes of the library use it.

Thanks again for all your help on this. Let me know if there's anything I can do to help the xdress project in exchange (code, documentation, a donation, whatever).

/Thane



Anthony Scopatz

unread,
Mar 6, 2014, 11:57:04 PM3/6/14
to Thane Brimhall, xdress
On Thu, Mar 6, 2014 at 11:04 AM, Thane Brimhall <thane.b...@gmail.com> wrote:
Anthony,

This is awesome, now I've got my stuff working with a dedicated `src/` directory! Also, the pull request you submitted worked wonders on getting xdress further in analyzing the full source code. Now I've come to another error blocking me (as you know).

ERROR: type of 'btAlignedObjectArray' could not be determined

From what I can tell, this means I wasn't properly wrapping one of the files I was supposed to. It turns out that the entire implementation of this file was in the `.h`; there is no `.cpp`. Obviously my code wouldn't work here because I wasn't wrapping any `.h` files directly. I've attempted to change this by explicitly adding that specific header file to the `xdressrc.py` configuration, as exhibited here: https://github.com/pennomi/python-bullet/blob/master/xdressrc.py#L31.

This didn't seem to change anything, so I tried using xdress to wrap *just* that `.h` file. Here's the warning message I got:

WARNING: RuntimeWarning: None of these files are present: set(['/home/thane/projects/bullet_xdress/src/LinearMath/btAlignedObjectArray.hxx', '/home/thane/projects/bullet_xdress/src/LinearMath/btAlignedObjectArray.h++', '/home/thane/projects/bullet_xdress/src/LinearMath/btAlignedObjectArray.hpp', '/home/thane/projects/bullet_xdress/src/LinearMath/btAlignedObjectArray.h']); autodescribing will probably fail.

It seems xdress just ignored this file (maybe?), because I didn't see any `.pyx` files created. The warning also seems incorrect, because the file `/home/thane/projects/bullet_xdress/src/LinearMath/btAlignedObjectArray.h` actually *does* exist on my system. Unfortunately, I can't just ignore the files that need btAlignedObjectArray, because some of the fundamental classes of the library use it.

Hi Thane, 

I agree that in this instance, that error seems weird.

What is actually going on here is that the btAlignedObjectArray class is actually templated.  More precisely it is btAlignedObjectArray<T>.  However, this template is never actually instantiated in the header file. Templates need to be instantiated to be wrapped, just like they need to be instantiated to be used.

Instead of trying to wrap this file directly, you should add the btAlignedObjectArray.h to the anpiname file list for the files where xdress fails to find for example, the first one which fails for me is btGeometryUtil.

Let me know how this goes or if you are having trouble.  It is OK to add as many files as you need to the apiname.

Thanks again for all your help on this. Let me know if there's anything I can do to help the xdress project in exchange (code, documentation, a donation, whatever).

Thanks for the offer!  Code is *most* appreciated.  We have a number of open issues at https://github.com/xdress/xdress/issues?state=open  Find something that you are interested in working on and try to tackle it.  Submit a PR and we'll review it.  If you are having toruble picking one, just let us know :)

Be Well
Anthony
 

Thane Brimhall

unread,
Mar 10, 2014, 12:50:11 PM3/10/14
to xdress
Hi Anthony,

I'm not sure what I did, but in the last few days of tinkering I managed to get past the error. I tried to include the file in question with the other files in the apiname, but that caused the same error. I'm sure I was just doing something wrong. Either way, now everything gets past the "autoall" phase and the "autodescribe: registering" phase. I'm pretty deep into the "autodescribe: describing" phase now before I run into an error. Traceback (via the `--debug` option)

Traceback (most recent call last):
  File "/home/thane/.virtualenvs/xdress_test/bin/xdress", line 6, in <module>
    main()
  File "/home/thane/.virtualenvs/xdress_test/local/lib/python2.7/site-packages/xdress/main.py", line 222, in main
    plugins.execute()
  File "/home/thane/.virtualenvs/xdress_test/local/lib/python2.7/site-packages/xdress/plugins.py", line 374, in execute
    self.exit(e)
  File "/home/thane/.virtualenvs/xdress_test/local/lib/python2.7/site-packages/xdress/plugins.py", line 372, in execute
    plugin.execute(rc)
  File "/home/thane/.virtualenvs/xdress_test/local/lib/python2.7/site-packages/xdress/autodescribe.py", line 2302, in execute
    self.compute_classes(rc)
  File "/home/thane/.virtualenvs/xdress_test/local/lib/python2.7/site-packages/xdress/autodescribe.py", line 2469, in compute_classes
    desc = self.compute_desc(cls, 'class', rc)
  File "/home/thane/.virtualenvs/xdress_test/local/lib/python2.7/site-packages/xdress/autodescribe.py", line 2389, in compute_desc
    clang_includes=rc.clang_includes)
  File "/home/thane/.virtualenvs/xdress_test/local/lib/python2.7/site-packages/xdress/autodescribe.py", line 2248, in describe
    language=language, clang_includes=clang_includes)
  File "/home/thane/.virtualenvs/xdress_test/local/lib/python2.7/site-packages/xdress/autodescribe.py", line 432, in gccxml_describe
    describer.visit()
  File "/home/thane/.virtualenvs/xdress_test/local/lib/python2.7/site-packages/xdress/autodescribe.py", line 962, in visit
    self.visit_class(node)
  File "/home/thane/.virtualenvs/xdress_test/local/lib/python2.7/site-packages/xdress/autodescribe.py", line 625, in visit_class
    raise NotImplementedError(msg.format(name))
NotImplementedError: The type 'btDispatcher' is used as part of an API element but no declarations were made with it.  Please declare a variable of type 'btDispatcher' somewhere in the source or header.

I believe someone just barely opened up a new mailing list topic about this, so I'll link that here: https://groups.google.com/forum/#!topic/xdress/bR_C7vH0pqk

I'd attach my debug.txt file, but it's quite large. Instead, perhaps you could clone https://github.com/pennomi/python-bullet and run xdress instead. The latest commits I made should reduce the debug file's output to less than 10 MB. (Before these changes that file was ~160 MB).

I really have no idea what's going on; all my theories are completely unfounded. Thanks for your help so far. It feels like I'm awfully close!

/Thane

Anthony Scopatz

unread,
Mar 12, 2014, 9:26:26 PM3/12/14
to Thane Brimhall, xdress
Hi Thane, 

Sorry for taking a while to get back to you.  It has been a busy week at work :)
 

I'd attach my debug.txt file, but it's quite large. Instead, perhaps you could clone https://github.com/pennomi/python-bullet and run xdress instead.

I can't seem to get past btAlignedObjectArray - which is where I believe where I was stuck before.  Have you pushed back up to your repo?  The last commit I see is from 2 days ago.
 
The latest commits I made should reduce the debug file's output to less than 10 MB. (Before these changes that file was ~160 MB).

Yeah, the debug file is appended to each time xdress is run.  It should probably just be overwritten.  It is probably a 1 character change.  Pull requests welcome :)
 
I really have no idea what's going on; all my theories are completely unfounded. Thanks for your help so far. It feels like I'm awfully close!

I hope you are!

Be Well
Anthony
 

/Thane

--
You received this message because you are subscribed to the Google Groups "xdress" group.

Thane Brimhall

unread,
Mar 13, 2014, 12:05:34 PM3/13/14
to xdress
Hi Anthony,

Sorry for taking a while to get back to you.  It has been a busy week at work :)
 
No problem! Work always comes first.

I can't seem to get past btAlignedObjectArray - which is where I believe where I was stuck before.  Have you pushed back up to your repo?  The last commit I see is from 2 days ago. 
 
I've done a fresh clone of my repo and reinstalled xdress from master on GitHub into a fresh virtual environment and I still get the same result. Perhaps you just need to delete your build directory? It might have extra (unneeded) files in there based on my previous `xdressrc.py` attempts.

Yeah, the debug file is appended to each time xdress is run.  It should probably just be overwritten.  It is probably a 1 character change.  Pull requests welcome :)

I've submitted a pull request with the debug file change you mentioned. (It was *2* characters, not one. The horror!)

Thank you again for helping me through this.

/Thane 

Anthony Scopatz

unread,
Mar 15, 2014, 3:13:17 PM3/15/14
to Thane Brimhall, xdress
Hello Thane, 

I am seeing yet again a new error from a clean build of both xdress and bullett.  


autodescribe: describing btPolarDecomposition
Traceback (most recent call last):
  File "/home/scopatz/.local/bin/xdress", line 5, in <module>
    pkg_resources.run_script('xdress==0.5-dev', 'xdress')
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 509, in run_script
    def __iter__(self):
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 1397, in run_script
    if zip_path in self._index():
  File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.5_dev-py2.7-linux-x86_64.egg/EGG-INFO/scripts/xdress", line 6, in <module>
    main()
  File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.5_dev-py2.7-linux-x86_64.egg/xdress/main.py", line 222, in main
    plugins.execute()
  File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.5_dev-py2.7-linux-x86_64.egg/xdress/plugins.py", line 374, in execute
    self.exit(e)
  File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.5_dev-py2.7-linux-x86_64.egg/xdress/plugins.py", line 372, in execute
    plugin.execute(rc)
  File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.5_dev-py2.7-linux-x86_64.egg/xdress/autodescribe.py", line 2302, in execute
    self.compute_classes(rc)
  File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.5_dev-py2.7-linux-x86_64.egg/xdress/autodescribe.py", line 2469, in compute_classes
    desc = self.compute_desc(cls, 'class', rc)
  File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.5_dev-py2.7-linux-x86_64.egg/xdress/autodescribe.py", line 2389, in compute_desc
    clang_includes=rc.clang_includes)
  File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.5_dev-py2.7-linux-x86_64.egg/xdress/autodescribe.py", line 2248, in describe
    language=language, clang_includes=clang_includes)
  File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.5_dev-py2.7-linux-x86_64.egg/xdress/autodescribe.py", line 1170, in clang_describe
    desc = clang_describe_class(cls)
  File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.5_dev-py2.7-linux-x86_64.egg/xdress/autodescribe.py", line 1410, in clang_describe_class
    sig, defaults = clang_describe_args(kid)
  File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.5_dev-py2.7-linux-x86_64.egg/xdress/autodescribe.py", line 1512, in clang_describe_args
    defaults.append(_none_arg if default is None else clang_describe_expression(default))
  File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.5_dev-py2.7-linux-x86_64.egg/xdress/autodescribe.py", line 1675, in clang_describe_expression
    .format(s, kind, clang_str_location(exp.location)))
NotImplementedError: unhandled expression "DEFAULT_TOLERANCE" of kind VAR_DECL at /home/scopatz/python-bullet/src/LinearMath/btPolarDecomposition.h:17:27

What is the version of clang that you are using.  I seem to be on v3.2.  Maybe we can have a chat / hangout after hours (my time, Central) sometime next week?  I have no idea what is going on.  I'll try to hack on it next week in the evening as well.  I am a bit busy this wekend.

Be Well
Anthony


--
You received this message because you are subscribed to the Google Groups "xdress" group.

Thane Brimhall

unread,
Mar 16, 2014, 12:05:46 PM3/16/14
to xdress
Hi Anthony,
 
What is the version of clang that you are using.

Ah, that might be the issue. I've been using gcc and gccxml for this. I seem to recall that one needed to have a special patched version of clang to work around some bugs in clang?
 
 Maybe we can have a chat / hangout after hours (my time, Central) sometime next week?

Sounds great, I'm usually available any time after 7pm, Mountain time. (So that should be 8pm your time.) We can work out the details over mail/hangouts any time. Looking forward to working through this with you!

/Thane

Anthony Scopatz

unread,
Mar 28, 2014, 2:51:11 PM3/28/14
to Thane Brimhall, xdress
On Sun, Mar 16, 2014 at 9:05 AM, Thane Brimhall <thane.b...@gmail.com> wrote:
Hi Anthony,
 
What is the version of clang that you are using.

Ah, that might be the issue. I've been using gcc and gccxml for this. I seem to recall that one needed to have a special patched version of clang to work around some bugs in clang?

Hi Thane, 

No special version of clang is required.  An improved version of libclang and the python bindings are needed but these are both included with xdress itself.
 
 
 Maybe we can have a chat / hangout after hours (my time, Central) sometime next week?

Sounds great, I'm usually available any time after 7pm, Mountain time. (So that should be 8pm your time.) We can work out the details over mail/hangouts any time. Looking forward to working through this with you!

Sorry for dropping the ball so thoroughly here.  Did you ever make it through you issue?  I am much more free over the next couple of weeks.

Be Well
Anthony
 

/Thane

 
On Thu, Mar 13, 2014 at 11:05 AM, Thane Brimhall <thane.b...@gmail.com> wrote:
Hi Anthony,

Sorry for taking a while to get back to you.  It has been a busy week at work :)
 
No problem! Work always comes first.

I can't seem to get past btAlignedObjectArray - which is where I believe where I was stuck before.  Have you pushed back up to your repo?  The last commit I see is from 2 days ago. 
 
I've done a fresh clone of my repo and reinstalled xdress from master on GitHub into a fresh virtual environment and I still get the same result. Perhaps you just need to delete your build directory? It might have extra (unneeded) files in there based on my previous `xdressrc.py` attempts.

Yeah, the debug file is appended to each time xdress is run.  It should probably just be overwritten.  It is probably a 1 character change.  Pull requests welcome :)

I've submitted a pull request with the debug file change you mentioned. (It was *2* characters, not one. The horror!)

Thank you again for helping me through this.

/Thane 

--
You received this message because you are subscribed to the Google Groups "xdress" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/xdress/CAHeac5NixuNVJEt47DtLg%3DfYP1Xxu%3D14e-1cj_0BK9Qew4rEaA%40mail.gmail.com.


--
You received this message because you are subscribed to the Google Groups "xdress" group.

Thane Brimhall

unread,
Apr 9, 2014, 12:15:08 PM4/9/14
to xdress, Anthony Scopatz
Hi Anthony!

Yup, I kinda dropped off of the map for a while; things were busy for me too. Here's what I've accomplished in the last two weeks:
  • I've updated my repository that contains the bullet source code and xdress.
  • I've migrated to using clang 
  • I have a pretty good idea what's going on with the error you ran into. (ie. I know what triggers it, not how to fix it!)
So basically after I've updated my repository, I ran into a very similar error, though in a different place in the code:

Your error:

NotImplementedError: unhandled expression "DEFAULT_TOLERANCE" of kind VAR_DECL at /home/scopatz/python-bullet/src/LinearMath/btPolarDecomposition.h:17:27

What is DEFAULT_TOLERANCE? After grepping my code, it turns out it's this:

const btScalar btPolarDecomposition::DEFAULT_TOLERANCE = btScalar(0.0001);

The error I'm currently running into is this:

NotImplementedError: unhandled expression "btVector3(0,0,0)" of kind UNEXPOSED_EXPR at /home/thane/projects/bullet_xdress/src/BulletDynamics/Dynamics/btRigidBody.h:176:122

And when I comment out the offending code there, I get the error:

NotImplementedError: unhandled expression "btScalar(0.)" of kind CXX_FUNCTIONAL_CAST_EXPR at /home/thane/projects/bullet_xdress/src/BulletCollision/CollisionDispatch/btCollisionWorld.h:449:179

All of these situations seem to be related to "keyword args" (or whatever c++ calls them). It seems to trigger when the keyword arg's default is a bullet class instance.

Hopefully this will help us track down the issue!

Thank you, as always!

/Thane

Anthony Scopatz

unread,
Apr 10, 2014, 12:48:58 AM4/10/14
to Thane Brimhall, xdress
Hi Thane!

Good to hear from you.  This is actually a pretty tricky problem that I am not sure there is a clean way to solve.  Basically they are using a static member variable on the class as a default argument value.  By the time the member function is declared they haven't even defined (they have only declared) the variable - it doesn't have real value yet! To compound the issue, the argument / variable has it a custom type.

Frankly, I am not sure that there is a Python equivalent to this situation (maybe using properties to defer assignment, but even then it isn't quite the same). Maybe there is something more clever than what is popping into my head right now.

I think that for the time being that we should declare this "unwrappable", either skip giving this a default value in Python or give it None, and either skip further arguments or continue on, and issue a warning.  How does this sound?

Do you want to take as stab at writing a fix? I am pretty swamped and would appreciate the help.  For the record, the full traceback is below.

Be Well
Anthony

Traceback (most recent call last):
  File "/home/scopatz/.local/bin/xdress", line 5, in <module>
    pkg_resources.run_script('xdress==0.5-dev', 'xdress')
  File "/home/scopatz/.local/lib/python2.7/site-packages/setuptools-0.7.4-py2.7.egg/pkg_resources.py", line 509, in run_script
    def __iter__(self):
  File "/home/scopatz/.local/lib/python2.7/site-packages/setuptools-0.7.4-py2.7.egg/pkg_resources.py", line 1397, in run_script
NotImplementedError: unhandled expression "DEFAULT_TOLERANCE" of kind VAR_DECL at /home/scopatz/python-bullet/src/LinearMath/btPolarDecomposition.h:17:27

Thane Brimhall

unread,
Apr 10, 2014, 10:45:03 AM4/10/14
to Anthony Scopatz, xdress
Anthony,

I'm happy to attempt writing a fix. I'm still not totally familiar with the xdress codebase, but I suppose this is a good way to learn!

I think, at least initially, it's best for me to write a loud "unwrappable" fallback. That way, the user can simply look at the output and see what they must do by hand.

/Thane

Anthony Scopatz

unread,
Apr 16, 2014, 8:57:56 PM4/16/14
to Thane Brimhall, xdress
Hi Thane, 

Are you available at all during the day tomorrow or Friday to have a call about this?  Such a call would be open to others as well?

Be Well
Anthony

Thane Brimhall

unread,
Apr 17, 2014, 10:13:47 AM4/17/14
to Anthony Scopatz, xdress
Hi Anthony,

Yes, lets plan on doing that. My work schedule is very flexible so I'll be able to talk at any time that works for you. If you specify a time, I'll make it happen. (Note that I'm in Mountain Time Zone.) I'm fine with others coming into the call as well.

Looking forward to speaking with you,

/Thane

Anthony Scopatz

unread,
Apr 17, 2014, 11:11:37 AM4/17/14
to Thane Brimhall, xdress
Hello Thane, 

I have sent folks an invite [1] for 2 pm Central / 1 pm Mountain.  Let me know if this doesn't work for you.  Looking forward to talking with you!

Be Well
Anthony

Reply all
Reply to author
Forward
0 new messages