error when wrapping bullet

19 views
Skip to first unread message

Louis731

unread,
Oct 18, 2009, 11:17:35 PM10/18/09
to Python Ogre Developers
Hi folks,

After a few hacking and tweaking here and there I managed to get
python-ogre working on OSX.
Now I'm trying to add Bullet into the environment.

However I got the below error message

#####
$ python python-ogre/BuildModule.py -g -v bullet

Using the 2 cores
PythonOgre.BuildModule: INFO Building Source code for bullet
Using the 2 cores
../common_utils/__init__.py:7: DeprecationWarning: the md5 module is
deprecated; use hashlib instead
import md5
Traceback (most recent call last):
File "generate_code.py", line 533, in <module>
generate_code()
File "generate_code.py", line 442, in generate_code
, cflags=environment.bullet.cflags
File "/Users/Louis/Ogre/root/usr/lib/python2.6/site-packages/
pyplusplus/module_builder/boost_python_builder.py", line 95, in
__init__
, indexing_suite_version)
File "/Users/Louis/Ogre/root/usr/lib/python2.6/site-packages/
pyplusplus/module_builder/boost_python_builder.py", line 138, in
__parse_declarations
decls = reader.read_files( files, compilation_mode )
File "/Users/Louis/Ogre/root/usr/lib/python2.6/site-packages/
pygccxml/parser/project_reader.py", line 217, in read_files
return self.__parse_file_by_file(files)
File "/Users/Louis/Ogre/root/usr/lib/python2.6/site-packages/
pygccxml/parser/project_reader.py", line 238, in __parse_file_by_file
, self.__decl_factory )
File "/Users/Louis/Ogre/root/usr/lib/python2.6/site-packages/
pygccxml/parser/source_reader.py", line 88, in __init__
self.__config.raise_on_wrong_settings()
File "/Users/Louis/Ogre/root/usr/lib/python2.6/site-packages/
pygccxml/parser/config.py", line 173, in raise_on_wrong_settings
super( gccxml_configuration_t, self ).raise_on_wrong_settings()
File "/Users/Louis/Ogre/root/usr/lib/python2.6/site-packages/
pygccxml/parser/config.py", line 113, in raise_on_wrong_settings
, self.include_paths )
File "/Users/Louis/Ogre/root/usr/lib/python2.6/site-packages/
pygccxml/parser/config.py", line 112, in <lambda>
map( lambda idir: self.__ensure_dir_exists( idir, 'include
directory' )
File "/Users/Louis/Ogre/root/usr/lib/python2.6/site-packages/
pygccxml/parser/config.py", line 104, in __ensure_dir_exists
raise RuntimeError( '%s("%s") does not exist!' % ( meaning,
dir_path ) )
RuntimeError: include directory("/Users/Louis/Ogre/bullet-2.73/src")
does not exist!
PythonOgre.BuildModule: WARNING Task Failed
######


I think this was because the retrieved bullet version is 2.74?

Can this be fixed?

Ivan Vučica

unread,
Oct 19, 2009, 1:51:12 AM10/19/09
to python-ogre...@googlegroups.com
Try hand editing environment.py (I think) and update the version(s)
mentioned. If it's not there - it's probably in
PythonOgreConfig_posix.py.

Feel free to post here info on what you did with which svn revision.

/this is a quick reply from cellphone/
--
Regards,

Ivan Vučica

Louis731

unread,
Oct 19, 2009, 5:49:05 PM10/19/09
to Python Ogre Developers
Thanks, Ivan

I tried modifying the environment.py with version 2.73, but had
different error messages, see below

#####
excluding function ::btSliderConstraint::testLinLimits2
Traceback (most recent call last):
File "generate_code.py", line 533, in <module>
generate_code()
File "generate_code.py", line 480, in generate_code
ManualExclude ( mb )
File "generate_code.py", line 129, in ManualExclude
global_ns.member_functions(e).exclude()
File "/Users/Louis/Ogre/root/usr/lib/python2.6/site-packages/
pygccxml/declarations/scopedef.py", line 521, in member_functions
, allow_empty=allow_empty)
File "/Users/Louis/Ogre/root/usr/lib/python2.6/site-packages/
pygccxml/declarations/scopedef.py", line 377, in _find_multiple
raise RuntimeError( "Multi declaration query returned 0
declarations." )
RuntimeError: Multi declaration query returned 0 declarations.
PythonOgre.BuildModule: WARNING Task Failed
####################

It looks like some


On Oct 19, 2:51 am, Ivan Vučica <ivuc...@gmail.com> wrote:
> Try hand editing environment.py (I think) and update the version(s)
> mentioned. If it's not there - it's probably in
> PythonOgreConfig_posix.py.
>
> Feel free to post here info on what you did with which svn revision.
>
> /this is a quick reply from cellphone/
>

Louis731

unread,
Oct 19, 2009, 5:53:13 PM10/19/09
to Python Ogre Developers
I meant to say it looks like something wrong in wrapping the bullet
module

$ python python-ogre/BuildModule.py -g bullet

Ivan Vučica

unread,
Oct 19, 2009, 7:04:40 PM10/19/09
to python-ogre...@googlegroups.com
Unfortunately this is as far as I can help, I have no real experience writing and bugfixing the wrapper, only what I did during compiling (and that didn't include bullet, for at Cateia we don't use it in our games).

Hopefully Andy or someone else more knowledgeable will be able to help!
--
Regards,

Ivan Vučica

Andy Miller

unread,
Oct 19, 2009, 10:08:16 PM10/19/09
to python-ogre...@googlegroups.com
Sorry missed this early on -- The current wrapper code if for bullet 2.74 so the the fix is to patch PythonOgreConfig_posix.py and change the PATH_Bullet like:

PATH_Bullet=        os.path.join(BASE_DIR, 'bullet-2.74') 

I'll fix this in the SVN

Regards
Andy

2009/10/20 Ivan Vučica <ivu...@gmail.com>

Louis731

unread,
Oct 20, 2009, 12:14:57 AM10/20/09
to Python Ogre Developers

Thanks, Andy. the wrapping seems to be okay now, at least no "Task
Failed" signal.
However, there were a lot of messages of 'compilation error' as the
following example, not sure if it's of any significance...

#####
WARNING: void btDynamicsWorld::setInternalTickCallback
(btInternalTickCallback cb, void * worldUserInfo=0) [member function]
> compilation error W1004: Boost.Python library can not expose function, which takes as argument/returns pointer to
> function. See http://www.boost.org/libs/python/doc/v2/faq.html#funcptr for more information.
#####

And, is there a way that I can test the bullet has been integrated
into Python-ogre?




On Oct 19, 11:08 pm, Andy Miller <nzmill...@gmail.com> wrote:
> Sorry missed this early on -- The current wrapper code if for bullet 2.74 so
> the the fix is to patch *PythonOgreConfig_posix.py* and change the
> PATH_Bullet like:
> *PATH_Bullet=        os.path.join(BASE_DIR, 'bullet-2.74') *
>
> I'll fix this in the SVN
>
> Regards
> Andy
>
> 2009/10/20 Ivan Vučica <ivuc...@gmail.com>
>
>
>
> > Unfortunately this is as far as I can help, I have no real experience
> > writing and bugfixing the wrapper, only what I did during compiling (and
> > that didn't include bullet, for at Cateia we don't use it in our games).
> > Hopefully Andy or someone else more knowledgeable will be able to help!
>

Louis731

unread,
Oct 20, 2009, 10:43:50 AM10/20/09
to Python Ogre Developers
Scrap my previous post, cuz I forgot to compile :[

Anyway, I tried compile, and had alot of missing files, seems that the
bullet module is not native to Mac after all.
(But that's just my theory)

#########
...

g++ -o build_dir_2.6/bullet_2.74/NodeArray.pypp.os -c -I./ -O3 -
dynamic -fPIC -DBOOST_PYTHON_NO_PY_
SIGNATURES -DBOOST_PYTHON_MAX_ARITY=19 -ftemplate-depth-128 -finline-
functions -Wno-inline -Wall -n
o-cpp-precomp -gdwarf-2 -DNDEBUG -include strings.h -include Carbon/
Carbon.h -I/Users/Louis/Ogre/py
thon-ogre/generated/bullet_2.74 /D "NDEBUG" /D "_CONSOLE" /D "WIN32" /
D "_MBCS" /fp:fast /Gy /GF -D
__ASSERTMACROS__ -F/Users/Louis/Ogre/ogre/Mac/build/Release -F/Users/
Louis/Library/Frameworks -fPIC
-I/Users/Louis/Ogre/root/usr/include/boost-1_38 -I/Users/Louis/Ogre/
bullet-2.74/src -I/opt/local/L
ibrary/Frameworks/Python.framework/Versions/2.6/include/python2.6 -
Ibuild_dir_2.6/bullet_2.74/None
-Igenerated/bullet_2.74/None generated/bullet_2.74/NodeArray.pypp.cpp
i686-apple-darwin9-g++-4.2.1: /D: No such file or directory
i686-apple-darwin9-g++-4.2.1: NDEBUG: No such file or directory
i686-apple-darwin9-g++-4.2.1: /D: No such file or directory
i686-apple-darwin9-g++-4.2.1: _CONSOLE: No such file or directory
i686-apple-darwin9-g++-4.2.1: /D: No such file or directory
i686-apple-darwin9-g++-4.2.1: WIN32: No such file or directory
i686-apple-darwin9-g++-4.2.1: /D: No such file or directory
i686-apple-darwin9-g++-4.2.1: _MBCS: No such file or directory
i686-apple-darwin9-g++-4.2.1: /fp:fast: No such file or directory
i686-apple-darwin9-g++-4.2.1: /Gy: No such file or directory
i686-apple-darwin9-g++-4.2.1: /GF: No such file or directory
scons: *** [build_dir_2.6/bullet_2.74/IndexedMeshArray.pypp.os] Error
1
scons: *** [build_dir_2.6/bullet_2.74/BvhSubtreeInfoArray.pypp.os]
Error 1
scons: *** [build_dir_2.6/bullet_2.74/NodeArray.pypp.os] Error 1
scons: building terminated because of errors.
PythonOgre.BuildModule: WARNING Task Failed

####################



On Oct 20, 1:14 am, Louis731 <louis...@gmail.com> wrote:
> Thanks, Andy. the wrapping seems to be okay now, at least no "Task
> Failed" signal.
> However, there were a lot of messages of 'compilation error' as the
> following example, not sure if it's of any significance...
>
> #####
> WARNING: void btDynamicsWorld::setInternalTickCallback
> (btInternalTickCallback cb, void * worldUserInfo=0) [member function]> compilation error W1004: Boost.Python library can not expose function, which takes as argument/returns pointer to
> > function.  Seehttp://www.boost.org/libs/python/doc/v2/faq.html#funcptrfor more information.

Ivan Vučica

unread,
Oct 20, 2009, 11:14:54 AM10/20/09
to python-ogre...@googlegroups.com
That looks like it's passing some Visual Studio options while compiling it.

While I cannot test this because I'm supposed to be studying for exams - so I just examined environment.py - it looks to me like someone edited bullet's options and added Visual Studio CCFLAGS globally for all platforms, instead of just for Windows. Can you try removing/commenting out CCFLAGS for bullet from environment.py? 

That's two lines above:
class ogrebulletc(pymodule):
(at least in current trunk.)

If that compiles, you may want to recompile with:
CCFLAGS='-fno-inline'
(that's what ogrebulletc module uses, and it sounds to me like it may be important for the wrapper). To build with debug options, naturally, also pass -g2 or -g3. 

Have fun!
--
Regards,

Ivan Vučica

Louis731

unread,
Oct 20, 2009, 7:43:22 PM10/20/09
to Python Ogre Developers
That's some great suggestion.

I tried, however, still had errors.

########
....
generated/bullet_2.74/
btAlignedAllocator_PosixThreadSupportBtSpuStatus16u.pypp.cpp:86:
error: expected `)' before ‘*’ token
generated/bullet_2.74/
btAlignedAllocator_PosixThreadSupportBtSpuStatus16u.pypp.cpp:88:
error: request for member ‘def’ in
‘btAlignedAllocator_PosixThreadSupportBtSpuStatus16u_exposer’, which
is of non-class type
‘register_btAlignedAllocator_PosixThreadSupportBtSpuStatus16u_class::btAlignedAllocator_PosixThreadSupportBtSpuStatus16u_exposer_t’
generated/bullet_2.74/
btAlignedAllocator_PosixThreadSupportBtSpuStatus16u.pypp.cpp:90:
error: ‘PosixThreadSupport’ cannot appear in a constant-expression
generated/bullet_2.74/
btAlignedAllocator_PosixThreadSupportBtSpuStatus16u.pypp.cpp:90:
error: wrong number of template arguments (1, should be 2)
/Users/Louis/Ogre/bullet-2.74/src/LinearMath/btAlignedAllocator.h:61:
error: provided for ‘template<class T, unsigned int Alignment> class
btAlignedAllocator’
generated/bullet_2.74/
btAlignedAllocator_PosixThreadSupportBtSpuStatus16u.pypp.cpp:90:
error: ‘destroy_function_type’ was not declared in this scope
scons: *** [build_dir_2.6/bullet_2.74/
btAlignedAllocator_PosixThreadSupportBtSpuStatus16u.pypp.os] Error 1
scons: building terminated because of errors.
PythonOgre.BuildModule: WARNING Task Failed

###########


I'll try to dig further into but I think maybe someone who is more
knowledgeable could take a comprehensive look into this, there are
just too many errors now.
> ...
>
> read more »

Sjoerd de Vries

unread,
Nov 23, 2009, 4:49:01 PM11/23/09
to Python Ogre Developers
Hi,

I also tried to compile Bullet (2.75) today, not on Mac but on Linux
(Ubuntu 9.04, Python 2.6.2).
I also encountered the same errors as you did and managed to fix
them.

Your last error is because some header file is somehow missed (by Py+
+ ?). Take the following files:

python-ogre/generated/bullet_2.75/
btAlignedAllocator_PosixThreadSupportBtSpuStatus16u.pypp.cpp
python-ogre/generated/bullet_2.75/
btAlignedObjectArray_PosixThreadSupportBtSpuStatus16u.pypp.cpp

and add the following line:

#include "BulletMultiThreaded/PosixThreadSupport.h"

Unfortunately, I have now another error, and it seems that it is Boost-
related:

/home/sjoerd/python-ogre/development/root/usr/include/boost/python/
converter/registered.hpp:86: error: no matching function for call to
‘register_shared_ptr1(void (*)(btDynamicsWorld*, btScalar))’
(and no, I don't know where the
This is the full error message:
File "/home/sjoerd/python-ogre/development/python-ogre/SConstruct",
line 144, in <module>
/home/sjoerd/python-ogre/development/root/usr/include/boost/python/
converter/registered.hpp: In function ‘const
boost::python::converter::registration&
boost::python::converter::detail::registry_lookup2(T& (*)()) [with T =
void ()(btDynamicsWorld*, btScalar)]’:
/home/sjoerd/python-ogre/development/root/usr/include/boost/python/
converter/registered.hpp:94: instantiated from ‘const
boost::python::converter::registration&
boost::python::converter::detail::registry_lookup1
(boost::type<Target>) [with T = void (&)(btDynamicsWorld*, btScalar)]
’
/home/sjoerd/python-ogre/development/root/usr/include/boost/python/
converter/registered.hpp:105: instantiated from ‘const
boost::python::converter::registration&
boost::python::converter::detail::registered_base<void (&)
(btDynamicsWorld*, btScalar)>::converters’
/home/sjoerd/python-ogre/development/root/usr/include/boost/python/
converter/arg_from_python.hpp:269: instantiated from
‘boost::python::converter::pointer_arg_from_python<T>::pointer_arg_from_python
(PyObject*) [with T = void (*)(btDynamicsWorld*, btScalar)]’
/home/sjoerd/python-ogre/development/root/usr/include/boost/python/
arg_from_python.hpp:70: instantiated from
‘boost::python::arg_from_python<T>::arg_from_python(PyObject*) [with
T = void (*)(btDynamicsWorld*, btScalar)]’
/home/sjoerd/python-ogre/development/root/usr/include/boost/
preprocessor/iteration/detail/local.hpp:37: instantiated from
‘PyObject* boost::python::detail::caller_arity<4u>::impl<F,
Policies, Sig>::operator()(PyObject*, PyObject*) [with F = void (*)
(btDynamicsWorld&, void (*)(btDynamicsWorld*, btScalar), unsigned int,
bool), Policies = boost::python::default_call_policies, Sig =
boost::mpl::vector5<void, btDynamicsWorld&, void (*)(btDynamicsWorld*,
btScalar), unsigned int, bool>]’
/home/sjoerd/python-ogre/development/root/usr/include/boost/python/
object/py_function.hpp:38: instantiated from ‘PyObject*
boost::python::objects::caller_py_function_impl<Caller>::operator()
(PyObject*, PyObject*) [with Caller =
boost::python::detail::caller<void (*)(btDynamicsWorld&, void (*)
(btDynamicsWorld*, btScalar), unsigned int, bool),
boost::python::default_call_policies, boost::mpl::vector5<void,
btDynamicsWorld&, void (*)(btDynamicsWorld*, btScalar), unsigned int,
bool> >]’
generated/bullet_2.75/btDynamicsWorld.pypp.cpp:671: instantiated
from here
/home/sjoerd/python-ogre/development/root/usr/include/boost/python/
converter/registered.hpp:86: error: no matching function for call to
‘register_shared_ptr1(void (*)(btDynamicsWorld*, btScalar))’

I tried both Boost SVN and Boost 1.41, it made no difference. Can you
please help me out?

cheers

Sjoerd
> > I just examined environment.py - it looks to me like someone editedbullet's
> > options and added Visual Studio CCFLAGS globally for all platforms, instead
> > of just for Windows. Can you try removing/commenting out CCFLAGS forbullet
> > from environment.py?
>
> > That's two lines above:
> > class ogrebulletc(pymodule):
> > (at least in current trunk.)
>
> > If that compiles, you may want to recompile with:
> > CCFLAGS='-fno-inline'
> > (that's what ogrebulletc module uses, and it sounds to me like it may be
> > important for the wrapper). To build with debug options, naturally, also
> > pass -g2 or -g3.
>
> > Have fun!
>
> > On Tue, Oct 20, 2009 at 16:43, Louis731 <louis...@gmail.com> wrote:
>
> > > Scrap my previous post, cuz I forgot to compile :[
>
> > > Anyway, I tried compile, and had alot of missing files, seems that the
> > >bulletmodule is not native to Mac after all.
> > > > And, is there a way that I can test thebullethas been integrated
> > > > into Python-ogre?
>
> > > > On Oct 19, 11:08 pm, Andy Miller <nzmill...@gmail.com> wrote:
>
> > > > > Sorry missed this early on -- The current wrapper code if forbullet
> > > 2.74 so
> > > > > the the fix is to patch *PythonOgreConfig_posix.py* and change the
> > > > > PATH_Bullet like:
> > > > > *PATH_Bullet=        os.path.join(BASE_DIR, 'bullet-2.74') *
>
> > > > > I'll fix this in the SVN
>
> > > > > Regards
> > > > > Andy
>
> > > > > 2009/10/20 Ivan Vučica <ivuc...@gmail.com>
>
> > > > > > Unfortunately this is as far as I can help, I have no real experience
> > > > > > writing and bugfixing the wrapper, only what I did during compiling
> > > (and
> > > > > > that didn't includebullet, for at Cateia we don't use it in our
> > > > > >> > > > Now I'm trying to addBulletinto the environment.
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages