[Bug] PyCEGUIOpenGLRenderer doesn't import on OSX

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

User avatar
morgul
Just popping in
Just popping in
Posts: 4
Joined: Fri Sep 09, 2005 16:56
Location: Lubbock, TX
Contact:

[Bug] PyCEGUIOpenGLRenderer doesn't import on OSX

Postby morgul » Tue May 24, 2011 21:19

Ok, let's start with the symptom:

Code: Select all

[morgul:blackbox] ~/Development > python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyCEGUI
>>> import PyCEGUIOpenGLRenderer
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: unidentifiable C++ exception


Like the title says, PyCEGUIOpenGLRenderer doesn't import on OS X. (I'm using OS X 10.6.7, XCode 4.)

I've tried this on XCode 3 (several versions), and also on OS X 10.5. 10.5 had numerous problems, but I ended up with a PyCEGUIOpenGLRenderer module that had no methods in it, only the module wide variables. (I reported this to Kulik, and he was stumped). I've also tried varying the boost version; I've used boost 1.44.0 and the latest 1.46.1. Same issue regardless.

I've tried debugging this issue through XCode, and it was a giant pain, but I got to the point where I found out an exception is being thrown, and caught by boost::python. The problem is, I can't get the original exception, no matter what tricks I've tried. boost::python throws all of that away if the exception doesn't have a registered handler, and just throws a generic exception.

I've been fighting with this problem for weeks now, and have just hit one brick wall after another. I finally reinstalled my mac last night (new HD, opted not to copy everything over just in case this was related to some of the hacks I'd tried to get it working), and the same issue. Really not sure what to do about it.

Any help would be appreciated; this is the last bug blocking OS X support for my project.

--Morgul

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: [Bug] PyCEGUIOpenGLRenderer doesn't import on OSX

Postby CrazyEddie » Wed May 25, 2011 06:17

I'm going to to you a couple of favours in this post ;)

First favour: I'm not going to bore you with a long story about PyCEGUI* horrors on the Mac with 0.7.5. The short version is that I spent what we shall call a 'while' wrestling with this, and due to the need to get a release out, decided that for 0.7.x the python modules would be unsupported on OS X.

Second Favour: With the above said, I'm going to take another look at it and get it to work on some level :D I mainly do this in return for the exposure you've given CEGUI with the panda 3d work and such... So, I'll get back to you soon (could be a few days).

CE.

User avatar
morgul
Just popping in
Just popping in
Posts: 4
Joined: Fri Sep 09, 2005 16:56
Location: Lubbock, TX
Contact:

Re: [Bug] PyCEGUIOpenGLRenderer doesn't import on OSX

Postby morgul » Wed May 25, 2011 14:45

CrazyEddie wrote:I'm going to to you a couple of favours in this post ;)


Thanks! A lot, actually. I appreciate it.

On a side note; I'd love to give you guys a hand getting a .pkg installer setup for CEGUI. I've played with them a bit, and could lend a hand, if you're interested. A bit nicer than a tarball. :)

I'll keep my fingers crossed.

--Morgul

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: [Bug] PyCEGUIOpenGLRenderer doesn't import on OSX

Postby CrazyEddie » Thu May 26, 2011 11:46

The good news is that I've had the PyCEGUI* modules running under Mac OS X. The even better news is that nothing needed 'fixing' as far as code goes (I was using v0-7 stable branch code, btw). The less-than-good news is that there is some re-arrangement of some files needed since things are not running within an app bundle - which is the way non-python based CEGUI is intended to be used (and why we do not 'install' on OS X), but that's nothing major, as we shall see.

Ok, I was able to reproduce the issue of the "RuntimeError: unidentifiable C++ exception" quite easily. It was hard to debug, but eventually I tracked it down to an issue of linking with a static boost python library - when linking with a shared library this issue goes away.

Once you have that sorted, and the PyCEGUI* modules are linked against the shared boost python, it's a matter of putting things where the system - and later CEGUI - will find them. Basically this involves putting the CEGUI frameworks and the appropriate frameworks from the dependencies into, for example ~/Library/Frameworks, I assume you already have this done, since you're importing the modules without errors relating to not finding the built CEGUI code. The next thing to ensure is that CEGUI will find the bundles for the optional components, such as xml parser and image codec. Normally these go into the app bundle 'PlugIns' directory, but since we do not have an app bundle, we can put them into the 'CEGUIBase.framework/PlugIns' directory instead. WIth this done you should be cooking with gas.

Ok, now follows the recipe of what I did, most of this you've already done, but it serves as a reference for others :)
  • Cloned mercurial repo and updated to v0-7 branch
  • Unpacked dependencies into the cloned directory
  • Loaded the Xcode project for v0-7
  • For 'CEGUI' ensure that the CEGUI_BOOST_ related user defined settings are correct for the boost version you'll use.
  • Build the 'Crazy Eddie's GUI System' target
  • Build PyCEGUI target
  • Build PyCEGUIOpenGLRenderer target
  • Copied CEGUIExpatParser.bundle, CEGUISILLYImageCodec.bundle and CEGUIFalagardWRBase.bundle into CEGUIBase.framework/PlugIns.
  • Copied CEGUIBase.framework and CEGUIOpenGLRenderer.framework into ~/Library/Frameworks
  • Copied expat.framework, freetype2.framework, PCRE.framework and SILLY.framework from dependencies dir into ~/Library/Frameworks
For me, this was enough to get the python stuff to work :)

The offer of the help with a .pkg installer is welcome - as far as what is needed for python based things to work :D For normal C++ based use, it is preferable that developers embed cegui into the app bundle, since it avoids a lot of issues when dealing with compiled code (and a possible multitude of configurations and modifications to the CEGUI libs used for each specific app).

Also of note is that for the next release it will be all change again, since I have done away with the frameworks entirely, and now only build .dylib libraries.

HTH

CE.

User avatar
morgul
Just popping in
Just popping in
Posts: 4
Joined: Fri Sep 09, 2005 16:56
Location: Lubbock, TX
Contact:

Re: [Bug] PyCEGUIOpenGLRenderer doesn't import on OSX

Postby morgul » Fri May 27, 2011 03:34

Thanks so much, I got it working. I'll report back once I've gotten further on the .mpkg.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: [Bug] PyCEGUIOpenGLRenderer doesn't import on OSX

Postby CrazyEddie » Tue May 31, 2011 18:02

Cool, thank you. I look forwards to seeing how these mpkg things are constructed, I have not tried this before :D

CE


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 10 guests