Building on Mac OS X Leopard 10.5.2

Cactus

29-03-2008 02:16:13

The OSXBuildV2 was badly in need of an update, so I've done one:

http://wiki.python-ogre.org/index.php/OSXBuildV2#It_Didn.27t_Work_--_What_Now.3F

This is how I got it to build. Nearly drove me nuts. Most of the information to get it working is out there; here is a way to do it without too much messing about.

It'd be good to know if this works for anyone else.

This is probably Intel only. But who knows..?

cheers

plaureano

31-03-2008 14:08:31

I have followed everything carefully but did not made it to a working version. Some notes:

- On the ogre compiling I had to remove the PPC target from the "Release" options (xcode project).

- Edited every single plugins.cfg file on the python-ogre directory just in case...

- On the .profile I believe bash requires a different syntax:

export LD_LIBRARY_PATH=$PATH:/Users/plaureano/development/python-ogre/root/usr/lib

export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH

(i.e. when you define a variable you do not use the "$" before its name, and the space before and after the equal sign is not allowed also)

Anyway, I can run the ogre samples, bot not the python ones. I get:

Paulo-Laureano-MacBook:Release plaureano$ cd ~/development/python-ogre/demos/ogre
Paulo-Laureano-MacBook:ogre plaureano$ python Demo_Smoke.py
Traceback (most recent call last):
File "Demo_Smoke.py", line 15, in <module>
import ogre.renderer.OGRE as ogre
File "/Users/plaureano/development/root/usr/lib/python2.5/site-packages/ogre/renderer/OGRE/__init__.py", line 10, in <module>
from _ogre_ import *
ImportError: dynamic module does not define init function (init_ogre_)


Anyway, thanks for sharing, hopefully someday I'll get this working on Mac OS X...

PLS

Cactus

01-04-2008 20:52:15

Yes, you are right about the syntax in the .profile file; I've updated the wiki to reflect that.

I've read about other people having to disable the PPC build, so that makes sense... except that I didn't have to.

I've seen things similar to that error, but I'm not sure what it means -- I'm no expert on these things. A couple of not-very-good ideas -- are you sure you removed the .so extension from the plugin filenames? And are you sure you installed Cg manually?

If yes to both...

Strange. But not that strange; I only got this working by trial and error. It took a long time to replicate and document it. I might easily have missed something.

Try forcing python-ogre svn revision 580. Perhaps things have changed? I doubt that's the problem though.

I sorted out quite a few errors by searching for various filenames using Spotlight. Try searching the entire computer for init_ogre, or just ogre. See where things are. Try adding them to your path... IIRC (i am on a different machine at the moment), my .profile sets the path like this:

PATH=$PATH:/opt/bin:/opt/sbin:/usr/bin:/usr/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin

I didn't wiki this because I didn't think it was relevant. Perhaps I was wrong... I had it set up like this to begin with; it wasn't an Ogre-related change.

The python setup scripts i looked at were:

environment.py
PythonOgreConfig_Posix.py
setup.py

I also looked very hard at BuildModule.py but couldn't see anything obvious that needed to change. It would be worth searching carefully through those files for anything that looks like it might have something to do with the renderer...

Or use Spotlight to search for any files in the python-ogre folder containing the string 'mac'. Look hard at those sections of code.

In (at least) one of them, near the top, there is a variable you can set which looks something like:

logging = False;

change it to True, try again, then have a good look at the logs to see exactly where the failure occurred...

If you have a Eureka moment (like I did), please update the wiki; everyone seems to having a hard time with this. Sooner or later I guess they'll move to Eihort 1.4.7 which apparently solves a few Leopard issues. Maybe then it'll all magically work.

Obviously with my way of doing it there are likely to be issues caused by the fact that the xml file generated by pygccxml is using the 10.4 sdk, but the code is then built to link to the 10.5 sdk.

I did notice that not all of the python demos worked.

Smoke.py and ParticleFX.py were fine, though.

Apologies for the vagueness.

robtherich

02-04-2008 23:04:03

hello all.
many thanks to everyone who contributes to this project.

i am intermediate c++ ogre user who is trying to take advantage of this great project. my python skills are fairly non-existent, however i will be collaborating with people who have python skills, but no c++.

i am on mac 10.5.2, so i appreciate the advice given by the OP. i was able to build, compile, wrap and install the ogre/ois modules by following the advice (specifically the back and forth 10.4 sdk to 10.5 sdk switch).

however my intention is to use python-ogre with one of the physics wrappers. i am starting with ode and bullet for now. i was able to build both libraries successfully using the python scripts. i was also able to generate the python wrapper, however when it came to compiling the python module, i was unsuccessful for both libraries.

