Oct 21, 2009

Ogre on Ubuntu

Ubuntu / Kubuntu

The following guide is for Ubuntu 8.04 and newer. For older versions please go here

Please post feedback in this thread

I will not do a lot of explaining here and will assume that you know what each command does or at least know how to look it up. This is a guide to get you up and running as fast as possible on Ubuntu.

  • Go to some directory you have write access to.

cd ~/Desktop
  • Uncomment all Ubuntu repositories in sources.list.
sudo nano /etc/apt/sources.list
  • Run apt-get update.
sudo apt-get update
  • Install necessary packages.
sudo apt-get install pkg-config build-essential autoconf automake libtool libzzip-dev libxt-dev libxxf86vm-dev \
libxrandr-dev libfreeimage-dev nvidia-cg-toolkit checkinstall libfreetype6-dev libpcre3-dev libopenexr-dev \
freeglut-dev mesa-common-dev libtiff4-dev libglademm-2.4-dev libcppunit-dev libxaw7-dev libxaw-headers libois-dev
libxaw-headers is obsolete on Ubuntu 9.04 and can be dropped from the list.
A sufficiently recent version of OIS (at least for Ogre 1.6.x) is available in the libois1 and libois-dev packages, and at least for 9.04 and beyond (older Ubuntu versions not tested).
Many of these packages may already be installed, but this list makes sure we've covered all the bases.
  • Setup OIS (Object Oriented Input System) -- note that this is potentially obsoleted if libois-dev and libois1 are present for your distro version:
wget http://downloads.sourceforge.net/wgois/ois_1.2.0.tar.gz
tar xzf ois_1.2.0.tar.gz
pushd ois
aclocal && ./bootstrap && ./configure
make && sudo make install
  • Setup CEGUI (Crazy Eddies GUI System):
wget http://downloads.sourceforge.net/crayzedsgui/CEGUI-0.6.0.tar.gz
tar xzf CEGUI-0.6.0.tar.gz
pushd CEGUI-0.6.0
aclocal && ./bootstrap && ./configure
make && sudo make install
CEGUI-0.6.2 is available and can be used instead, but depending on system configuration you may need to add '#include ' to RenderModules/directfbRenderer/directfb-renderer.cpp
  • Setup Ogre3D:
wget http://downloads.sourceforge.net/ogre/ogre-v1-6-3.tar.bz2
tar xjf ogre-v1-6-3.tar.bz2
pushd ogre
aclocal && ./bootstrap && ./configure
make && sudo make install
  • Complete installation:
sudo ldconfig
If during linking your program code, you get an error:
OGRE/GLX/OgreTimerImp.h:33:31: error: OgrePrerequisites.h: No such file or directory
Then add a '../' in the OgreTimerImp.h file so that it reads #include "../OgrePrerequisites.h" to find the file.

If it all ran fine you now have a dirty (but quick) source-compiled installation of Ogre3D, congratulations! The demos are located at /Samples/Common/bin/

If during execution you get an error such as:
(0) : fatal error C9999: *** exception during compilation ***
Cg compiler terminated due to fatal error

Then your Cg installation may be too old. Currently this appears to be the case with Ubuntu 9.04, which is providing Cg version 2.0.0015.

To get an updated version of Cg:
Visit the Nvidia download page to get the appropriate architecture: http://developer.nvidia.com/object/cg_download.html
Do not extract the archive. You want to save it as the original .tgz file.

sudo apt-get remove nvidia-cg-toolkit
cd /
sudo tar xzf path/to/Cg-X.X_DATE_ARCH.tgz

You may wish to recompile Ogre to ensure it picks up any changes in the Cg version. (cd ogre; make clean; make; sudo make install)


No comments:

Post a Comment