Linux Information

andy

25-10-2007 03:05:09

There are a couple of options for Linux users that want to use Python-Ogre.
  1. Build from Source[/*:m]
  2. Use a binary package[/*:m][/list:o]
    Recently there have been significant improvements when building Python-Ogre from source, so please give this a try and report any issues you have so we can fix them

    To build from source please follow the instructions [b]here[/b].

    For those who want a quickstart - perhaps to evaluate Python-Ogre before jumping in, Krešimir has been kind enough to create a binary build. See his post [b]here[/b]

    As always nothing is perfect so if you have a problem let us know so it can be resolved.

    NOTE: For Linux support with building Python-Ogre please use the Developers Mailing List (it's 'google' powered) found [b]here[/b]

    Thanks
    Andy

mithro

26-08-2008 03:07:56

For my project Thousand Parsec I have packaged Python Ogre for Debian and Ubuntu (hopefully RPM based distros will be coming soon).

Thousand Parsec has it's own APT repository the easiest way to get Python Ogre is to use this repository. Just follow these instructions.

1. The packages and the repository meta-data are digitally signed, so you'll need to import the key into your apt's list of trusted keys in order to not get warnings about it.


curl http://packages.thousandparsec.net/key.asc | sudo apt-key add -


Ignore any failure on this step, it is not important.

2. Add the following lines to either your /etc/apt/sources.list file or to a new file in /etc/apt/sources.list.d.

Replace the "DIST" text with whatever is appropriate for your system. (See the table right for a list of supported distributions and architectures.)


# Thousand Parsec repository at packages.thousandparsec.net
deb http://packages.thousandparsec.net/DIST DIST repository
deb-src http://packages.thousandparsec.net/DIST DIST repository


For example, if your distro is Ubuntu Gutsy, then you would use the following configuration statements:


# Thousand Parsec repository at packages.thousandparsec.net
deb http://packages.thousandparsec.net/gutsy gutsy universe
deb-src http://packages.thousandparsec.net/gutsy gutsy universe


Or, if your distro is Debian Unstable , then you would use the following configuration statements:


# Thousand Parsec repository at packages.thousandparsec.net
deb http://packages.thousandparsec.net/sid sid main
deb-src http://packages.thousandparsec.net/sid sid main


3. Run the this command to update your local copy of the package meta-data.


sudo apt-get update


4. You can now use your favorite package selection tool to install or upgrade the Thousand Parsec packages. Here's how to do it with apt-get:


sudo apt-get install python-ogre


As Andy said, report any problems to the Python-Ogre please use the Developers Mailing List (it's 'google' powered)

I DO NOT check the forums regularly (while I check the list daily), do don't be surprised if it takes me months to reply to posts here.

kyathir

16-04-2009 19:03:58

There is also another method for using python-ogre in linux.
You can use wine to install python and the python-ogre windows installer. Then you can use wine to run your python-ogre scripts.

wine "/yourwinepath/drive_c/Python25/python.exe" ogrescript.py

It works perfectly for me, and I think that is a good way to make sure that your code works in windows too.

NicoEchaniz

17-05-2009 07:17:42

For my project Thousand Parsec I have packaged Python Ogre for Debian and Ubuntu (hopefully RPM based distros will be coming soon).

Thousand Parsec has it's own APT repository the easiest way to get Python Ogre is to use this repository. Just follow these instructions. [...]


mithro, are you planning to add jaunty (ubuntu 9.04) support any time soon?

Thanks,

NicoEchániz

mithro

18-05-2009 09:08:57

I am working on them, but have been working on them for the past 12 months.

My current attempt at getting the packages working can be found at https://launchpad.net/~mithro/+archive/ppa.

Tim 'mithro' Ansell

flowolf

16-09-2009 09:31:47

I've been trying to install your binary packages but they depends on missing virtual package. Are they being updated or should I find another way?

mithro

16-09-2009 10:32:12

I need some more information to be able to help you. What version of Ubuntu? Which package is it dieing on? Whats the apt-get output look like? Which packages are you using ppa or thousandparsec?

- Mithro

slade991

26-10-2009 21:18:58

Hi,
i finally decide to post here, avec 3 days of fight with python-ogre....
I couldn't install it on my jaunty.

1) i tryied to install the package from the repository in linux build v2, but it say'd be i need python (<2.6) and that 2.6.2 need to be installed...
2) i tryied the package from the mithro ppa repository, but said me i need libcegui, i installed libcegui-mk2 but nothing change...
3) i tryied to compile it like said in linux build.
Boost doesn't compile, i needed to use the 1.36 version of boost for it to compile.
Cegui doesn't compile too with the 0.6.2 but compile with 0.7.0
Ogre doesn't compile because of CEGUI, i need to disable ogre-demo.
Then i couldn't test the demo of ogre.
And the last point was :
python python-ogre/BuildModule.py -g -c ogre ois cegui
don't compile either get all that stuff :
10-26 17:24 PythonOgre.BuildModule INFO Compiling Source code for ogre
10-26 17:24 PythonOgre.BuildModule DEBUG Spawning 'scons -j3 PROJECTS=ogre' in '/home/slade/development/python-ogre'
10-26 17:24 PythonOgre.BuildModule INFO Building Source code for ois
10-26 17:24 PythonOgre.BuildModule DEBUG Spawning 'python generate_code.py' in '/home/slade/development/python-ogre/code_generators/ois'
10-26 17:24 PythonOgre.BuildModule WARNING Task Failed
10-26 17:24 PythonOgre.BuildModule DEBUG Using the 2 cores

10-26 17:24 PythonOgre.BuildModule DEBUG ../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 326, in <module>
generate_code()
File "generate_code.py", line 243, in generate_code
, cflags=environment.ois.cflags
File "/home/slade/development/root/usr/lib/python2.6/site-packages/pyplusplus/module_builder/boost_python_builder.py", line 95, in __init__
, indexing_suite_version)
File "/home/slade/development/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 "/home/slade/development/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 "/home/slade/development/root/usr/lib/python2.6/site-packages/pygccxml/parser/project_reader.py", line 238, in __parse_file_by_file
, self.__decl_factory )
File "/home/slade/development/root/usr/lib/python2.6/site-packages/pygccxml/parser/source_reader.py", line 88, in __init__
self.__config.raise_on_wrong_settings()
File "/home/slade/development/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 "/home/slade/development/root/usr/lib/python2.6/site-packages/pygccxml/parser/config.py", line 113, in raise_on_wrong_settings
, self.include_paths )
File "/home/slade/development/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 "/home/slade/development/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("/home/slade/development/root/usr/include/boost-1_40") does not exist!

10-26 17:24 PythonOgre.BuildModule INFO Compiling Source code for ois
10-26 17:24 PythonOgre.BuildModule DEBUG Spawning 'scons -j3 PROJECTS=ois' in '/home/slade/development/python-ogre'
10-26 17:24 PythonOgre.BuildModule INFO Building Source code for cegui
10-26 17:24 PythonOgre.BuildModule DEBUG Spawning 'python generate_code.py' in '/home/slade/development/python-ogre/code_generators/cegui'
10-26 17:24 PythonOgre.BuildModule WARNING Task Failed
10-26 17:24 PythonOgre.BuildModule DEBUG Using the 2 cores

10-26 17:24 PythonOgre.BuildModule DEBUG ../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 348, in <module>
generate_code()
File "generate_code.py", line 281, in generate_code
, cflags=environment.ogre.cflags
File "/home/slade/development/root/usr/lib/python2.6/site-packages/pyplusplus/module_builder/boost_python_builder.py", line 95, in __init__
, indexing_suite_version)
File "/home/slade/development/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 "/home/slade/development/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 "/home/slade/development/root/usr/lib/python2.6/site-packages/pygccxml/parser/project_reader.py", line 238, in __parse_file_by_file
, self.__decl_factory )
File "/home/slade/development/root/usr/lib/python2.6/site-packages/pygccxml/parser/source_reader.py", line 88, in __init__
self.__config.raise_on_wrong_settings()
File "/home/slade/development/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 "/home/slade/development/root/usr/lib/python2.6/site-packages/pygccxml/parser/config.py", line 113, in raise_on_wrong_settings
, self.include_paths )
File "/home/slade/development/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 "/home/slade/development/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("/home/slade/development/root/usr/include/boost-1_40") does not exist!

10-26 17:24 PythonOgre.BuildModule INFO Compiling Source code for cegui
10-26 17:24 PythonOgre.BuildModule DEBUG Spawning 'scons -j3 PROJECTS=cegui' in '/home/slade/development/python-ogre'


I really don't know what to do now...
If somebody could give me a little help about that, it'll be really great.
Thanks

edit : Ok it's because of my 1.38 version of boost, i renamed the folder and try (and hope)

Enrico

02-11-2009 12:39:07

I am currently working on updating the Linux build scripts and documentation. I have a somewhat stable build with Ogre 1.6.4, CEGUI and OIS. Other addons I did not test so far. Which ones have high priority for you? My next target would be paging and Bullet.

There is one thing I noted on Debian and Ubuntu-system (using Debian myself): With the provided boost libraries the scripts fail to generate proper binding code, so you have to recompile boost for python-ogre. On the other hand, you do not need to recompile cegui, ois and ogre anymore :D

I will submit a patch in the following days to get these changes integrated. Maybe I can provide some binary packages through OpenSuse build service or something...

If you have further questions or feedback, please put them here. I am currently looking into becoming the Linux maintainer for python-ogre :)

dermont

11-11-2009 09:59:14

@andy,

I haven't been following python-ogre recently, 1.6.4 builds and runs fine on Linux. What's the current status with the svn version 1.7 on Linux? Does 1.7 build on Windows and may just need some tweaking on Linux? Is the current Ogre1.6.1 patch applicable to 1.7.

Thanks

Enrico

11-11-2009 10:08:39

@andy,

I haven't been following python-ogre recently, 1.6.4 builds and runs fine on Linux.

Mhm, that is weird :cry:
None of the demos work for me, they all take forever at "Parsing resource group...".

andy

12-11-2009 01:54:21

@dermont

The SVN supports Ogre 1.7 fairly well at the moment (at least on windows). I've set an _SVN flag in the PythonOgreConfig file that is used in environment.py to ensure I don't break the 1.6 stuff...

I believe that Linux support is only a matter of minor tweaks (just need time to get to it) and I suspect you will indeed have to use the 1.6 patch or something very similar (on the Windows build I don't need to patch the Ogre source at all as the only issues I had have made it into the Ogre trunk -- not sure if this would be the case with Linux)..

Andy

dermont

13-11-2009 16:24:06

@andy

Thanks I had a quick stab but ran into problems with Ogre::Pool<Ogre::SharedPtr<Ogre::Resource> > during compile. I'll try looking it again this weekend. Just noticed the Swig implementation, out of interest is this working?

@Enrico

This sounds like the 64bit problem that other users are having.

Enrico

13-11-2009 18:28:04

@Enrico

This sounds like the 64bit problem that other users are having.

I dont know what I changed, but I got the 64bit build running :D
System is Debian testing with Boost SVN and Ogre 1.6.4, python 2.5 :)
I will submit a patch to the ML...

andy

14-11-2009 01:54:15

@dermont

I spent LOTS of time on the swig wrapper as I thought it would be nice to have a smaller foot print wrapper, and I thought I might look to generate a standard language wrapper for Ogre (.NET, Java etc)..

However the functionality difference between swig and boost.python is HUGE -- especially when it comes to advanced C++ functionality (templates/sub classes/etc) and it doesn't actually make the wrapper 'language' independent (ie you end up with lots of language specific wrappers, specials etc)..

I also found with swig that giving it a list of header (again Ogre specific) and asking it to generate code wasn't pretty so I went down the path of creating more specific SWIG files -- feel free to take a look if you are interested :)

I'm keeping a watch on the swig development with the hope it will improve in it's C++ support..

Regards
Andy

magcius

29-11-2009 20:50:13

Getting this while trying to build OGRE-Bullet..


g++ -o build_dir_2.6/bullet_2.75/btGeneric6DofConstraint.pypp.os -c `pkg-config --cflags OGRE` -I -O3 -I./ -DBOOST_PYTHON_MAX_ARITY=19 -DBOOST_PYTHON_NO_PY_SIGNATURES -I/home/jstpierre/python-ogre/python-ogre/generated/bullet_2.75 -I/home/jstpierre/python-ogre/root/usr/include -L/home/jstpierre/python-ogre/root/usr/lib -fPIC -I/home/jstpierre/python-ogre/root/usr/include/boost -I/home/jstpierre/python-ogre/bullet-2.75/src -I/usr/include/python2.6 -Ibuild_dir_2.6/bullet_2.75/None -Igenerated/bullet_2.75/None generated/bullet_2.75/btGeneric6DofConstraint.pypp.cpp
In file included from /home/jstpierre/python-ogre/root/usr/include/boost/python/object/make_instance.hpp:10,
from /home/jstpierre/python-ogre/root/usr/include/boost/python/object/make_ptr_instance.hpp:8,
from /home/jstpierre/python-ogre/root/usr/include/boost/python/to_python_indirect.hpp:11,
from /home/jstpierre/python-ogre/root/usr/include/boost/python/converter/arg_to_python.hpp:10,
from /home/jstpierre/python-ogre/root/usr/include/boost/python/call.hpp:15,
from /home/jstpierre/python-ogre/root/usr/include/boost/python/object_core.hpp:12,
from /home/jstpierre/python-ogre/root/usr/include/boost/python/args.hpp:25,
from /home/jstpierre/python-ogre/root/usr/include/boost/python.hpp:11,
from generated/bullet_2.75/btDynamicsWorld.pypp.cpp:3:
/home/jstpierre/python-ogre/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/jstpierre/python-ogre/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/jstpierre/python-ogre/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/jstpierre/python-ogre/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/jstpierre/python-ogre/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/jstpierre/python-ogre/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/jstpierre/python-ogre/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/jstpierre/python-ogre/root/usr/include/boost/python/converter/registered.hpp:86: error: no matching function for call to ‘register_shared_ptr1(void (*)(btDynamicsWorld*, btScalar))’
scons: *** [build_dir_2.6/bullet_2.75/btDynamicsWorld.pypp.os] Error 1
scons: building terminated because of errors.
PythonOgre.BuildModule: WARNING Task Failed

dermont

30-11-2009 12:26:48

I think your bug is related to the following call back in btDynamicsWorld.h:

/// Type for the callback for each tick
typedef void (*btInternalTickCallback)(btDynamicsWorld *world, btScalar timeStep);


You will probably have to hand-wrap this or something similar, however as a test you can exclude the above, so it builds:


Index: customization_data.py
===================================================================
--- customization_data.py (revision 1030)
+++ customization_data.py (working copy)
@@ -19,11 +19,14 @@
elif os.name == 'nt':
ret.append('BulletMultiThreaded/Win32ThreadSupport.h')
ret.append('BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h')
- elif os.name == 'linux':
+ elif os.name == 'posix':
ret.append('BulletMultiThreaded/PosixThreadSupport.h')
ret.append('BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h')
return ret

Index: generate_code.py
===================================================================
--- generate_code.py (revision 1030)
+++ generate_code.py (working copy)
@@ -122,7 +122,9 @@
,'::btCollisionShape::getName'


# new in .74
- ,'::btSliderConstraint::testLinLimits2'
+ ,'::btSliderConstraint::testLinLimits2'
+ ,'::btDynamicsWorld::setInternalTickCallback' ## New in 2.75(??) InternalTickCallback
+
]
for e in excludes:
print "excluding function", e
@@ -171,8 +173,12 @@
# c.exclude()

excludes = ['::btPolyhedralConvexShape::m_optionalHull' ## needs Hull from Extras
- ,'::btRaycastVehicle::m_wheelInfo' ## TOFIX -- might be a bullet issue with wheels
- ]
+ ,'::btRaycastVehicle::m_wheelInfo' ## TOFIX -- might be a bullet issue with wheels
+ ,'btDynamicsWorld::m_internalTickCallback'
+ ,'btDynamicsWorld::m_internalPreTickCallback' ## InternalTickCallback
+
+ ]
+

for e in excludes:
try:
global_ns.variable(e).exclude()
@@ -196,8 +202,13 @@
o.exclude()
global_ns.class_('btQuaternion').operators("operator-", arg_types=[]).exclude()

+
+ noncopy=['btDbvtBroadphase' ]
+ for c in noncopy:
+ main_ns.class_(c).noncopyable = True
+
+
-

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

##

## And there are things that manually need to be INCLUDED

@@ -402,11 +413,14 @@
os.path.join( environment.bullet.root_dir, "python_bullet.h" )
, environment.bullet.cache_file )


defined_symbols.append( 'VERSION_' + environment.bullet.version )
-
+ if sys.platform.startswith ('linux'):
+ defined_symbols.append( 'USE_PTHREADS' )
+
+
#
# build the core Py++ system from the GCCXML created source
#


Edit: the patch format is screwed up within the code blocks, find patch attached below.

magcius

30-11-2009 16:58:00

Thanks, that fixed it.

Now for OGREBulletC


g++ -o build_dir_2.6/ogrebulletc_r2684/OgreBulletCollisionsRay.os -c `pkg-config --cflags OGRE` -I -O3 -I./ -DBOOST_PYTHON_MAX_ARITY=19 -DBOOST_PYTHON_NO_PY_SIGNATURES -I/home/jstpierre/python-ogre/python-ogre/generated/ogrebulletc_r2684 -D_PRECOMP -fno-inline -I/home/jstpierre/python-ogre/root/usr/include -L/home/jstpierre/python-ogre/root/usr/lib -fPIC -I/home/jstpierre/python-ogre/root/usr/include/boost -I/home/jstpierre/python-ogre/bullet-2.75/src -I/home/jstpierre/python-ogre/bullet-2.75/src/BulletCollision -IThirdParty/ogrebullet/Collisions -I/home/jstpierre/python-ogre/root/usr/include/OGRE -I/home/jstpierre/python-ogre/root/usr/include/OGRE -I/home/jstpierre/python-ogre/bullet-2.75/Extras/ConvexDecomposition -I/usr/include/python2.6 -Ibuild_dir_2.6/ogrebulletc_r2684/None -Igenerated/ogrebulletc_r2684/None generated/ogrebulletc_r2684/OgreBulletCollisionsRay.cpp
generated/ogrebulletc_r2684/OgreBulletCollisionsRay.cpp: In member function ‘bool OgreBulletCollisions::CollisionRayResultCallback::doesCollide() const’:
generated/ogrebulletc_r2684/OgreBulletCollisionsRay.cpp:76: error: ‘struct btCollisionWorld::RayResultCallback’ has no member named ‘HasHit’
generated/ogrebulletc_r2684/OgreBulletCollisionsMultiSphereShape.cpp: In constructor ‘OgreBulletCollisions::MultiSphereCollisionShape::MultiSphereCollisionShape(const Ogre::Vector3&, const Ogre::Vector3*, const Ogre::Real*, int)’:
generated/ogrebulletc_r2684/OgreBulletCollisionsMultiSphereShape.cpp:50: error: no matching function for call to ‘btMultiSphereShape::btMultiSphereShape(btVector3, btVector3*, const btScalar*, int&)’
/home/jstpierre/python-ogre/bullet-2.75/src/BulletCollision/CollisionShapes/btMultiSphereShape.h:33: note: candidates are: btMultiSphereShape::btMultiSphereShape(const btVector3*, const btScalar*, int)
/home/jstpierre/python-ogre/bullet-2.75/src/BulletCollision/CollisionShapes/btMultiSphereShape.h:27: note: btMultiSphereShape::btMultiSphereShape(const btMultiSphereShape&)
scons: *** [build_dir_2.6/ogrebulletc_r2684/OgreBulletCollisionsMultiSphereShape.os] Error 1
scons: *** [build_dir_2.6/ogrebulletc_r2684/OgreBulletCollisionsRay.os] Error 1
scons: building terminated because of errors.
PythonOgre.BuildModule: WARNING Task Failed


and OGREBulletD


g++ -o build_dir_2.6/ogrebulletd_r2684/OgreBulletCollisionsRay.os -c `pkg-config --cflags OGRE` -I -O3 -I./ -DBOOST_PYTHON_MAX_ARITY=19 -DBOOST_PYTHON_NO_PY_SIGNATURES -I/home/jstpierre/python-ogre/python-ogre/generated/ogrebulletd_r2684 -D_PRECOMP -fno-inline -I/home/jstpierre/python-ogre/root/usr/include -L/home/jstpierre/python-ogre/root/usr/lib -fPIC -I/home/jstpierre/python-ogre/root/usr/include/boost -I/home/jstpierre/python-ogre/bullet-2.75/src -IThirdParty/ogrebullet/Collisions -IThirdParty/ogrebullet/Dynamics -I/home/jstpierre/python-ogre/bullet-2.75/src/BulletCollision -I/home/jstpierre/python-ogre/root/usr/include/OGRE -I/home/jstpierre/python-ogre/root/usr/include/OGRE -I/home/jstpierre/python-ogre/bullet-2.75/Extras/ConvexDecomposition -I/usr/include/python2.6 -Ibuild_dir_2.6/ogrebulletd_r2684/None -Igenerated/ogrebulletd_r2684/None generated/ogrebulletd_r2684/OgreBulletCollisionsRay.cpp
generated/ogrebulletd_r2684/OgreBulletCollisionsMultiSphereShape.cpp: In constructor ‘OgreBulletCollisions::MultiSphereCollisionShape::MultiSphereCollisionShape(const Ogre::Vector3&, const Ogre::Vector3*, const Ogre::Real*, int)’:
generated/ogrebulletd_r2684/OgreBulletCollisionsMultiSphereShape.cpp:50: error: no matching function for call to ‘btMultiSphereShape::btMultiSphereShape(btVector3, btVector3*, const btScalar*, int&)’
/home/jstpierre/python-ogre/bullet-2.75/src/BulletCollision/CollisionShapes/btMultiSphereShape.h:33: note: candidates are: btMultiSphereShape::btMultiSphereShape(const btVector3*, const btScalar*, int)
/home/jstpierre/python-ogre/bullet-2.75/src/BulletCollision/CollisionShapes/btMultiSphereShape.h:27: note: btMultiSphereShape::btMultiSphereShape(const btMultiSphereShape&)
scons: *** [build_dir_2.6/ogrebulletd_r2684/OgreBulletCollisionsMultiSphereShape.os] Error 1
generated/ogrebulletd_r2684/OgreBulletCollisionsRay.cpp: In member function ‘bool OgreBulletCollisions::CollisionRayResultCallback::doesCollide() const’:
generated/ogrebulletd_r2684/OgreBulletCollisionsRay.cpp:76: error: ‘struct btCollisionWorld::RayResultCallback’ has no member named ‘HasHit’
scons: *** [build_dir_2.6/ogrebulletd_r2684/OgreBulletCollisionsRay.os] Error 1
scons: building terminated because of errors.
PythonOgre.BuildModule: WARNING Task Failed

dermont

30-11-2009 17:56:31

Not sure, but from your first error it looks as if your ThirdParty/ogrebullet is out of sync, the member named ‘HasHit’ should be 'hasHit' which was changed some time back:

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

I would try cd to ThirdParty/ogrebullet and svn update / and or removing the ogrebullet*_cache.xml from code_generators/cache and regenerating the py++ source.

magcius

30-11-2009 20:04:18

Okay. And what about the dynamics stuff? Try the same trick?

EDIT: scratch that. Now I have the same error in Collisions as Dynamics:


g++ -o build_dir_2.6/ogrebulletc_r2684/OgreBulletCollisionsObjectState.os -c `pkg-config --cflags OGRE` -I -O3 -I./ -DBOOST_PYTHON_MAX_ARITY=19 -DBOOST_PYTHON_NO_PY_SIGNATURES -I/home/jstpierre/python-ogre/python-ogre/generated/ogrebulletc_r2684 -D_PRECOMP -fno-inline -I/home/jstpierre/python-ogre/root/usr/include -L/home/jstpierre/python-ogre/root/usr/lib -fPIC -I/home/jstpierre/python-ogre/root/usr/include/boost -I/home/jstpierre/python-ogre/bullet-2.75/src -I/home/jstpierre/python-ogre/bullet-2.75/src/BulletCollision -IThirdParty/ogrebullet/Collisions -I/home/jstpierre/python-ogre/root/usr/include/OGRE -I/home/jstpierre/python-ogre/root/usr/include/OGRE -I/home/jstpierre/python-ogre/bullet-2.75/Extras/ConvexDecomposition -I/usr/include/python2.6 -Ibuild_dir_2.6/ogrebulletc_r2684/None -Igenerated/ogrebulletc_r2684/None generated/ogrebulletc_r2684/OgreBulletCollisionsObjectState.cpp
generated/ogrebulletc_r2684/OgreBulletCollisionsMultiSphereShape.cpp: In constructor ‘OgreBulletCollisions::MultiSphereCollisionShape::MultiSphereCollisionShape(const Ogre::Vector3&, const Ogre::Vector3*, const Ogre::Real*, int)’:
generated/ogrebulletc_r2684/OgreBulletCollisionsMultiSphereShape.cpp:50: error: no matching function for call to ‘btMultiSphereShape::btMultiSphereShape(btVector3, btVector3*, const btScalar*, int&)’
/home/jstpierre/python-ogre/bullet-2.75/src/BulletCollision/CollisionShapes/btMultiSphereShape.h:33: note: candidates are: btMultiSphereShape::btMultiSphereShape(const btVector3*, const btScalar*, int)
/home/jstpierre/python-ogre/bullet-2.75/src/BulletCollision/CollisionShapes/btMultiSphereShape.h:27: note: btMultiSphereShape::btMultiSphereShape(const btMultiSphereShape&)


EDIT2: Is OgreBullet even maintained anymore? See this thread for the fix: viewtopic.php?f=12&t=10994

I'm regenerating now. I'll tell you if I run into any more errors.

dermont

30-11-2009 20:52:37

Unless I'm mistaken the update that you linked to should already be in the python-ogre repository.
http://python-ogre.svn.sourceforge.net/ ... iew=markup

It still looks as if there is a mismatch between your ThirdParty/ogrebullet and the python-ogre repository.

magcius

30-11-2009 22:08:19

hm, I checked out from trunk, but it didn't have that.

I just finished making BtOgre bindings, so if you want those, I'll be glad to give you the source.

EDIT: okay, for some g*ddamned reason, the .cpp and .h files in generated/ogrebulletc_r2684/ are different than those in ThirdParty/OgreBullet

dermont

01-12-2009 05:45:39

hm, I checked out from trunk, but it didn't have that.

I just finished making BtOgre bindings, so if you want those, I'll be glad to give you the source.

You can submit your bindings to the source forge tracker or maybe contact Andy, the python-ogre developer, if you are unable to submit a patch there.
http://groups.google.com/group/python-o ... 9351987ac0



EDIT: okay, for some g*ddamned reason, the .cpp and .h files in generated/ogrebulletc_r2684/ are different than those in ThirdParty/OgreBullet


If I were you I would clear out the generated/ogrebulletc/d_r2684 generated source and regenerate both the modules. They both build here, I'm building manually.

I don't know exactly how the build systems handles ogrebullet but you may need to add a path to your extra libs or copy across the Extras/ConvexDecomposition/libConvexDecomposition.a(or .so) and Extras/GIMPACTUtils/libGIMPACTUtils.a(or .so) to your lib directory. You may also need to update environment.py with the correct library names, e.g for bullet built dynamically (yours is static so you will have to change the names):

class ogrebulletc(pymodule):
version = "r2684"
parent = "ogre/physics"
if isWindows():
libs = [boost.lib, 'OgreMain',
'LibBulletCollision', 'LibBulletDynamics', 'LibBulletMultiThreaded',
'LibBulletSoftBody', 'libconvexdecomposition','libbulletmath'
]
else:
libs = [boost.lib, 'OgreMain',
'BulletCollision', 'BulletDynamics',
'BulletSoftBody', 'ConvexDecomposition', 'GIMPACTUtils','LinearMath'
]

magcius

01-12-2009 20:09:20

Yeah, I've tried removing the ogrebullet_r2864 dir and the cache file and regenerating, but that's not the problem. It's the .cpp and .h files that are copied into that dir.

I'm not sure why, but the files in that dir always end up being an old version. Does common_utils.copyTree take the SVN version into account and use that? I fixed it by copying the .cpp and .h files from ThirdParty/ogrebullet why it's copying over that.

Also, what are libconvexdecomposition and GIMPACT?

I'll try and send along the BtOgre bindings soon, as soon as I get access to my own computer.

I wish it was easier to build too, right now it takes forever and is completely broken (have to change various things in the build scripts to get it to build on Linux). With those considerations in mind I'd love to use Python-OGRE, I have a framework sort of built up for it right now. I'm coming from Panda3D which is quite slow. It also doesn't wrap Bullet, which is why I moved to Python-OGRE, but the OgreBullet bindings are old too, so meh. Are there any other good open-source physics engines? ODE is really bad for trimesh collisions and was hard to get dynamics working correctly.

Enrico

02-12-2009 07:36:12

I wish it was easier to build too, right now it takes forever and is completely broken (have to change various things in the build scripts to get it to build on Linux)
Can you describe these changes please, so we can improve the build system?


Thanks,
Enrico

dermont

02-12-2009 15:28:27

Yeah, I've tried removing the ogrebullet_r2864 dir and the cache file and regenerating, but that's not the problem. It's the .cpp and .h files that are copied into that dir.

I'm not sure why, but the files in that dir always end up being an old version. Does common_utils.copyTree take the SVN version into account and use that? I fixed it by copying the .cpp and .h files from ThirdParty/ogrebullet why it's copying over that.

Not that I know of, I'm not too sure what is the recommended python-ogre revision check-out for Linux is, or how the build system handles it. You should check with the developers. If this is how it works it wouldn't make sense to me, trunk should be trunk and build against only the latest trunk versions of libraries. Saying that the developer has to accommodate users who only contribution is to whinge that python-ogre doesn't build against earlier versions of Ogre.


Also, what are libconvexdecomposition and GIMPACT?

Look at the user manual bullet-2.75/Bullet_User_Manual.pdf, you may not need libGIMPACTUtils if you don't encounter link/import problems.



I wish it was easier to build too, right now it takes forever and is completely broken (have to change various things in the build scripts to get it to build on Linux). With those considerations in mind I'd love to use Python-OGRE, I have a framework sort of built up for it right now.

It's always been like this, the Linux build has always lagged. There is only one developer and his main platform build is Windows. I'm sure once he gets round to Linux things will improve. I'm sure he would appreciate any input you have to offer at:
http://groups.google.com/group/python-ogre-developers



I'm coming from Panda3D which is quite slow. It also doesn't wrap Bullet, which is why I moved to Python-OGRE, but the OgreBullet bindings are old too, so meh.

If Bullet and Panda3D is your main concern you could build bullet without depending on the Ogre libs by updating your environment.py and the SConstruct file:
if os.sys.platform <> 'darwin':
CCFLAGS = ' `pkg-config --cflags OGRE` ' ## needs to change I think :)


Are there any other good open-source physics engines? ODE is really bad for trimesh collisions and was hard to get dynamics working correctly.


For python-ogre this was the status of the physics engines last time I checked (which was some time ago):
ode - doesn't build on Linux.
bullet - you know.
OgreOde/OgreBullet -builds (C++ no longer appear to be actively maintained).
Physx - builds but not usable on Linux.
NxOgre - C++ library doesn't build on Linux.
Physx - builds but unusable.
OgreNewt(2) - you should maybe check this out if you are happy with it's license.

andy

03-12-2009 11:33:57

I got around to doing some Linux work so grab the latest SVN and have a go as bullet, OgreBullet and OgreNewt2 modules build and test OK on Linux..

Andy

dermont

04-12-2009 18:50:52

@andy,

I'm not too sure about your comments in the svn log and the cegui 0.7.1 module seg faulting on Linux. The updated demos appear to run but crashes may occur using due to missing attributes (I'm using the old data files which may explain that). I don't appear to have "libCEGUIBase.so.1" on my system, shouldn't __init__.py contain something like:

#ctypes.CDLL("libCEGUIBase.so.1", ctypes.RTLD_GLOBAL)
ctypes.CDLL("libCEGUIBase-0.7.1.so", ctypes.RTLD_GLOBAL)

andy

05-12-2009 00:28:27

@dermont -- many thanks for the tip as I'd completely forgotten about the loading in __init__ -- AND I had an older CEGUI base library floating around .. Seems to be OK now...

Andy

magcius

05-12-2009 15:31:36

@andy, once I'm back on my main computer, I'll send you my BtOgre stuff, or you can add it yourself, it's not that hard. :P

My room is finished painting, so I'm hooking up the electric stuff (got new plugs, this is an old condo).

After that, I'll have my main machine back.

Thanks for all your work, I'm really impressed by Python-OGRE (it's so much faster than Panda3D). Py++ is also really impressive.

All in all, what I would really like is a standard ./configure to enable/disable modules and a one-line build, instead of having to check every 5 minutes so I can enter the next step.

dermont

05-12-2009 17:40:06


All in all, what I would really like is a standard ./configure to enable/disable modules and a one-line build, instead of having to check every 5 minutes so I can enter the next step.


You can build python-ogre as you please, the build system is pretty versatile. If you plan to build the C++ libraries installed in standard locations, and already have the dependencies installed, you can create PythonOgreConfig_magicus.py and set your paths there ( you will still have to apply the patches in patch/* in particular ogre1.6.4).

>> cd code_generators/ogre
>> python generate_code.py
>> cd ../..
>> scons PROJECTS=ogre

If you have the C++ libraries installed in non-standard paths you may need to update your PythonOgreConfig_magicus.py/ environment.py to include RPATH and/or ORIGIN and set your PKG_CONFIG_PATH, take a look at the PythonOgreConfig_posix.py for an example.

magcius

05-12-2009 19:30:15


g++ -o build_dir_2.6/ogrebulletd_r2684/OgreBulletCollisionsObjectState.os -c `pkg-config --cflags OGRE` -I -O3 -I./ -DBOOST_PYTHON_MAX_ARITY=19 -DBOOST_PYTHON_NO_PY_SIGNATURES -I/home/jstpierre/python-ogre/python-ogre/generated/ogrebulletd_r2684 -D_PRECOMP -fno-inline -I/home/jstpierre/python-ogre/root/usr/include -L/home/jstpierre/python-ogre/root/usr/lib -fPIC -I/home/jstpierre/python-ogre/root/usr/include/boost -I/home/jstpierre/python-ogre/bullet-2.75/src -IThirdParty/ogrebullet/Collisions -IThirdParty/ogrebullet/Dynamics -I/home/jstpierre/python-ogre/bullet-2.75/src/BulletCollision -I/home/jstpierre/python-ogre/root/usr/include/OGRE -I/home/jstpierre/python-ogre/root/usr/include/OGRE -I/home/jstpierre/python-ogre/bullet-2.75/Extras/ConvexDecomposition -I/usr/include/python2.6 -Ibuild_dir_2.6/ogrebulletd_r2684/None -Igenerated/ogrebulletd_r2684/None generated/ogrebulletd_r2684/OgreBulletCollisionsObjectState.cpp
generated/ogrebulletd_r2684/OgreBulletCollisionsMultiSphereShape.cpp: In constructor ‘OgreBulletCollisions::MultiSphereCollisionShape::MultiSphereCollisionShape(const Ogre::Vector3&, const Ogre::Vector3*, const Ogre::Real*, int)’:
generated/ogrebulletd_r2684/OgreBulletCollisionsMultiSphereShape.cpp:50: error: no matching function for call to ‘btMultiSphereShape::btMultiSphereShape(btVector3, btVector3*, const btScalar*, int&)’
/home/jstpierre/python-ogre/bullet-2.75/src/BulletCollision/CollisionShapes/btMultiSphereShape.h:33: note: candidates are: btMultiSphereShape::btMultiSphereShape(const btVector3*, const btScalar*, int)
/home/jstpierre/python-ogre/bullet-2.75/src/BulletCollision/CollisionShapes/btMultiSphereShape.h:27: note: btMultiSphereShape::btMultiSphereShape(const btMultiSphereShape&)
scons: *** [build_dir_2.6/ogrebulletd_r2684/OgreBulletCollisionsMultiSphereShape.os] Error 1
scons: building terminated because of errors.
PythonOgre.BuildModule: WARNING Task Failed


The files in generated/ogrebulletd_r2684 are NOT the same as the files in ThirdParty/ogrebulletd. Copying over the files manually fixes the problem, but this is a pain.

This is outrageous. What the did it copy from?

andy

06-12-2009 00:32:41

What system etc are you running on ?? And could you do a build (before fixing the missing files) and send through the files that are in the generated directory -- then do a diff on the ones in Thirdparty to see what is going on..

Andy

magcius

13-12-2009 14:32:04

Yeah, the problem is that I had a "src" directory with old stuff in it. Not sure how that got there.

Also, why aren't ghost objects and the kinematic character controller in the bindings?

andy

13-12-2009 22:28:47

Ghost Objects etc?? Can you be a bit more specific -- which binding are you talking about (Ogre?) as I'm not aware that I'm specifically excluding anything..

Andy

dermont

14-12-2009 06:01:15

Ghost Objects etc?? Can you be a bit more specific -- which binding are you talking about (Ogre?) as I'm not aware that I'm specifically excluding anything..

Andy

I think they are referring to the bullet bindings, specifically BulletDynamics/Character/btKinematicCharacterController.h and BulletCollision/CollisionDispatch/btGhostObject.h.

It appears it's just a case of adding the above to python_bullet.h / customization_data.h:

--- customization_data.py (revision 1052)
+++ customization_data.py (working copy)
@@ -3,9 +3,12 @@
ret= [ 'btBulletDynamicsCommon.h'
,'btBulletCollisionCommon.h'
,'LinearMath/btStackAlloc.h'
- ,'LinearMath/btPoolAllocator.h'
- ,'BulletCollision/CollisionDispatch/btSimulationIslandManager.h'
- ,'BulletDynamics/Character/btCharacterControllerInterface.h'
+ ,'LinearMath/btPoolAllocator.h'
+ ,'BulletCollision/CollisionDispatch/btSimulationIslandManager.h'
+ ,'BulletCollision/CollisionDispatch/btGhostObject.h'
+ ,'BulletDynamics/Character/btCharacterControllerInterface.h'
+ ,'BulletDynamics/Character/btKinematicCharacterController.h'
+
,'BulletCollision/BroadphaseCollision/btBroadphaseInterface.h'

,'BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h'

Index: python_bullet.h
===================================================================
--- python_bullet.h (revision 1052)
+++ python_bullet.h (working copy)
@@ -5,9 +5,12 @@


#include "LinearMath/btStackAlloc.h"
-#include "LinearMath/btPoolAllocator.h"
+#include "LinearMath/btPoolAllocator.h"
+#include "BulletCollision/CollisionDispatch/btGhostObject.h"
#include "BulletCollision/CollisionDispatch/btSimulationIslandManager.h"
-#include "BulletDynamics/Character/btCharacterControllerInterface.h"
+#include "BulletDynamics/Character/btCharacterControllerInterface.h"
+#include "BulletDynamics/Character/btKinematicCharacterController.h"
+
#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"

#include "BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h"

magcius

14-12-2009 23:52:13

That did it...

Now, the btScalar typedef is not in the bindings, so none of the operator overloads that use it work.

dermont

15-12-2009 01:34:41

That did it...

Now, the btScalar typedef is not in the bindings, so none of the operator overloads that use it work.


AFAIK btScalar is just a typedef to float on bullet with single precision. You should be able do something like:

stepHeight = 0.35
m_character = bullet.btKinematicCharacterController (m_ghostObject,capsule,stepHeight)

>>> v = bullet.btVector3(1,2,3)
>>> print v.X,v.Y,v.Z
1.0 2.0 3.0
>>> v*=10.0
>>> print v.X,v.Y,v.Z
10.0 20.0 30.0
>>> print v.length2()
1400.0


But that's not what you are asking. Do you have an example of your problems with btScalar and operator overloads?

magcius

18-12-2009 01:49:19

btVector(1, 2, 3) * 3 does not work.

dermont

18-12-2009 05:19:34

btVector(1, 2, 3) * 3 does not work.

Ok I see, I think it may be just a case of updating the code generator to pick up the operators overloaded as non-member functions, something like:

def ManualInclude ( mb ):
..

#'::btVector4','::btQuaternion','::btScalar'
operators = ['::btVector3']
for op in global_ns.operators():
if op.parent._name in ['::'] and op.return_type.decl_string in operators:
print "Including Main NameSpace Operators Name %s Return Type %s" %( op._name, op.return_type.decl_string)
op.include()

I'm not too sure about this so you are probably better to wait for Andy to comment.

andy

18-12-2009 09:17:27

Dermonts patch is correct...

As it looks like the bullet library may become a primary Physics support in Python-Ogre I'll take a more detailed look at the wrapper to see what else might be missing -- and please keep sending through any issues you have so we can fix them..

Andy

dermont

18-12-2009 10:22:58

The above only covers btVector3, there are other classes.

I got fed up trying to figure out what was/wasn't missing and just included the headers as per the Dynamics/Collisions CMake files. My code gen, work in progress, is attached below (includes bullet.patch) since it may contain classes that perhaps don't need to be wrapped and obviously will increase compile times.

I can submit the patch to sourceforge if you want.

To build you need to link against libGIMPACTUtils.

andy

19-12-2009 10:32:07

Updated the SVN with Dermonts changes (thanks for this) along with a an overall 'fix' to ensure that the btVector3 setters now work
v=bullet.btVector3(1.0,2.0,3)
print v.X, v.Y, v.Z
v.X=4.55
v.setY(3)
print v.X, v.Y, v.Z


Andy

AnimusMontus

20-12-2009 06:44:30

I have read the Linux Build on the wiki and followed the instructions for building it. On step 2, BuildModule.py gives me a traceback for attribute "lib" missing from "boost". I have looked through environment.py --- search for "import subprocess" --- right below this is a commented out section of code of which should be assigning lib to boost for a linux distribution. Under Windows and Mac it does assign the lib.

dermont

21-12-2009 12:25:13

I have read the Linux Build on the wiki and followed the instructions for building it. On step 2, BuildModule.py gives me a traceback for attribute "lib" missing from "boost". I have looked through environment.py --- search for "import subprocess" --- right below this is a commented out section of code of which should be assigning lib to boost for a linux distribution. Under Windows and Mac it does assign the lib.

Not sure why it would be failing at step 2 but looking at environment.py boost.lib doesn't appear to be set anywhere. In PythonOgreConfig_posix.py you should be able to resolve this by:

##LIB_Boost = None # "libboost_python"
LIB_Boost = 'boost_python'

andy

21-12-2009 12:54:48

Sorry my fault -- I was going slightly nuts in sorting out the Mac 10.6 support and along the way commented out the code that sets the boost library in environment.py.. SVN has been fixed (I think)..

Andy

AnimusMontus

02-01-2010 22:11:59

I have installed some libraries already that were compiled from another person. These are for ogre, cegui, and mygui. Is there some way I can get the build system to recognize that they are they and skip compiling at least the ogre libs, which are causing problem in the compiling stage.

dermont

04-01-2010 01:24:36

For your problem compiling the ogre libs, check or post your build error etc on the developers forum:
http://groups.google.com/group/python-ogre-developers

stodge

05-01-2011 17:35:10

Does anyone know of any RPMs for Fedora 12?

Vi3GameHkr

08-01-2011 21:09:33

So the instructions on http://wiki.python-ogre.org/index.php/LinuxBuildV4 pretty much apply to most distributions, except in Slackware it takes a ton of time to find each and every package...

Well on Ubuntu 10.10 32-bit, I got to the last step, Ogre works, but I'm having trouble generating, compiling and installing the wrapper code:
python python-ogre/BuildModule.py -g -c ogre --usesystem
python python-ogre/BuildModule.py -g -c ois cegui --usesystem
python python-ogre/BuildModule.py -b install --usesystem


I get something like
PythonOgre.BuildModule DEBUG Traceback (most recent call last):
File "generate_code.py", line 36, in <module>
import common_utils
File "../common_utils/__init__.py", line 3, in <module>
import shared_ptr
File "../common_utils/shared_ptr.py", line 3, in <module>
from pyplusplus import messages
ImportError: No module named pyplusplus


I went back and retrieved and built pyplusplus again for good measure
python python-ogre/BuildModule.py -r pyplusplus
python python-ogre/BuildModule.py -b pyplusplus --usesystem


and I still get the same error message. Any suggestions as to how to go about fixing this? Will I have to get that package from somewhere else? Or is the package in the wrong place (where should it be?)

Vi3GameHkr

08-01-2011 21:43:09

Actually, after digging through the scripts, I figured the first step of action was to install pyplusplus myself because the BuildModule script gave me more of a headache than I was hoping for (I'm a C++ person, Python's lack of like brackets and stuff just gets me all confused) and running the setup.py script inside the pyplusplus folder that was retrieved via svn, my problem has been solved.

Thanks for the help

EDIT: I mean uhh... I guess anyone who would have tried to help had I been patient enough to wait for a reply, thanks for the help

Mohican

19-05-2011 08:01:44

I am working my way through building all modules with Ubuntu 11.04.
I have built the main stuff (Ogre, OIS), but I have difficulties with some of the Add-ons.
Could you guys give me some tips? Thanks in advance.

<< Ogre Components >>

>python python-ogre/BuildModule.py -g -v ogreterrain
>python python-ogre/BuildModule.py -c -v ogreterrain
(Note: ogreterrain compiles on rev 1098 - above that, iteratorWrapper errors that '_tree' is not part of 'std')

>python python-ogre/BuildModule.py -g -v ogrepcz
>python python-ogre/BuildModule.py -c -v ogrepcz
--ERROR--
cannot find -lPlugin_PCZSceneManager

>python python-ogre/BuildModule.py -g -v ogrertshadersystem
>python python-ogre/BuildModule.py -c -v ogrertshadersystem
--ERROR--
/home/mohican/pyogre/ogre/Components/RTShaderSystem/include/OgreShaderFFPLighting.h: In function ‘void register_FFPLighting_class()’:
/home/mohican/pyogre/ogre/Components/RTShaderSystem/include/OgreShaderFFPLighting.h:95:2: error: ‘struct Ogre::RTShader::FFPLighting::LightParams’ is protected)

<< OgreOggSound Add-on >>

>sudo apt-get install libogg-dev
>sudo apt-get install libopenal-dev
>sudo apt-get install libvorbis-dev
>python python-ogre/BuildModule.py -r ogreoggsound
>python python-ogre/BuildModule.py -b -v ogreoggsound
>ogreoggsound/cmake . -DCMAKE_INSTALL_PREFIX=/home/mohican/pyogre/root/usr
>ogreoggsound/make
>ogreoggsound/make install
>python python-ogre/BuildModule.py -g -v ogreoggsound
>python python-ogre/BuildModule.py -c -v ogreoggsound
--ERROR--
generated/ogreoggsound_1.21/OgreOggSoundRecord.pypp.cpp:89:1: instantiated from here
/home/mohican/pyogre/root/usr/include/boost/python/type_id.hpp:89:9: error: invalid use of incomplete type ‘struct ALCdevice_struct’
/usr/include/AL/alc.h:43:16: error: forward declaration of ‘struct ALCdevice_struct’
scons: *** [build_dir_2.7/ogreoggsound_1.21/OgreOggSoundRecord.pypp.os] Error 1

dermont

04-06-2011 20:46:59


>python python-ogre/BuildModule.py -g -v ogreterrain
>python python-ogre/BuildModule.py -c -v ogreterrain
(Note: ogreterrain compiles on rev 1098 - above that, iteratorWrapper errors that '_tree' is not part of 'std')

There is already a patch on the tracker to resolve this problem, see the following link:
viewtopic.php?f=3&t=14056


>python python-ogre/BuildModule.py -g -v ogrepcz
>python python-ogre/BuildModule.py -c -v ogrepcz
--ERROR--
cannot find -lPlugin_PCZSceneManager

Plugin_PCZSceneManager is not library, from memory you need to fudge this for scons using LINKFLAGS(LDFLAGS) and RPATH

igrok

19-09-2011 05:05:04


<< OgreOggSound Add-on >>

>sudo apt-get install libogg-dev
>sudo apt-get install libopenal-dev
>sudo apt-get install libvorbis-dev
>python python-ogre/BuildModule.py -r ogreoggsound
>python python-ogre/BuildModule.py -b -v ogreoggsound
>ogreoggsound/cmake . -DCMAKE_INSTALL_PREFIX=/home/mohican/pyogre/root/usr
>ogreoggsound/make
>ogreoggsound/make install
>python python-ogre/BuildModule.py -g -v ogreoggsound
>python python-ogre/BuildModule.py -c -v ogreoggsound
--ERROR--
generated/ogreoggsound_1.21/OgreOggSoundRecord.pypp.cpp:89:1: instantiated from here
/home/mohican/pyogre/root/usr/include/boost/python/type_id.hpp:89:9: error: invalid use of incomplete type ‘struct ALCdevice_struct’
/usr/include/AL/alc.h:43:16: error: forward declaration of ‘struct ALCdevice_struct’
scons: *** [build_dir_2.7/ogreoggsound_1.21/OgreOggSoundRecord.pypp.os] Error 1



I'm seeing a quite similar issue - forward declaration of ‘struct ALCdevice_struct’. I've looked through the sources mentioned, but I have to admit I'm lost. I'm using Gentoo with openal-soft-1.11.753 and boost-1.42

09-18 22:57 PythonOgre.BuildModule DEBUG
scons: warning: BuildDir() and the build_dir keyword have been deprecated;
use VariantDir() and the variant_dir keyword instead.
File "/home/eliot/python-ogre/SConstruct", line 228, in <module>
In file included from /home/eliot/root/usr/include/boost/python/instance_holder.hpp:11,
from /home/eliot/root/usr/include/boost/python/object/pointer_holder.hpp:14,
from /home/eliot/root/usr/include/boost/python/to_python_indirect.hpp:10,
from /home/eliot/root/usr/include/boost/python/converter/arg_to_python.hpp:10,
from /home/eliot/root/usr/include/boost/python/call.hpp:15,
from /home/eliot/root/usr/include/boost/python/object_core.hpp:12,
from /home/eliot/root/usr/include/boost/python/args.hpp:25,
from /home/eliot/root/usr/include/boost/python.hpp:11,
from generated/ogreoggsound_1.21/OgreOggSoundRecord.pypp.cpp:3:
/home/eliot/root/usr/include/boost/python/type_id.hpp: In function 'boost::python::type_info boost::python::type_id() [with T = ALCdevice&]':
/home/eliot/root/usr/include/boost/python/detail/signature.hpp:98: instantiated from 'static const boost::python::detail::signature_element* boost::python::detail::signature_arity<2u>::impl<Sig>::elements() [with Sig = boost::mpl::vector3<void, PyObject*, ALCdevice&>]'
/home/eliot/root/usr/include/boost/python/detail/caller.hpp:232: instantiated from 'static boost::python::detail::py_func_sig_info boost::python::detail::caller_arity<2u>::impl<F, Policies, Sig>::signature() [with F = void (*)(PyObject*, ALCdevice&), Policies = boost::python::default_call_policies, Sig = boost::mpl::vector3<void, PyObject*, ALCdevice&>]'
/home/eliot/root/usr/include/boost/python/object/py_function.hpp:48: instantiated from 'boost::python::detail::py_func_sig_info boost::python::objects::caller_py_function_impl<Caller>::signature() const [with Caller = boost::python::detail::caller<void (*)(PyObject*, ALCdevice&), boost::python::default_call_policies, boost::mpl::vector3<void, PyObject*, ALCdevice&> >]'
generated/ogreoggsound_1.21/OgreOggSoundRecord.pypp.cpp:89: instantiated from here
/home/eliot/root/usr/include/boost/python/type_id.hpp:89: error: invalid use of incomplete type 'struct ALCdevice_struct'
/usr/include/AL/alc.h:44: error: forward declaration of 'struct ALCdevice_struct'
/home/eliot/root/usr/include/boost/python/type_id.hpp: In function 'boost::python::type_info boost::python::type_id() [with T = const volatile ALCdevice_struct&]':
/home/eliot/root/usr/include/boost/python/converter/registered.hpp:87: instantiated from 'const boost::python::converter::registration& boost::python::converter::detail::registry_lookup2(T& (*)()) [with T = const volatile ALCdevice_struct]'
/home/eliot/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 = const volatile ALCdevice_struct&]'
/home/eliot/root/usr/include/boost/python/converter/registered.hpp:105: instantiated from 'const boost::python::converter::registration& boost::python::converter::detail::registered_base<const volatile ALCdevice_struct&>::converters'
/home/eliot/root/usr/include/boost/python/converter/arg_from_python.hpp:283: instantiated from 'boost::python::converter::reference_arg_from_python<T>::reference_arg_from_python(PyObject*) [with T = ALCdevice&]'
/home/eliot/root/usr/include/boost/python/arg_from_python.hpp:70: instantiated from 'boost::python::arg_from_python<T>::arg_from_python(PyObject*) [with T = ALCdevice&]'
/home/eliot/root/usr/include/boost/preprocessor/iteration/detail/local.hpp:37: instantiated from 'PyObject* boost::python::detail::caller_arity<2u>::impl<F, Policies, Sig>::operator()(PyObject*, PyObject*) [with F = void (*)(PyObject*, ALCdevice&), Policies = boost::python::default_call_policies, Sig = boost::mpl::vector3<void, PyObject*, ALCdevice&>]'
/home/eliot/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 (*)(PyObject*, ALCdevice&), boost::python::default_call_policies, boost::mpl::vector3<void, PyObject*, ALCdevice&> >]'
generated/ogreoggsound_1.21/OgreOggSoundRecord.pypp.cpp:89: instantiated from here
/home/eliot/root/usr/include/boost/python/type_id.hpp:89: error: invalid use of incomplete type 'struct ALCdevice_struct'
/usr/include/AL/alc.h:44: error: forward declaration of 'struct ALCdevice_struct'
scons: *** [build_dir_2.6/ogreoggsound_1.21/OgreOggSoundRecord.pypp.os] Error 1

dermont

19-09-2011 11:12:58


<< OgreOggSound Add-on >>

>sudo apt-get install libogg-dev
>sudo apt-get install libopenal-dev
>sudo apt-get install libvorbis-dev
>python python-ogre/BuildModule.py -r ogreoggsound
>python python-ogre/BuildModule.py -b -v ogreoggsound
>ogreoggsound/cmake . -DCMAKE_INSTALL_PREFIX=/home/mohican/pyogre/root/usr
>ogreoggsound/make
>ogreoggsound/make install
>python python-ogre/BuildModule.py -g -v ogreoggsound
>python python-ogre/BuildModule.py -c -v ogreoggsound
--ERROR--
generated/ogreoggsound_1.21/OgreOggSoundRecord.pypp.cpp:89:1: instantiated from here
/home/mohican/pyogre/root/usr/include/boost/python/type_id.hpp:89:9: error: invalid use of incomplete type ‘struct ALCdevice_struct’
/usr/include/AL/alc.h:43:16: error: forward declaration of ‘struct ALCdevice_struct’
scons: *** [build_dir_2.7/ogreoggsound_1.21/OgreOggSoundRecord.pypp.os] Error 1



I'm seeing a quite similar issue - forward declaration of ‘struct ALCdevice_struct’. I've looked through the sources mentioned, but I have to admit I'm lost. I'm using Gentoo with openal-soft-1.11.753 and boost-1.42

09-18 22:57 PythonOgre.BuildModule DEBUG
scons: warning: BuildDir() and the build_dir keyword have been deprecated;
use VariantDir() and the variant_dir keyword instead.
File "/home/eliot/python-ogre/SConstruct", line 228, in <module>
In file included from /home/eliot/root/usr/include/boost/python/instance_holder.hpp:11,
from /home/eliot/root/usr/include/boost/python/object/pointer_holder.hpp:14,
from /home/eliot/root/usr/include/boost/python/to_python_indirect.hpp:10,
from /home/eliot/root/usr/include/boost/python/converter/arg_to_python.hpp:10,
from /home/eliot/root/usr/include/boost/python/call.hpp:15,
from /home/eliot/root/usr/include/boost/python/object_core.hpp:12,
from /home/eliot/root/usr/include/boost/python/args.hpp:25,
from /home/eliot/root/usr/include/boost/python.hpp:11,
from generated/ogreoggsound_1.21/OgreOggSoundRecord.pypp.cpp:3:
/home/eliot/root/usr/include/boost/python/type_id.hpp: In function 'boost::python::type_info boost::python::type_id() [with T = ALCdevice&]':
/home/eliot/root/usr/include/boost/python/detail/signature.hpp:98: instantiated from 'static const boost::python::detail::signature_element* boost::python::detail::signature_arity<2u>::impl<Sig>::elements() [with Sig = boost::mpl::vector3<void, PyObject*, ALCdevice&>]'
/home/eliot/root/usr/include/boost/python/detail/caller.hpp:232: instantiated from 'static boost::python::detail::py_func_sig_info boost::python::detail::caller_arity<2u>::impl<F, Policies, Sig>::signature() [with F = void (*)(PyObject*, ALCdevice&), Policies = boost::python::default_call_policies, Sig = boost::mpl::vector3<void, PyObject*, ALCdevice&>]'
/home/eliot/root/usr/include/boost/python/object/py_function.hpp:48: instantiated from 'boost::python::detail::py_func_sig_info boost::python::objects::caller_py_function_impl<Caller>::signature() const [with Caller = boost::python::detail::caller<void (*)(PyObject*, ALCdevice&), boost::python::default_call_policies, boost::mpl::vector3<void, PyObject*, ALCdevice&> >]'
generated/ogreoggsound_1.21/OgreOggSoundRecord.pypp.cpp:89: instantiated from here
/home/eliot/root/usr/include/boost/python/type_id.hpp:89: error: invalid use of incomplete type 'struct ALCdevice_struct'
/usr/include/AL/alc.h:44: error: forward declaration of 'struct ALCdevice_struct'
/home/eliot/root/usr/include/boost/python/type_id.hpp: In function 'boost::python::type_info boost::python::type_id() [with T = const volatile ALCdevice_struct&]':
/home/eliot/root/usr/include/boost/python/converter/registered.hpp:87: instantiated from 'const boost::python::converter::registration& boost::python::converter::detail::registry_lookup2(T& (*)()) [with T = const volatile ALCdevice_struct]'
/home/eliot/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 = const volatile ALCdevice_struct&]'
/home/eliot/root/usr/include/boost/python/converter/registered.hpp:105: instantiated from 'const boost::python::converter::registration& boost::python::converter::detail::registered_base<const volatile ALCdevice_struct&>::converters'
/home/eliot/root/usr/include/boost/python/converter/arg_from_python.hpp:283: instantiated from 'boost::python::converter::reference_arg_from_python<T>::reference_arg_from_python(PyObject*) [with T = ALCdevice&]'
/home/eliot/root/usr/include/boost/python/arg_from_python.hpp:70: instantiated from 'boost::python::arg_from_python<T>::arg_from_python(PyObject*) [with T = ALCdevice&]'
/home/eliot/root/usr/include/boost/preprocessor/iteration/detail/local.hpp:37: instantiated from 'PyObject* boost::python::detail::caller_arity<2u>::impl<F, Policies, Sig>::operator()(PyObject*, PyObject*) [with F = void (*)(PyObject*, ALCdevice&), Policies = boost::python::default_call_policies, Sig = boost::mpl::vector3<void, PyObject*, ALCdevice&>]'
/home/eliot/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 (*)(PyObject*, ALCdevice&), boost::python::default_call_policies, boost::mpl::vector3<void, PyObject*, ALCdevice&> >]'
generated/ogreoggsound_1.21/OgreOggSoundRecord.pypp.cpp:89: instantiated from here
/home/eliot/root/usr/include/boost/python/type_id.hpp:89: error: invalid use of incomplete type 'struct ALCdevice_struct'
/usr/include/AL/alc.h:44: error: forward declaration of 'struct ALCdevice_struct'
scons: *** [build_dir_2.6/ogreoggsound_1.21/OgreOggSoundRecord.pypp.os] Error 1



From the C++ code it looks as if OgreOggSoundRecord is only implement on Windows.


#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
OgreOggSoundRecord* createRecorder();
/** Gets recording device
*/
OgreOggSoundRecord* getRecorder() { return mRecorder; }
/** Returns whether a capture device is available
*/
bool isRecordingAvailable() const;
/** Creates a recordable object
*/
#endif


Try updating the ogreoggsound/generate_code.py to exclude the above class ( code marked -->).

def ManualExclude ( mb ):
global_ns = mb.global_ns
if MAIN_NAMESPACE:
main_ns = global_ns.namespace( MAIN_NAMESPACE )
else:
main_ns = global_ns
excludes=['::OgreOggSound::WAVEHEADER'
]
-> if os.name =='posix':
-> excludes.append("::OgreOggSound::OgreOggSoundRecord")
for e in excludes:
main_ns.class_(e).exclude()

...

igrok

20-09-2011 01:01:22

I'm happy to report that dermont's patch worked wonderfully. I have filed a bug on SourceForge and posted the patch.

https://sourceforge.net/tracker/?func=d ... tid=916690

thios

20-09-2011 16:37:20

Curiously, running the demo on ubuntu 11.04 with the resulting library fails with:

Loading library libOgreOggSound
Installing plugin: OgreOggSound
MovableObjectFactory for type 'OgreOggISound' registered.
Plugin successfully installed
*****************************************
*** --- Initialising OgreOggSound --- ***
*** --- OgreOggSound v1.21 --- ***
*****************************************
*** --- OpenAL version 1.1
*** --- AVAILABLE DEVICES --- ***
*** --- PulseAudio Default
*** --- ALSA Default
*** --- No Output
*** --- Choosing: PulseAudio Default (Default device)
*** --- OpenAL Device successfully created
*** --- OpenAL Context successfully created
*** --- SUPPORTED FORMATS
*** --- Created 100 sources for simultaneous sounds
*** --- Using BOOST threads for streaming
*****************************************
*** --- OgreOggSound Initialised --- ***
*****************************************


<ogre.sound.ogreoggsound._ogreoggsound_.OgreOggStreamWavSound object at 0x2b480c0>
terminate called after throwing an instance of 'Ogre::InternalErrorException'
what(): OGRE EXCEPTION(7:InternalErrorException): Not a valid WAVE file in OgreOggStreamWavWavSound::_openImpl() at .../development/ogreoggsound/src/OgreOggStreamWavSound.cpp (line 156)
Aborted


I haven't been able to figure this out in a while now so I ended up using ogreal instead, both on linux and windows. While we're on the subject though, I thought I'd bring it up.

dermont

21-09-2011 13:29:52

Curiously, running the demo on ubuntu 11.04 with the resulting library fails with:

Loading library libOgreOggSound
Installing plugin: OgreOggSound
MovableObjectFactory for type 'OgreOggISound' registered.
Plugin successfully installed
*****************************************
*** --- Initialising OgreOggSound --- ***
*** --- OgreOggSound v1.21 --- ***
*****************************************
*** --- OpenAL version 1.1
*** --- AVAILABLE DEVICES --- ***
*** --- PulseAudio Default
*** --- ALSA Default
*** --- No Output
*** --- Choosing: PulseAudio Default (Default device)
*** --- OpenAL Device successfully created
*** --- OpenAL Context successfully created
*** --- SUPPORTED FORMATS
*** --- Created 100 sources for simultaneous sounds
*** --- Using BOOST threads for streaming
*****************************************
*** --- OgreOggSound Initialised --- ***
*****************************************


<ogre.sound.ogreoggsound._ogreoggsound_.OgreOggStreamWavSound object at 0x2b480c0>
terminate called after throwing an instance of 'Ogre::InternalErrorException'
what(): OGRE EXCEPTION(7:InternalErrorException): Not a valid WAVE file in OgreOggStreamWavWavSound::_openImpl() at .../development/ogreoggsound/src/OgreOggStreamWavSound.cpp (line 156)
Aborted


I haven't been able to figure this out in a while now so I ended up using ogreal instead, both on linux and windows. While we're on the subject though, I thought I'd bring it up.



The demo runs fine here on ubuntu 11.04 32-bit. Are you running a 64-bit machine? The only thing I can think of is a problem with endianness. Have you tried opening the roar.wav file with one of the Linux media players or examining the roar.wav header file in python and comparing against the C++ code in OgreALWavSound.cpp.


import wave as w
import struct
f = open("./media/roar.wav", "rb")
format = "<4sL4s4sLHHLLHH"
print struct.unpack(format, f.read(36))
f.close()

thios

22-09-2011 10:07:28

Yes, I'm on 64bit ubuntu...

Roar.wav plays fine on both amarok and python-ogre/ogreal.

I tried disabling the header checks in OgreOggStreamWavSound.cpp. The application launches and ogreoggsound is initialised with no error messages, but no there's still no sound.

A header dump using the ubuntu quelcom package reports:

$ qwavheaderdump roar.wav
roar.wav (118316 bytes):
riff: 'RIFF'
riff length: 118308
wave: 'WAVE'
fmt: 'fmt '
fmt length: 16
format: 1
channels: 1
sample rate: 22050
bytes/second: 44100
bytes/sample: 2
bits/sample: 16
data: 'fact'
data field should be 'data'
data length: 4
data length field should be 118272


"Fixing" it using qwavheaderdump -F roar.wave doesn't help either.

There's also another thread that deals with what seems to be the same problem, but no solution has been offered.
http://www.ogre3d.org/addonforums/viewtopic.php?f=19&t=14791

I'll try to look into it further (but any help is of course welcome).

dermont

22-09-2011 20:38:11


There's also another thread that deals with what seems to be the same problem, but no solution has been offered.
http://www.ogre3d.org/addonforums/viewtopic.php?f=19&t=14791

I'll try to look into it further (but any help is of course welcome).


I don't have a 64bit machine so probably can't really help. Since this appears to be an issue with the C++ library your best bet would be add some debugging code to examine the wave header or step through the code in debug with Visual Studio on Windows.

IchUndNichtDu

20-11-2012 12:35:03

For those who want a quickstart - perhaps to evaluate Python-Ogre before jumping in, Krešimir has been kind enough to create a binary build. See his post here
The link doesn't work