ode made it all the way to dHashSpace.pypp.cpp, where i received:
boost-1_34_1/boost/python/type_id.hpp:88: error: invalid use of undefined type ‘struct dxSpace’
ode/ode/common.h:234: error: forward declaration of ‘struct dxSpace’


bullet seems to build all the .os files, but not the module itself. i get a whole slew of errors starting with:
PythonOgre.BuildModule DEBUG Undefined symbols:
"vtable for btContinuousDynamicsWorld", referenced from:
__ZTV25btContinuousDynamicsWorld$non_lazy_ptr in btContinuousDynamicsWorld.pypp.os
"btContinuousDynamicsWorld::btContinuousDynamicsWorld(btDispatcher*, btBroadphaseInterface*, btConstraintSolver*, btCollisionConfiguration*)", referenced from: boost::python::objects::make_holder<4>::apply<boost::python::objects::value_holder<btContinuousDynamicsWorld_wrapper>, boost::mpl::vector4<btDispatcher*, btBroadphaseInterface*, btConstraintSolver*, btCollisionConfiguration*> >::execute(_object*, btDispatcher*, btBroadphaseInterface*, btConstraintSolver*, btCollisionConfiguration*)in btContinuousDynamicsWorld.pypp.os
...
...
ld: symbol(s) not found


as i mentioned, i'm quite new to python and binding c++ to python, so i'm a little unsure where to go from here. if anyone has any advice at all, or can confirm that they were able to build the python module for either bullet or ode on os x, i would be very grateful.

many thanks.
-rob

team23

18-05-2008 05:17:40

This walkthrough was awesome. Thanks to all who contributed to it.

Just picked up my Mac a couple days ago, and I've got it built and running the demos (Well, some of them).

deifante

29-05-2008 05:44:09

hey, I've been interested in using ogre in a project I'm working on and I seem to be having problems building on 10.5.2 on the most recent svn. Is there someone I can contact about this?

PhycoFalcon

29-05-2008 06:09:41

Giulio and I also had trouble getting Python-Ogre running on OS X. We came close, but we never were able to get it. We're now developing on Windows. Go figure. :roll:

team23

30-05-2008 15:38:09

If you have specific questions I may be able to help, I have it running on 10.5.2, but I'm not too experienced with building, so most of my help would be, "Ohh yea, I hit that, did this and it went away"

But yea, I soooooo love the installable version of Python-Ogre for Windows.
I can get my game running in all of 10 min on new windows boxes. Working on week #2 on my Mac.

PhycoFalcon

30-05-2008 16:28:41

This is why we need binaries and maintainers for OS X. There has hardly been any talk of this on the list; it's all been about maintaining a linux binary. (probably just Ubuntu)

nmgeek

06-06-2008 03:50:05

Thanks, Cactus, for posting all the info for building on OS X.

I've been wrestling with this, now, for a couple days. gccxml chokes on the OS X header files no matter what I do. It's not producing an xml output file with either the OS X 4 or OS X 5 header files. Because it won't produce an xml output file with the OS X 4 header files I think this is a gccxml problem and not an issue with the recent release of OS X 10.5.3.

The latest version of gccxml complains about template definitions in an extern context. I checked the source and they are, in fact, not in an extern context so this is a gccxml bug on OS X.

Earlier versions of gccxml complain about a syntax error in basic_string.h

Maybe if I happened to get the version of the gccxml cvs tree on exactly the right date I could reproduce Cactus's experience??

Has anyone experienced these problems? Gotten the wrapping phase to work somehow?

I can post more details about the gccxml errors if this is helpful.

mattrepl

09-06-2008 15:10:31

I also encounter problems with gccxml, it complains about error: template with C linkage for system header files (mainly STL stuff) found in the MacOSX10.4u.sdk package.

The version of gccxml that the Python-Ogre is pulling is 0.9.0 and I also tried using the latest version from MacPorts, 0.6.0. That gave me some error about strings, IIRC.

Can anyone that's had success post which exact version of OS X and gccxml they used?

nmgeek

19-06-2008 23:53:09

The 'template with C linkage' is a recently introduced bug in gccxml. I submitted a bug report to the gccxml crew. You can get around
this error by using the -D option with cvs to get an earlier version
of gccxml. I used April 1, 2008 as the date for -D.

There are a few other issues to get around in order to get a complete
build. I haven't worked through all of them yet. Most of them
have to do with accomodating newer versions of dependent packages like boost.

I will report back if I get a complete build.

adjohn

31-07-2008 08:37:42

Any luck yet? I have been having issues building this as well. If someone has a prebuilt binary, could they share it with me?

Thanks!

zratchet2

04-08-2008 02:48:42

I am also having issues:

