Linux Troubles

yonibear

18-11-2006 15:20:47

Hi,

I'm currently trying to compile OgreOde under Linux. I want to use it in a project, but it is very important for me that all used libraries work "out of the box". Currently, compiling OgreOde would be very frustrating for a potential developer, so I need the following issues fixed because i don't want to maintain my own branch of OgreOde:

1) The Makefile.am's are outdated and do not represent the source files present in CVS. You can ask me for a fixed version, but I think someone with direct CVS access can fix them in no time.

2) The Makefile.am's refer to $(top_srcdir)/ode/ode/src/libode.a, allthough ode is not include (anymore?) in the source tree. I think its acceptable to replace this with -lode and require the user to install a current version od ODE himself.

3) The files currently rely on precompiled headers and do not compile if _PRECOMP is undefined because not all necesary headers are included. One solution would be update all the files, another to remove the #ifdef in OgreOdePrecompiledHeaders.h.
This could be a bit slow if no PCH is present, but i think a slow compile is better than an aborting compile.

ceacy

19-11-2006 20:45:51

I spent a part of my Sunday compiling the latest OgreODE CVS under Linux (Ubuntu Edgy) with Eihort. I only compiled the library and one of the demos (the SimpleScenes), since i didn't find the courage to adapt the three demos to Eihort. This is some of the changes i had to make :
In OgreOdeGeometry.cpp, replace
#include "DebugObject.h"
by
#include "DebugContact.h"

In OgreOdeJoint.cpp, add
#include "OgreOdeGeometry.h"

In OgreOdeSpace.cpp, add
#include "OgreOdePreReqs.h"

In OgreOdeStepper.cpp, add
#include "OgreOdeGeometry.h"
#include "OgreOdeBod
y.h"

In OgreOdeDebugContact.cpp, add
#include "OgreOdeCollision.h"
#include "OgreOdeWorld.h"
#include "OgreOdeGeometry.h"
#include "OgreOdeBody.h"


(i don't know why the compilation was ok under windows since those header ; i think it's because of the use of precompiled headers which contain the missing definitions (?))

Since the "Object" class was defined both in prefab/include/OgreOdePrefabObject.h and prefab/include/OgreOdeObject.h (i looked in the cvs, it's a recent change), i commented out the whole prefab/include/OgreOdeObject.h file.

I also had to remove several file entries in the Makefile.am files, and to add missing ones (if someone is interested, i can post the changes, but it's no big deal) ; and, in the samples, to replace the Dagon's InputReader system by OIS (adding the OIS dependency to configure.ac)
There is also no Makefile.am in the "loader" subdirectory ; and in the SimpleScenes demo, some filenames are written with capital letters, which caused an exception under linux (as it's case-sensitive, the files were not found). Lastly, a part of the SimpleScenes code made the application crash, so i commented it out :
void SimpleScenesApplication::createScene(void)
{
MovableObject::setDefaultQueryFlags (ANY_QUERY_MASK);
/*
// Set up shadowing
mSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_MODULATIVE);
mSceneMgr->setShadowColour(ColourValue(0.5, 0.5, 0.5));
mSceneMgr->setShadowFarDistance(30);

if (StringUtil::startsWith(mRoot->getRenderSystem()->getName(),"direct"))
mSceneMgr->setShadowTextureSettings(1024, 2);
else
mSceneMgr->setShadowTextureSettings(512, 2);
*/

(the segfault still occurs when pushing the space bar : my graphic drivers seem to have a problem with shadow techniques)

ceacy

20-11-2006 22:48:54

Also : that's not a big change, but making StepListener and JointGroup 's destructors virtual would prevent GCC to say an unpleasant warning ("<*> has virtual functions but non-virtual destructor")

tuan kuranes

29-11-2006 14:52:35

@ceacy : Can you send me a patch ?

ceacy

29-11-2006 19:02:44

I don't know how to generate patches (at least, i don't know yet) ; do you want me to send you the sources i modified ?

tuan kuranes

29-11-2006 19:50:25

I don't know how to generate patches (at least, i don't know yet) ;
It's easy and fast, and you'll have to learn that some day anyway...
Here's the magic command :
cvs -z3 diff -uN > patch.txt
do you want me to send you the sources i modified ?
If the above doesn't give you a nice txt file containing your modification, yes...

ceacy

29-11-2006 20:02:30

Amazing :)

This is the patch :
http://ceacy.free.fr/files/dependencies ... 112006.txt

tuan kuranes

30-11-2006 09:27:58

In CVS.

ceacy

04-12-2006 21:10:25

Just a minor patch, to avoid some warnings with the latest CVS :

Index: include/OgreOdeStepper.h
===================================================================
RCS file: /cvsroot/ogre/ogreaddons/ogreode/include/OgreOdeStepper.h,v
retrieving revision 1.7
diff -u -r1.7 OgreOdeStepper.h
--- include/OgreOdeStepper.h 1 Dec 2006 13:21:12 -0000 1.7
+++ include/OgreOdeStepper.h 4 Dec 2006 21:05:09 -0000
@@ -10,7 +10,7 @@
{
public:
StepMode(World *world) : _world(world){};
- ~StepMode(){};
+ virtual ~StepMode(){};

virtual void step(const Ogre::Real time) = 0;

@@ -22,7 +22,7 @@
{
public:
BasicStepMode(World *world) : StepMode(world) {};
- ~BasicStepMode(){};
+ virtual ~BasicStepMode(){};

inline void step(const Ogre::Real time){ dWorldStep(_world->getWorldID(), (dReal)time);};
};
@@ -31,7 +31,7 @@
{
public:
QuickStepMode(World *world) : StepMode(world) {};
- ~QuickStepMode(){};
+ virtual ~QuickStepMode(){};

inline void step(const Ogre::Real time){ dWorldQuickStep(_world->getWorldID(), (dReal)time);};
};
@@ -40,7 +40,7 @@
{
public:
FastStepMode(World *world, int max_iteration = 40) : StepMode(world), _max_iteration(max_iteration) {};
- ~FastStepMode(){};
+ virtual ~FastStepMode(){};

inline void step(const Ogre::Real time){ dWorldStepFast1(_world->getWorldID(), (dReal)time, _max_iteration);};
private:


(now that i know how to make patches, i love it.)

tuan kuranes

06-12-2006 14:00:14

seems ok but incomplete...

patch unexpectedly ends in middle of line


Make sure you've posted whole patch, or mail me the patch.

(now that i know how to make patches, i love it.)
Good news !
Now, you should really try to use svn or cvs for your own projects, you'll really find source versionning a very, very useful thing, even when programming alone.

hmoraldo

06-12-2006 14:36:05

Fantastic, thank you for this patch!

ceacy

06-12-2006 16:30:01

[ceacy@ceacy-work ~]$ cd /home/ceacy/Prog/lib/physics/ogreode/include
[ceacy@ceacy-work include]$ cvs -z3 diff -uN > patch.txt

This is the patch i obtained : it seems to be the same than the one i've just posted :oops:

tuan kuranes

06-12-2006 16:57:49

Ok, applied, thanks.
Maybe a bad copy&Paste, as that was appearently about a missing eol.

hmoraldo

06-12-2006 17:15:02

I think SimpleScenes.h also lacks a include for OIS.h

Best regards,