Installing OgreBullet on Linux. Ogre1.71 + Eclipse

areay

01-07-2010 09:41:59

Hi everyone, I've had a bit of a nightmare trying to install OgreBullet on Linux but I've finally got it all working correctly so I thought I'd share.

I've been over this a bunch of times and my build environment may be a little dirty, if you have any problems with this it's likely that I've left out a step or something. Please post any errors and I'll try and help out.
Cheers
Al


Preface

I'm using Fedora 10 32-bit (3 releases old at time of writing)
having built ogre-1.71 from source
using bullet from subversion, revision #2109
using ogrebullet from subversion, revision #2928
all operations done as a standard user
I have the svn (Subversion) utilities installed
All commands run as an unprivileged user unless otherwise stated


Overview
1. get bullet from SVN
2. a) attempt to configure bullet
b) satisfy dependencies
3. a) attempt to compile bullet
b) fix-up source files
4. Install bullet
5. Run Demo
6. Install Extras and Extra's headers
7. Fix-up pkgconfig file

8. Get OgreBullet from SVN
9. Configure
10. Install

11. Setup Eclipse
12. Setup resources.cfg

13. Run the OgreBullet tutorials. yay.


Bullet

* Get bullet sources
# cd ~

# svn checkout -r HEAD http://bullet.googlecode.com/svn/trunk/ ./bullet-svn

# cd bullet-svn

# ./autogen.sh

# ccmake .

press 'c' to configure

press 't' to goto expert mode

change CMAKE_INSTALL_PATH to =/usr
change INCLUDE_INSTALL_DIR to = /usr/lib/bullet
change LIB_DESTINATION to = /usr/lib
change PKGCONFIG_INSTALL_PREFIX = /usr/lib/pkgconfig/
change INCLUDE_INSTALL_DIR = /usr/include/bullet
change BUILD_DEMOS to = YES
change BUILD_MINICL_OPENCL_DEMOS to = NO


try to satisfy all the dependencies if possible, this may mean you have to install heaps of development header files ie. (as user root)
# yum install freeglut freeglut-devel glew-devel glew libXcursor libXcursor-devel libXcomposite libXcomposite-devel libXcursor libXcursor-devel libXdamage-devel libXdamage libXfixes libXfixes-devel libXinerama-devel libXinerama libXft libXft-devel libXxf86misc-devel libXxf86misc libXv libXv-devel clthreads-devel pth pth-devel

Many of these are probably not neccessary so don't stress too much

the way to tell if the library dependency is satisfied look for lines that include "_LIB-NOTFOUND" or "_INCLUDE_PATH-NOTFOUND". I recommend opening an additional shell terminal tab and installing the packages so you can quickly tab back and forth to the ccmake screen to verify that the dependency is satisfied (using the 'c' key and making sure the afflicted line has a proper link in it after running)

press 'c' to configure
press 'g' to generate and quit

# make

* there seems to be a bug in one of the demos where they forget about linux, if you get a compilation error talking about a problem with line 59 of ./Demos/ThreadingDemo/main.cpp then you need to open that file and rip some parts out
1. remove the ifdef line from line#27
2. remove the entire section starting with "#elif defined( _WIN32)" and all lines up to and including the next "#endif"

Ugly huh.

then, as root do a

# make install


At this point you should be able to view the Bullet demos

# ./Demos/AllBulletDemos/AllBulletDemo


* extras

still as root

# cd Extras

# make all

# make install

# cd ConvexDecomposition

# cp *.h /usr/include/Bulletcollision/


* update pkgconfig file. For some reason, it's not updated by the ccmake script

# vim /usr/lib/pkgconfig/bullet.pc

change the existing "Cflaggs"-line to read like this
Cflags: -I/usr/include/BulletCollision/ -I/usr/include/BulletDynamics/ -I/usr/include/BulletSoftBody/

OgreBullet

go back to using the normal user account

* get OgreBullet from SVN
# cd ~

# svn checkout https://ogreaddons.svn.sourceforge.net/ ... grebullet/ ./ogrebullet-svn

# cd ./ogrebullet-svn

# chmod +x ./autogen.sh

# ./autogen.sh

# ./configure --prefix=/usr

# make

# make install

Eclipse

add the following dirs to your include path
/usr/include/OgreBullet/Collisions
/usr/include/OgreBullet/Dynamics

add the following libs

BulletDynamics
BulletCollision
OgreBulletDyn
OgreBulletCol
ConvexDecomposition

Resources.cfg
the 'DebugDrawer' class uses a resource manager group called "OgreBulletCollisions", this must be created by you in your ogre app's resources.cfg file

add this section at the bottom of the resources.cfg file
[OgreBulletCollisions]
FileSystem= ~/ogrebullet-svn/ogrebullet/Demos/Media

* go try the tutorial

http://www.ogre3d.org/tikiwiki/OgreBull ... =Libraries

Fish

01-07-2010 14:05:36


Resources.cfg
the 'DebugDrawer' class uses a resource manager group called "OgreBulletCollisions", this must be created by you in your ogre app's resources.cfg file

add this section at the bottom of the resources.cfg file
[OgreBulletCollisions]
FileSystem= ~/ogrebullet-svn/ogrebullet/Demos/Media


This last little bit is no longer necessary unless you are using the Demos/Media. See SVN rev 2929. ;)

- Fish

areay

