Build Bullet without OpenGL/GLUT?

feedbrian
Posts: 9
Joined: Thu Feb 19, 2009 12:22 am

Build Bullet without OpenGL/GLUT?

Post by feedbrian »

Hi all, I'm thinking about compiling Bullet for a platform which has no OpenGL or GLUT and no possibility of installing them. I don't need the demos or extras, just the library itself--I'm running simulations from the command line. I don't see any option in the Cmake configuration to disable OpenGL and GLUT. Is there a way to do this easily?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Build Bullet without OpenGL/GLUT?

Post by Erwin Coumans »

For example:

Code: Select all

For Windows MSVC 2008
cmake . -DBUILD_DEMOS:BOOL=OFF -DBUILD_EXTRAS:BOOL=OFF . -G "Visual Studio 9 2008"
or for generic Unix platforms
cmake . -DBUILD_DEMOS:BOOL=OFF -DBUILD_EXTRAS:BOOL=OFF . -G "Unix Makefiles"
or for Mac OSX
cmake . -DBUILD_DEMOS:BOOL=OFF -DBUILD_EXTRAS:BOOL=OFF . -G "Xcode"
Hope this helps,
Erwin
feedbrian
Posts: 9
Joined: Thu Feb 19, 2009 12:22 am

Re: Build Bullet without OpenGL/GLUT?

Post by feedbrian »

Hmm, that's basically what I had tried (from the ccmake curses interface, though). Cmake still informed me that something under src/ had a dependency on GLUT, but I got around that by removing the check for GLUT from the top-level CMakeLists.txt. Another thing I've noticed is that cmake doesn't play too well with non-GNU compilers- I tried to use IBM XLC, but cmake decided it was gcc and tried to feed it a -fPIC argument. No joy there, and I don't know enough about cmake to control its compiler detection (any guidance there?). Anyway, I got it compiled using gcc, but xlc is really preferred in my environment.

Thanks for the help!
feedbrian
Posts: 9
Joined: Thu Feb 19, 2009 12:22 am

Re: Build Bullet without OpenGL/GLUT?

Post by feedbrian »

Oh yeah, I also had to disable BulletMultiThreaded. My platform doesn't support threads at all.

In case anyone is curious, I'm working on an IBM Blue Gene supercomputer. The operating environment is very limited, but what is available runs very fast :)
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Build Bullet without OpenGL/GLUT?

Post by Erwin Coumans »

I don't know about XLC and Cmake, but Bullet supports Jam (and it includes the jam sources in jam-2.5 folder) and autotools/automake as well.
Have you tried one of those?

Apart from that, creating your own build system for the Bullet/src folder should be trivial:
1) Just recursively add all *.cpp files from the Bullet/src/BulletCollision, Bullet/src/BulletDynamics and Bullet/src/LinearMath folder, and
2) add Bullet/src to your include path

Hope this helps,
Erwin
feedbrian
Posts: 9
Joined: Thu Feb 19, 2009 12:22 am

Re: Build Bullet without OpenGL/GLUT?

Post by feedbrian »

I realized that Boost, which my code also requires, doesn't support the XL compilers. So gcc it is.

Thanks for the advice!
Brian