Thursday 19 November 2009

How to install and compile Bullet Physics SDK on Ubuntu Linux



I've been wanting to improve how my simulation looks. I've also been wanting to integrate a scene graph to improve performance and physics to improve realism.

In regards to looks, I want something that is clean, simple and professional. For example, I like how the Bullet Physics SDK demos look.



I also like how the AI Sandbox looks.



To that end I decided to build from the Bullet Physics SDK sample applications.

--------------------------------------------------------------------------------

Update your list of applications.

$ sudo apt-get update

--------------------------------------------------------------------------------

Get CMake.

$ sudo apt-get cmake

--------------------------------------------------------------------------------

Get CMake to create Makefiles for you.

$ cmake -G "Unix Makefiles"
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Check size of void*
-- Check size of void* - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
OPENGL FOUND
/usr/lib/libGLU.so/usr/lib/libGL.so-lSM-lICE/usr/lib/libX11.so/usr/lib/libXext.so
CMake Error: This project requires some variables to be set,
and cmake can not find them.
Please set the following variables:
GLUT_INCLUDE_DIR (ADVANCED)
GLUT_glut_LIBRARY (ADVANCED)

-- Configuring done


My system did not have GLUT so CMake could not create Makefiles for me.

--------------------------------------------------------------------------------

Get GLUT.

$ sudo apt-get install freeglut3-dev

--------------------------------------------------------------------------------

Get CMake to create Makefiles for you.

$ cmake -G "Unix Makefiles"
OPENGL FOUND
/usr/lib/libGLU.so/usr/lib/libGL.so-lSM-lICE/usr/lib/libX11.so/usr/lib/libXext.so
GLUT FOUND
/usr/lib/libglut.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/binh/Desktop/bullet-2.75


--------------------------------------------------------------------------------

I don't know what this does but you'll need to do this step.

$ ./autogen.sh

--------------------------------------------------------------------------------

Configure your Makefiles.

$ ./configure

--------------------------------------------------------------------------------

Build Bullet Physis SDK and the Demos.

$ make

--------------------------------------------------------------------------------

Related

6 comments:

  1. Thanks for this. I think the line

    % sudo apt-get cmake

    should read

    % sudo apt-get install cmake

    Cheers, Jon

    ReplyDelete
  2. Hi Jon,

    Thanks for stopping by, leaving a comment and letting me know about the fix. Much appreciated!

    ReplyDelete
  3. There was no ./configure, and ./autogen.sh errored if I tried to execute it.

    However after cmake -G "Unix Makefiles", and then just doing make, it built 100% anyway...

    regards

    ReplyDelete
  4. Hi Rommel,

    Thanks for pointing that out, much appreciated.

    Binh

    ReplyDelete
  5. If configure.sh or autogen.ah throw errors then try running:

    sudo apt-get install automake
    sudo apt-get install libtool

    and then redoing the ./autogen.sh then ./configure.sh

    ReplyDelete