PyOgre on Mac OS X installation notes

jacknutting

04-10-2005 08:36:36

I've been working on getting this going (with svn revision 194, checked out yesterda). Here are some notes for whoever's maintaining docs/build_macosx.txt...

First of all, it should be mentioned somewhere that the swig step is really slow, at least with version 1.3.25. It took about 70 minutes on my 1.33MHz iBook with 768 megs of RAM.

Then, the compiler invocation references a framework (libpng) that is not inlcuded in the clump of Mac frameworks (Cg, IL, SDL, zzip) supplied on the ogre3d download page. I made this compile by just removing "-framework libpng" from the command, but I'm not sure what repercussions this may have; The main Ogre3d example programs run successfully, and seem to be accessing png files in Samples/Matericals/textures without any trouble, so we may be getting png access "for free" through another framework.

Next, the compiler invocation doesn't generate ogre.pyc, though its existence is suggested by the "cp" command. I just copied _ogre.so and ogre.py into the site-packages directory, hopefully that will work.

Finally, we may want to mention possible alternate locations for the site-packages directory. Many python developers on Mac will have installed separate "framework" versions of python, and then the site-packages directory will be in one of these places:

/Library/Frameworks/Python.framework/Versions/2.4/lib/site-packages/
/Library/Frameworks/Python.framework/Versions/2.3/lib/site-packages/

Typically a mac python developer will be aware of this, but it bears repeating (at least while there's no setup script that takes care of this automatically).

jacknutting

04-10-2005 08:43:58

I goofed on my suggested alternate site-packages directories, it should actually be these:

/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/
/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages

jacknutting

04-10-2005 08:58:56

The examples want to include pyogre.ogre, and that doesn't seem to work for me. Instead of suggesting that people put _ogre.so and ogre.py directly in site-packages, it may be a good idea to tell people to create a directory called pyogre in site-packages, and put _ogre.so and ogre.py in there, along with an __init__.py file containing the single line:

import ogre

With things set up that way, I can now at least me do "import pyogre.ogre" just like the examples do.

fog

04-10-2005 10:33:09

The right directory structure for the pyogre package is:
pyogre/
__init__.py
_ogre.so
ogre.py
_cegui.so
cegui.py


Note that you'll have cegui only if you build it and that __init__.py is an empty file (don't need the import, ogre will be found as sub-package.)

Thank you very much for your notes, I'll add them to the macosx readme.

jacknutting

04-10-2005 13:16:41

Which cegui version should I use, the old one (that seems to be the one that was used with the older versions of pyogre), or the recently-released one? And do I do roughly the same thing, wrapping it with swig? I've never used swig before this... Well, maybe I'll try to hack it in there and see what I come up with.

jacknutting

04-10-2005 13:51:52

I just realized, I should probably be using the cegui that's in the "Cg.framework" that I downloaded with ogre3d.

One more note for the mac readme: Along with changing the installation directory for _ogre.so, ogre.py, etc, an include dir in the compilation step should be changed (for those users who are using a version of python they installed themselves).

This chunk:

-I/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3/

would in this case be one of these instead:
-I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/
-I/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3/

fog

04-10-2005 18:30:07

I can't change anything in the MacOS build because I don't have a mac o test it. I'll just add your notes to the readme. :)

As for CEGUI, only 0.3 (half) works right now and I don't think Cg.framework is the same thing. Cg.framework to me it seems the NVIDIA Cg toolkit ported to MacOS.

griminventions

25-10-2005 17:14:41

First, thanks for all the info on the Mac version. It's sorely needed.

-I/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3/

would in this case be one of these instead:
-I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/
-I/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3/

How the heck do I change these settings in Xcode (1.5)? Or do you mean something in the swig files?

Edit: DOH! Nevermind. :oops: I hadn't gotten that far yet, but now I see that you meant in the command line when you invoke g++.

Clay

26-10-2005 05:07:21

I'm not sure.... I really wish we could be more help, but neither fog nor I own a mac (though I'd love one of those PowerBooks, I just don't have the money for it). Until we find someone with a Mac who's willing and able to maintain Mac support, there's not much we can do. Sorry. =*(

You might try contacting jacknutting directly. He left a large amount of contact information (AIM, ICQ, email...). If he has something that will allow it to compile I'd love to update the mac building notes.

griminventions

26-10-2005 13:09:43

I got it built, but it doesn't run. :( It bombs out somewhere during initialization. I'd love to try to get it working, but I'm pretty new to Mac development and haven't done anything with Cocao (the app framework).

Thanks for your reply.