% python python-ogre/BuildModule.py -r -b cmake gccxml boost pygccxml cg scons pyplusplus
PythonOgre.BuildModule: INFO Retrieving http://www.cmake.org/files/v2.4/cmake-2 ... sal.tar.gz
PythonOgre.BuildModule: INFO Build Command tar xzf /Users/luv/Desktop/snowballz_hg/snowballz-gdd/python-ogre/downloads/cmake-2.4.7-Darwin-universal.tar.gz --overwrite
PythonOgre.BuildModule: INFO Build Command cp -f -R * /Users/luv/Desktop/snowballz_hg/snowballz-gdd/python-ogre/root/usr
PythonOgre.BuildModule: INFO Retrieving -d :pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co -D 27June2008 gccxml
PythonOgre.BuildModule: INFO Build Command mkdir -p gccxml-build
PythonOgre.BuildModule: INFO Build Command cmake ../gccxml -DCMAKE_INSTALL_PREFIX:PATH=/Users/luv/Desktop/snowballz_hg/snowballz-gdd/python-ogre/root/usr
PythonOgre.BuildModule: INFO Build Command make
PythonOgre.BuildModule: INFO Build Command make install
PythonOgre.BuildModule: INFO Retrieving http://downloads.sourceforge.net/boost/ ... 3.1.16.tgz
PythonOgre.BuildModule: INFO Retrieving http://downloads.sourceforge.net/boost/ ... 5_0.tar.gz
PythonOgre.BuildModule: INFO Build Command tar zxf /Users/luv/Desktop/snowballz_hg/snowballz-gdd/python-ogre/downloads/boost-jam-3.1.16.tgz --overwrite
PythonOgre.BuildModule: INFO Build Command ./build.sh darwin
PythonOgre.BuildModule: INFO Build Command cp -f bjam /Users/luv/Desktop/snowballz_hg/snowballz-gdd/python-ogre/root/usr/bin
PythonOgre.BuildModule: INFO Build Command tar zxf /Users/luv/Desktop/snowballz_hg/snowballz-gdd/python-ogre/downloads/boost_1_35_0.tar.gz
PythonOgre.BuildModule: INFO Build Command chmod -R +rw *
PythonOgre.BuildModule: INFO Build Command cp -f -R python-ogre/boost/* boost_1_35_0
PythonOgre.BuildModule: INFO Build Command sed -i '' 's/BJAM_CONFIG=""/BJAM_CONFIG=release/' boost_1_35_0/configure
PythonOgre.BuildModule: INFO Build Command sed -i '' s/'BOOST_PYTHON_MAX_ARITY 15'/'BOOST_PYTHON_MAX_ARITY 19'/ boost_1_35_0/boost/python/detail/preprocessor.hpp
PythonOgre.BuildModule: INFO Build Command sed -i '' s/"# include <boost\/preprocessor\/cat.hpp>"/"\n#define BOOST_PYTHON_NO_PY_SIGNATURES\n# include <boost\/preprocessor\/cat.hpp>"/ boost_1_35_0/boost/python/detail/preprocessor.hpp
PythonOgre.BuildModule: INFO Build Command ./configure --with-libraries=python --prefix=/Users/luv/Desktop/snowballz_hg/snowballz-gdd/python-ogre/root/usr --without-icu --with-bjam=../root/usr/bin/bjam
PythonOgre.BuildModule: INFO Build Command make
PythonOgre.BuildModule: INFO Build Command make install
PythonOgre.BuildModule: INFO Retrieving co -r 1362 http://pygccxml.svn.sourceforge.net/svnroot/pygccxml pygccxml
PythonOgre.BuildModule: INFO Build Command python setup.py install --prefix=/Users/luv/Desktop/snowballz_hg/snowballz-gdd/python-ogre/root/usr
PythonOgre.BuildModule: INFO Build Command python setup.py install --prefix=/Users/luv/Desktop/snowballz_hg/snowballz-gdd/python-ogre/root/usr
PythonOgre.BuildModule: INFO Retrieving http://developer.download.nvidia.com/cg ... ay2008.dmg
PythonOgre.BuildModule: INFO Retrieving http://downloads.sourceforge.net/scons/ ... 8.5.tar.gz
PythonOgre.BuildModule: INFO Build Command tar zxf /Users/luv/Desktop/snowballz_hg/snowballz-gdd/python-ogre/downloads/scons-0.98.5.tar.gz --overwrite
PythonOgre.BuildModule: INFO Build Command python setup.py install --prefix=/Users/luv/Desktop/snowballz_hg/snowballz-gdd/python-ogre/root/usr
PythonOgre.BuildModule: ERROR Module specificed was not found (pyplusplus is not in environment.py)

Any help?