Friday, June 10, 2011

Installing and Compiling Ogre3d code with Ubuntu 11.04

I finally successfully compiled the Ogre3d example code. Hooray! It wasn't as straight forward as it should have been.

I installed the ogre libraries from the Ogre PPA. Should have been that simple, right? Not so much. I am running Ubuntu 11.04, 64bit. Most of the Ogre resources are configured for paths for Fedora/RedHat which installs everything in /usr/local/OGRE/. Ubuntu/Debian distros install ogre stuff in /usr/OGRE/. I outline below where you need to make some changes.

Here are the steps that I took

  1. Follow the steps here to install all of the prerequisites. As a note, the boost packages might not install because the dependecies are for version 1.42 but you may already have version 1.46 of the boost libraries installed.
  2. Follow the steps here and install the ogre libraries through the Ubuntu PPA. You should also be able to install the ogre-samples-media and ogre-samples-src packages
  3. Follow the instructions here to compile the base example program with CMake. I had to also install the cmake-qt-gui. There are a couple modifications that need to be made to get the instructions to work.
    1. Modify CMakeLists.txt by changing all references pointing to /usr/local/ to just /usr/. This corrects the following cmake errors
      CMAKE_BUILD_TYPE RelWithDebinfo
      CMAKE_INSTALL_PREFIX /usr/local
      OGRE_DIR OGRE_DIR-NOTFOUND
      OID_DIR OID_DIR-NOTFOUND
    2. Before running make install in the tutorial, you also must modify plugins.cfg and change all references from /usr/local/ to just /usr/. There should be 2 if I remember correctly.

If all goes well, you should get this

Hooray! Now, why was this so difficult?

No comments :

Post a Comment