01-07-2010 23:00:17


Resources.cfg
the 'DebugDrawer' class uses a resource manager group called "OgreBulletCollisions", this must be created by you in your ogre app's resources.cfg file

add this section at the bottom of the resources.cfg file
[OgreBulletCollisions]
FileSystem= ~/ogrebullet-svn/ogrebullet/Demos/Media


This last little bit is no longer necessary unless you are using the Demos/Media. See SVN rev 2929. ;)

- Fish


Typical eh, the very next commit solves that problem :)

Fish

03-07-2010 04:20:51

It was your post and this one that spawned the fix. :)

- Fish

BohdanKornienko

04-01-2015 15:40:26

Hello guys. I have an Issue with installing OgreBullet from svn (revision 2988). I did steps with autogen and configure. When a execute command make. After a couple of minutes I got error message about compilation:

OgreBulletCollisionsRay.cpp: In member function 'OgreBulletCollisions::Object* OgreBulletCollisions::CollisionClosestRayResultCallback::getCollidedObject() const':
OgreBulletCollisionsRay.cpp:87:132: error: invalid conversion from 'const btCollisionObject*' to 'btCollisionObject*' [-fpermissive]
return mWorld->findObject(static_cast<btCollisionWorld::ClosestRayResultCallback *> (mRayResultCallback)->m_collisionObject);
^
In file included from OgreBulletCollisionsRay.cpp:33:0:
../include/OgreBulletCollisionsWorld.h:61:17: error: initializing argument 1 of 'OgreBulletCollisions::Object* OgreBulletCollisions::CollisionsWorld::findObject(btCollisionObject*) const' [-fpermissive]
Object *findObject(btCollisionObject *object) const;
^
make[3]: *** [OgreBulletCollisionsRay.lo] Error 1
make[3]: Leaving directory `/home/anonym/software/ogrebullet/Collisions/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/anonym/software/ogrebullet/Collisions'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/anonym/software/ogrebullet'
make: *** [all] Error 2


My operation system is: Linux 3.17.7-200.fc20.x86_64 #1 GNU/Linux
Distributive Fedora 20

Can you help me with it?

AlexeyKnyshev

05-01-2015 10:36:54

Try to use CMake build system

Regards, Alexey Knyshev

BohdanKornienko

15-09-2015 21:54:34

I have faced another problem when I have been trying to compile CMake Bundle for OGRE 1.9 and bullet 2.82

here is make output:

~/ak-ogrebullet/Collisions/src/Utils/OgreBulletCollisionsMeshToShapeConverter.cpp: At global scope:
~/ak-ogrebullet/Collisions/src/Utils/OgreBulletCollisionsMeshToShapeConverter.cpp:636:1: error: prototype for ‘OgreBulletCollisions::StaticMeshToShapeConverter::StaticMeshToShapeConverter(const Ogre::Entity*, const Ogre::Matrix4&)’ does not match any in class ‘OgreBulletCollisions::StaticMeshToShapeConverter’
StaticMeshToShapeConverter::StaticMeshToShapeConverter(const Ogre::Entity *entity,
^
In file included from ~/ak-ogrebullet/Collisions/src/Utils/OgreBulletCollisionsMeshToShapeConverter.cpp:32:0:
~/ak-ogrebullet/Collisions/include/Utils/OgreBulletCollisionsMeshToShapeConverter.h:94:15: error: candidates are: OgreBulletCollisions::StaticMeshToShapeConverter::StaticMeshToShapeConverter(const OgreBulletCollisions::StaticMeshToShapeConverter&)
class StaticMeshToShapeConverter : public VertexIndexToShape
^
~/ak-ogrebullet/Collisions/src/Utils/OgreBulletCollisionsMeshToShapeConverter.cpp:625:1: error: OgreBulletCollisions::StaticMeshToShapeConverter::StaticMeshToShapeConverter()
StaticMeshToShapeConverter::StaticMeshToShapeConverter()
^
In file included from ~/ak-ogrebullet/Collisions/src/Utils/OgreBulletCollisionsMeshToShapeConverter.cpp:32:0:
~/ak-ogrebullet/Collisions/include/Utils/OgreBulletCollisionsMeshToShapeConverter.h:100:17: error: OgreBulletCollisions::StaticMeshToShapeConverter::StaticMeshToShapeConverter(Ogre::Entity*, const Ogre::Matrix4&)
StaticMeshToShapeConverter(Ogre::Entity *entity,
^
~/ak-ogrebullet/Collisions/include/Utils/OgreBulletCollisionsMeshToShapeConverter.h:97:17: error: OgreBulletCollisions::StaticMeshToShapeConverter::StaticMeshToShapeConverter(Ogre::Renderable*, const Ogre::Matrix4&)
StaticMeshToShapeConverter(Ogre::Renderable *rend,


...

CMakeFiles/OgreBulletCollisions.dir/build.make:560: recipe for target 'CMakeFiles/OgreBulletCollisions.dir/Collisions/src/Utils/OgreBulletCollisionsMeshToShapeConverter.cpp.o' failed
make[2]: *** [CMakeFiles/OgreBulletCollisions.dir/Collisions/src/Utils/OgreBulletCollisionsMeshToShapeConverter.cpp.o] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/OgreBulletCollisions.dir/all' failed
make[1]: *** [CMakeFiles/OgreBulletCollisions.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2