Building on Mac Lion, python 2.7, Xcode 4 and llvmgcc

otognan

21-01-2012 20:54:26

Hi,

I have a lot of troubles with compiling python-ogre on my machine (Lion, python 2.7, llvmgcc42, xcode 4).
I follow these instruction: http://wiki.python-ogre.org/index.php/OSXBuildV2, but it fails on every step.

I managed compile ogre itself manually with xcode 4 (at least it looks like I obtained ogre.framework with headers and binaries inside).

However, I cannot succeed with "Generate the wrapper code" step:
python python-ogre/BuildModule.py -v -g ogre

Here is the error I have:
File "/Users/olegsinyavskiy/development/root/usr/lib/python2.7/site-packages/pyplusplus/module_builder/boost_python_builder.py", line 138, in __parse_declarations
decls = reader.read_files( files, compilation_mode )
File "build/bdist.macosx-10.7-intel/egg/pygccxml/parser/project_reader.py", line 217, in read_files
File "build/bdist.macosx-10.7-intel/egg/pygccxml/parser/project_reader.py", line 254, in __parse_file_by_file
File "build/bdist.macosx-10.7-intel/egg/pygccxml/parser/source_reader.py", line 179, in create_xml_file
pygccxml.parser.source_reader.gccxml_runtime_error_t: Error occured while running GCC-XML: gccxml_cc1plus: error: unrecognized option `
-F/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks

-F is the darwin-specific option in order to include frameworks to the build. However gccxml can not understand it for some reason.

Strangely enough, the next steps execute without errors.
python python-ogre/BuildModule.py -v -c ogre
python python-ogre/BuildModule.py -b install

However if I try import ogre.renderer.OGRE as ogre
I get:
ImportError: dlopen(/Library/Python/2.7/site-packages/ogre/renderer/OGRE/_ogre_.so, 2): Library not loaded: libboost_python.dylib
Referenced from: /Library/Python/2.7/site-packages/ogre/renderer/OGRE/_ogre_.so
Reason: image not found

Is this error related to "generate wrapper code error"? Does anyone has any ideas? I'll be grateful for any feedback! Thanks!

otognan

30-01-2012 01:22:04

I'm trying to build it already two weeks. Here is an update on my adventures:)

1)The previously described errors can be solved with downloading and building of the latest version of gccxml (for some reason I decided to download the latest and stable ver from their website, but it appears that the truly latest and stable one can be obtained with cvs).

2) It is tricky to build 1.6 ogre in mac lion. This version is suggested in python-ogre binding for mac for some reason, but it requires Carbon instead of Cocoa, which is outdated and is not supported on 64 arch. So I decided to download the latest 1.7.4 ogre SDK for mac, with which I can successfully build and run Ogre examples.

3) After some time I succeeded with generation of wrapper code for ogre (BuildModule.py -g ogre) for 1.7.4. Also compilation of code (BuildModule.py -c ogre) was almost successful. However it fails on linkage. Here are the undefined symbols:

"Ogre::PropertyDef::getTypeName(Ogre::PropertyType)"
"Ogre::PropertySet::~PropertySet()"
... more on PropertySet...

"Ogre::Singleton<Ogre::ArchiveManager>::ms_Singleton"
and others ms_Singletons like "Ogre::Singleton<Ogre::ExternalTextureSourceManager>::ms_Singleton"

Does any one have any ideas how to solve these linkage problems?

dermont

03-02-2012 09:27:24

For your PropertySet error it looks like you need to link against OgreProperty(libOgreProperty.so). I think these are set in the SConstruct file get_linkflags for the Mac build.

Your ms_Singleton error could be either your not linking against OgreMain/the wrong version of OgreMain or there is a problem with your compiler version and the visibility compile flags (there was a similar problem on Linux gcc4.03).

http://groups.google.com/group/python-o ... Singleton#

Maybe could you zip up your log.out and upload. Since I've never build on Mac maybe someone familar with the Mac build can help.