Compiling ogreforests on Linux

SirGolan

19-07-2011 02:45:01

Hi guys,

I've been trying to get Python-Ogre running on Linux again in hopes I can have it as a supported platform for MV3D, however, I've got everything going except the ogreforests module which MV3D uses for grass. Here's the error I get when trying to generate code:


07-18 21:31 PythonOgre.BuildModule INFO Building Source code for ogreforests
07-18 21:31 PythonOgre.BuildModule DEBUG Spawning 'python generate_code.py' in '/home/mike/development/python-ogre/code_generators/ogreforests'
07-18 21:31 PythonOgre.BuildModule WARNING Task Failed
07-18 21:31 PythonOgre.BuildModule DEBUG
07-18 21:31 PythonOgre.BuildModule DEBUG INFO Creating xml file "/home/mike/development/python-ogre/code_generators/cache/ogreforests_r2719_cache.xml" from source file "/home/mike/development/python-ogre/code_generators/ogreforests/python_forests.h" ...
INFO gccxml cmd: /usr/bin/gccxml -I"/home/mike/development/python-ogre" -I"/home/mike/development/root/usr/include/boost" -I"/home/mike/development/root/usr/include/OGRE" -I"/home/mike/development/python-ogre/ThirdParty/forests" -D"OGRE_NONCLIENT_BUILD" -D"WIN32" -D"GCCXML_BUG" -D"__PYTHONOGRE_BUILD_CODE" -D"VERSION_r2719" "/home/mike/development/python-ogre/code_generators/ogreforests/python_forests.h" -fxml="/home/mike/development/python-ogre/code_generators/cache/ogreforests_r2719_cache.xml"
Traceback (most recent call last):
File "generate_code.py", line 374, in <module>
generate_code()
File "generate_code.py", line 283, in generate_code
, cflags=environment.ogreforests.cflags
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/module_builder/boost_python_builder.py", line 95, in __init__
, indexing_suite_version)
File "/usr/local/lib/python2.7/dist-packages/pyplusplus/module_builder/boost_python_builder.py", line 138, in __parse_declarations
decls = reader.read_files( files, compilation_mode )
File "/usr/local/lib/python2.7/dist-packages/pygccxml/parser/project_reader.py", line 217, in read_files
return self.__parse_file_by_file(files)
File "/usr/local/lib/python2.7/dist-packages/pygccxml/parser/project_reader.py", line 254, in __parse_file_by_file
reader.create_xml_file( header, prj_file.cached_source_file )
File "/usr/local/lib/python2.7/dist-packages/pygccxml/parser/source_reader.py", line 179, in create_xml_file
raise error
pygccxml.parser.source_reader.gccxml_runtime_error_t: Error occured while running GCC-XML: In file included from /usr/include/boost/smart_ptr/detail/spinlock_sync.hpp:18,
from /usr/include/boost/smart_ptr/detail/spinlock.hpp:38,
from /usr/include/boost/smart_ptr/detail/spinlock_pool.hpp:25,
from /usr/include/boost/smart_ptr/shared_ptr.hpp:37,
from /usr/include/boost/shared_ptr.hpp:17,
from /usr/include/boost/thread/tss.hpp:9,
from /home/mike/development/root/usr/include/OGRE/Threading/OgreThreadHeadersBoost.h:29,
from /home/mike/development/root/usr/include/OGRE/Threading/OgreThreadHeaders.h:30,
from /home/mike/development/root/usr/include/OGRE/OgreStdHeaders.h:110,
from /home/mike/development/root/usr/include/OGRE/OgrePrerequisites.h:315,
from /home/mike/development/root/usr/include/OGRE/Ogre.h:31,
from /home/mike/development/python-ogre/code_generators/ogreforests/../ogre/python_ogre_include_OGRE.h:24,
from /home/mike/development/python-ogre/code_generators/ogreforests/python_forests.h:3:
/usr/include/boost/smart_ptr/detail/yield_k.hpp:58: error: expected initializer before 'Sleep'
/usr/include/boost/smart_ptr/detail/yield_k.hpp: In function 'void boost::detail::yield(unsigned int)':
/usr/include/boost/smart_ptr/detail/yield_k.hpp:74: error: 'Sleep' was not declared in this scope
/usr/include/boost/smart_ptr/detail/yield_k.hpp:78: error: 'Sleep' was not declared in this scope


