OgreNewt trouble with compiling Python-Ogre

jsternberg

02-10-2011 16:44:12

I'm having some issues with building OgreNewt (I'm also having the same trouble building OgreBullet) on Linux Mint 11 (Katya, which is based on Natty).

I am able to build Ogre, OIS, Newton, and Bullet. When it gets to generating the wrappers for OgreNewt, I get the following error message.


jsternberg@jsternberg-laptop ~/pyogre $ cat log.out
10-02 11:23 PythonOgre.BuildModule INFO Building Source code for ogrenewt
10-02 11:23 PythonOgre.BuildModule DEBUG Spawning 'python generate_code.py' in '/home/jsternberg/pyogre/python-ogre/code_generators/ogrenewt'
10-02 11:23 PythonOgre.BuildModule WARNING Task Failed
10-02 11:23 PythonOgre.BuildModule DEBUG
10-02 11:23 PythonOgre.BuildModule DEBUG INFO Creating xml file "/home/jsternberg/pyogre/python-ogre/code_generators/cache/ogrenewt_r2429_cache.xml" from source file "/home/jsternberg/pyogre/python-ogre/code_generators/ogrenewt/python_ogrenewt.h" ...
INFO gccxml cmd: /opt/ram/local/bin/gccxml -I"/home/jsternberg/pyogre/python-ogre" -I"/home/jsternberg/pyogre/root/usr/include/boost" -I"/home/jsternberg/pyogre/newtonSDK/sdk" -I"/home/jsternberg/pyogre/root/usr/include/OGRE" -I"/home/jsternberg/pyogre/root/usr/include/OgreNewt" -I"/home/jsternberg/pyogre/root/usr/include/OGRE" -D"OGRE_NONCLIENT_BUILD" -D"__PYTHONOGRE_BUILD_CODE" -D"ogrenewt_NONCLIENT_BUILD" -D"OIS_NONCLIENT_BUILD" -D"OGRE_NONCLIENT_BUILD" -D"OGRE_GCC_VISIBILITY" -D"__PYTHONOGRE_BUILD_CODE" -D"HAVE_OGRE_BUILDSETTINGS_H" -D"VERSION_r2429" -D"__GCCXML__" -D"BOOST_IS_ENUM" "/home/jsternberg/pyogre/python-ogre/code_generators/ogrenewt/python_ogrenewt.h" -fxml="/home/jsternberg/pyogre/python-ogre/code_generators/cache/ogrenewt_r2429_cache.xml"
Traceback (most recent call last):
File "generate_code.py", line 318, in <module>
generate_ogrenewt()
File "generate_code.py", line 237, in generate_ogrenewt
, indexing_suite_version=2 )
File "/home/jsternberg/pyogre/root/usr/lib/python2.7/site-packages/pyplusplus/module_builder/boost_python_builder.py", line 95, in __init__
, indexing_suite_version)
File "/home/jsternberg/pyogre/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 "/home/jsternberg/pyogre/root/usr/lib/python2.7/site-packages/pygccxml/parser/project_reader.py", line 217, in read_files
return self.__parse_file_by_file(files)
File "/home/jsternberg/pyogre/root/usr/lib/python2.7/site-packages/pygccxml/parser/project_reader.py", line 254, in __parse_file_by_file
reader.create_xml_file( header, prj_file.cached_source_file )
File "/home/jsternberg/pyogre/root/usr/lib/python2.7/site-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/c++/4.5/tr1/type_traits:47,
from /usr/include/c++/4.5/tr1/unordered_map:39,
from /home/jsternberg/pyogre/root/usr/include/OGRE/OgreStdHeaders.h:40,
from /home/jsternberg/pyogre/root/usr/include/OGRE/OgrePrerequisites.h:315,
from /home/jsternberg/pyogre/root/usr/include/OGRE/Ogre.h:31,
from /home/jsternberg/pyogre/root/usr/include/OgreNewt/OgreNewt_World.h:14,
from /home/jsternberg/pyogre/root/usr/include/OgreNewt/OgreNewt.h:23,
from /home/jsternberg/pyogre/python-ogre/code_generators/ogrenewt/python_ogrenewt.h:9:
/usr/include/c++/4.5/tr1_impl/type_traits:207: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.5/tr1_impl/type_traits:207: error: template argument 2 is invalid
/usr/include/c++/4.5/tr1_impl/type_traits:213: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.5/tr1_impl/type_traits:213: error: template argument 2 is invalid
/usr/include/c++/4.5/tr1_impl/type_traits:219: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.5/tr1_impl/type_traits:219: error: template argument 2 is invalid
/usr/include/c++/4.5/tr1_impl/type_traits:226: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.5/tr1_impl/type_traits:226: error: expected '>' before '...' token
/usr/include/c++/4.5/tr1_impl/type_traits:227: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.5/tr1_impl/type_traits:227: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.5/tr1_impl/type_traits:227: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.5/tr1_impl/type_traits:229: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.5/tr1_impl/type_traits:229: error: expected '>' before '...' token
/usr/include/c++/4.5/tr1_impl/type_traits:230: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.5/tr1_impl/type_traits:230: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.5/tr1_impl/type_traits:230: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.5/tr1_impl/type_traits:232: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.5/tr1_impl/type_traits:232: error: expected '>' before '...' token
/usr/include/c++/4.5/tr1_impl/type_traits:233: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.5/tr1_impl/type_traits:233: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.5/tr1_impl/type_traits:233: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.5/tr1_impl/type_traits:235: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.5/tr1_impl/type_traits:235: error: expected '>' before '...' token
/usr/include/c++/4.5/tr1_impl/type_traits:236: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.5/tr1_impl/type_traits:236: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.5/tr1_impl/type_traits:236: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.5/tr1_impl/type_traits:238: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.5/tr1_impl/type_traits:238: error: expected '>' before '...' token
/usr/include/c++/4.5/tr1_impl/type_traits:239: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.5/tr1_impl/type_traits:239: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.5/tr1_impl/type_traits:239: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.5/tr1_impl/type_traits:241: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.5/tr1_impl/type_traits:241: error: expected '>' before '...' token
/usr/include/c++/4.5/tr1_impl/type_traits:242: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.5/tr1_impl/type_traits:242: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.5/tr1_impl/type_traits:242: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.5/tr1_impl/type_traits:244: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.5/tr1_impl/type_traits:244: error: expected '>' before '...' token
/usr/include/c++/4.5/tr1_impl/type_traits:245: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.5/tr1_impl/type_traits:245: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.5/tr1_impl/type_traits:245: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.5/tr1_impl/type_traits:247: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.5/tr1_impl/type_traits:247: error: expected '>' before '...' token
/usr/include/c++/4.5/tr1_impl/type_traits:248: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.5/tr1_impl/type_traits:248: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.5/tr1_impl/type_traits:248: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.5/tr1_impl/type_traits:333: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.5/tr1_impl/type_traits:333: error: template argument 2 is invalid
/usr/include/c++/4.5/tr1_impl/type_traits:339: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.5/tr1_impl/type_traits:339: error: template argument 2 is invalid
/usr/include/c++/4.5/tr1_impl/type_traits:345: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.5/tr1_impl/type_traits:345: error: template argument 2 is invalid
In file included from /usr/include/c++/4.5/tr1/unordered_map:39,
from /home/jsternberg/pyogre/root/usr/include/OGRE/OgreStdHeaders.h:40,
from /home/jsternberg/pyogre/root/usr/include/OGRE/OgrePrerequisites.h:315,
from /home/jsternberg/pyogre/root/usr/include/OGRE/Ogre.h:31,
from /home/jsternberg/pyogre/root/usr/include/OgreNewt/OgreNewt_World.h:14,
from /home/jsternberg/pyogre/root/usr/include/OgreNewt/OgreNewt.h:23,
from /home/jsternberg/pyogre/python-ogre/code_generators/ogrenewt/python_ogrenewt.h:9:
/usr/include/c++/4.5/tr1/type_traits:147: error: expected primary-expression before ',' token
/usr/include/c++/4.5/tr1/type_traits:147: error: expected primary-expression before ')' token
/usr/include/c++/4.5/tr1/type_traits:147: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.5/tr1/type_traits:241: error: requested alignment is not a constant
In file included from /usr/include/boost/type_traits/is_scalar.hpp:13,
from /usr/include/boost/type_traits/is_pod.hpp:14,
from /usr/include/boost/iterator/iterator_facade.hpp:26,
from /usr/include/boost/iterator/iterator_adaptor.hpp:15,
from /usr/include/boost/iterator/reverse_iterator.hpp:12,
from /usr/include/boost/range/reverse_iterator.hpp:20,
from /usr/include/boost/range/rbegin.hpp:19,
from /usr/include/boost/range/functions.hpp:23,
from /usr/include/boost/range.hpp:26,
from /home/jsternberg/pyogre/root/usr/include/OGRE/OgreIteratorRange.h:34,
from /home/jsternberg/pyogre/root/usr/include/OGRE/OgreIteratorWrappers.h:33,
from /home/jsternberg/pyogre/root/usr/include/OGRE/OgreAnimation.h:34,
from /home/jsternberg/pyogre/root/usr/include/OGRE/Ogre.h:33,
from /home/jsternberg/pyogre/root/usr/include/OgreNewt/OgreNewt_World.h:14,
from /home/jsternberg/pyogre/root/usr/include/OgreNewt/OgreNewt.h:23,
from /home/jsternberg/pyogre/python-ogre/code_generators/ogrenewt/python_ogrenewt.h:9:
/usr/include/boost/type_traits/is_enum.hpp:181: error: a function call cannot appear in a constant-expression
/usr/include/boost/type_traits/is_enum.hpp:181: error: template argument 2 is invalid


I already know about this issue and I've changed the environment.py file to use '/opt/ram/local/bin/gccxml' (which is the newest version of GCCXML that I compiled yesterday). I also tried using the GCCXML version that was mentioned in that forum post with no luck.

This is with python-ogre-1.6.4. Any ideas on how to get this working?

dermont

03-10-2011 06:45:10

For python-ogre there is a fudge which sets the compiler version for Ogre:

a) For v1-6-4 take a look at the cegui module, i.e. python_CEGUI.h.

#include "OgrePlatform.h"
#if (OGRE_COMPILER == OGRE_COMPILER_GNUC ) && defined (__PYTHONOGRE_BUILD_CODE )
#define OGRE_COMP_VER 420
#endif

You need to add something similar to your python_<module>.h files, in your case code_generators/ogrenewt/python_ogrenewt.h.

b) For trunk you need to add the appropriate header file as the first line of your python_<module>.h file.

http://python-ogre.svn.sourceforge.net/ ... iew=markup

#include "../ogre/python_ogre_include_OGRE.h"