Has anyone seen that before or know how to resolve it? I'm running Python-Ogre trunk and followed all the other build steps with no problem. I've got this on Ubuntu 11.04 / 64bit with gcc 4.5.2.

Thanks,

Mike

dermont

19-07-2011 05:32:35

In python-ogre/code_generators/ogreforests/generate_code.py try removing the define for 'WIN32'.


#'WIN32',

defined_symbols = ['OGRE_NONCLIENT_BUILD', "GCCXML_BUG", '__PYTHONOGRE_BUILD_CODE' ]

SirGolan

20-07-2011 02:00:24

Awesome!! That worked. Thank you for the help!

Mike

SirGolan

20-07-2011 02:35:02

Oops, spoke too soon. It built but doesn't import.


mike@ubuntubase:~/development$ python
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ogre.renderer import OGRE
>>> from ogre.addons import ogreforests
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/ogre/addons/ogreforests/__init__.py", line 1, in <module>
from _ogreforests_ import *
RuntimeError: extension class wrapper for base class Ogre::MovableObject has not been created yet


I could probably get away with disabling grass on Linux, but it would definitely be nice to get it working.

Thanks,

Mike

dermont

21-07-2011 09:00:23

Sorry I'm not sure why you are encountering the RuntimeError for Ogre::MovableObject. The only way I've been able to simulate this is by not importing the ogre module first - but you are already doing that. I take it the demos have the same problem.

I don't think removing the windows define has anything to do with this. What version of python-ogre / pygccxml / gccxml / ogre are you using?

I'll take another look, you could try raising a bug report on the sourceforge tracker or waiting for one of the developers to comment.

SirGolan

22-07-2011 17:29:07

I don't think removing the windows define has anything to do with this. What version of python-ogre / pygccxml / gccxml / ogre are you using?

Yeah, I am pretty sure it's unrelated to the other problem as well.

python-ogre from svn rev 1150, pygccxml from svn rev 1856, gccxml from CVS maybe tag D2011.05.01.04.00.00, ogre 1.7.2. I used the LinuxBuildV4 wiki page except with trunk of python-ogre.

I'll file a bug report. I tried re-generating code for ogreforests and that didn't help the problem. The demos for it give the same error.

Thanks,

Mike

dermont

23-07-2011 10:26:09

I don't think removing the windows define has anything to do with this. What version of python-ogre / pygccxml / gccxml / ogre are you using?

Yeah, I am pretty sure it's unrelated to the other problem as well.

python-ogre from svn rev 1150, pygccxml from svn rev 1856, gccxml from CVS maybe tag D2011.05.01.04.00.00, ogre 1.7.2. I used the LinuxBuildV4 wiki page except with trunk of python-ogre.

I'll file a bug report. I tried re-generating code for ogreforests and that didn't help the problem. The demos for it give the same error.

Thanks,

Mike


If you haven't already try cleaning out the ogreforests cache/wrapper code/object files and re-generate/rebuild.

1. delete code_generators/cache/ogreforests_r2719_cache.xml
2. clean out the wrapper code/object files
generated/ogreforests_r2719
build_dir_2.7/ogreforests_r2719

This ogreforests moudle already has a dependency to the ogre module and runs OK here (32 bit machine).

mb.register_module_dependency ( environment.ogre.generated_dir )


Has anyone else built the ogreforests moudle on Linux and/or run into similar problems?

I'll try a build early next week with the version of gccxml you are using though I think that's pretty much what I'm using.

dermont

27-07-2011 06:54:17

Sorry I tried a fresh rebuild but couldn't reproduce the problem. I've seen this before with the OgreOde module and thought it was down to the version of gccxml; which apparently it wasn't.

Since a couple of developers have been on the forum since you posted the original message I'm assuming that someone has contacted you directly regarding this.

SirGolan

27-07-2011 15:23:25

Since a couple of developers have been on the forum since you posted the original message I'm assuming that someone has contacted you directly regarding this.

Not yet. I'm still having the problem.

I'm going to try completely rebuilding the generated code again tonight. I tried that before but didn't wipe out the file from code_generators/cache. I've also still got to file a bug report.

Thanks so much for your help.

Mike

SirGolan

27-07-2011 16:03:07

No change after rebuilding the generated code unfortunately.