Kubuntu Install         How to build Ogre from source on Kubuntu 5.10

%prevogre%

Adventures in Linux

I am a Windows guy. I needed to get Ogre set up on a Linux system and so started porting our application to Linux. This is how I got to the point where the Ogre Samples ran and actual development can begin.

Install Kubuntu Linux.

I chose version Kubuntu Linux 5.10 (Breezy-Badger) based on some threads I found in the forum. I have set up SUSE a number of times in the past, but the forum members have a uniform dislike for SUSE. I am really glad I chose this distribution because it was so easy to get set up and on only 1 CD.

The Kubuntu desktop has a tool for installing packages called "Adept" (a really nice tool, once you get used to it). To run this utility select the system menu (like the Start button on Windows) and select "System"->"Package Manager (Adept)". Do this now and hit the "Fetch Updates" button and then "Commit Changes" button to get your base system up to date. This will take awhile...

Throughout this document, when I say "Install Packages" I mean to use Adept to install them (you may want to use the "filter" edit box to help you find them).

Install CVS and SVN packages

We need CVS to get various code bases from SourceForce. I use SVN locally, so I get it out of the way here. This also brings in a number of packages that we need later.

ATI Driver Install

This was, by far, the hardest part

I have an ATI 9600, so I needed to install the driver. Downloading a driver from ATI would be much too easy, I tried it and never got it to work. So I went to the OGRE forum and got help. With the help from the OGRE Forum members, I found this page.

Here is where is gets REALLY tricky, you can screw up your whole system by screwing this up (I know from experience). Here are the arcane commands:

sudo apt-get install xorg-driver-fglrx
echo fglrx | sudo tee -a /etc/modules
sudo sed -i -e 's/"ati"/"fglrx"/' /etc/X11/xorg.conf
[REBOOT]


I have absolutely no idea what this does except for the end result, a working ATI driver.

Install basic packages

This step should make life easier for the next steps.

Using “Adept” install the following:

automake1.9 make g++-4.0 g++ xlibs-static-dev libqt3-mt-dev libqt3-compat-headers qt3-apps-dev kdelibs4-dev flex kdelibs4-doc graphviz alien libsdl1.2debian libsdl1.2-dev


Note: this list may not be complete or even right, it is the stuff I installed in order to get by the KDevelop configure process. Each one brings in a bunch of others, so the list is surely not complete. Lastly, there are some you might not need as I installed stuff that I thought might solve problems and did not.

Read this guide to installing on Ubuntu. Lots of the following falls out from reading that page, including the list of stuff to install from this point.

Installing KDevelop

Download the current version from http://www.kdevelop.org. The version I got is 3.3.0.
Right click on the file and select “Extract Here”. You should now have a folder called “kdevelop-3.3.0”.
Open a terminal and navigate to this directory. And type:

./configure

If you installed the packages above, you should see (after a bunch of stuff) the line:

Good – your configure finished. Start make now

Type “make” and go for a walk. When it is done, and if there were no errors you can then type “sudo make install” and take another walk. Again if no errors happen you can type “make clean” and you are done with KDevelop install.

Install DevIL

You might be tempted to just go to the site http://openil.sourceforge.net/ and download a tarball, FOR THE LOVE OF GOD DON'T!

The currently posted tarball is old (does not support .hdr format, which I need) and, more importantly, will not build because many of the makefiles are have DOS end-of-line termination.

So… This means our first dealing with CVS on Source Forge DEEP CLEANISNG BREATH

Open a terminal and issue the following commands while crossing finger, toes, miscellaneous other body parts:

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/openil login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/openil co –P DevIL

Just hit RETURN when the first command asks for a CVS password.

With any luck whatsoever, you will be rewarded with a directory called “DevIL” with the required source code. This can take awhile, at least it did for me, around 20 minutes of waiting and wondering if the darn thing crashed.

Now we are ready to build, here are the commands for the Terminal:

./configure
make
sudo make install 
make clean


If all went well, you have installed the openil(DevIL) libraries.

Install nVidia’s cg compiler

Go here and download the .rpm file (I know, that’s for RedHat...)
Run this command line:

sudo alien Cg-1.4.0-4.i386.rpm

This creates a file that can be directly installed (.deb)

In a browser window right-click on this new file and select “Kubuntu Package Menu->Install Package”. Enter your sudo password and all is well.

Install zziplib

Go also to this page and download the source tarball (zziplib-0.10.82-1.tar.bz2). Extract it and open a terminal in the new directory. Then the typical commands:

./configure
make
sudo make install 
make clean

I have a compile error in the “make” phase, so I had to pop open an editor and fix the casting error. There is also a “make check” that will test the compile before installing; you might want to do that since I had a compile error and edited the code.

Get OGRE (Finally)

I use the CVS version of Ogre 1.0, so that is what I will describe here. I expect you could simply download the Ogre tarball and install that. The Ogre guys are good, so I fully expect that the release SDK will just work. The wiki page about building DEbain from source is a bit old, but you should be able to get most of the needed information from it.

Now it is time for another brush with the Source Forge CVS system.

The Ogre Developer’s Page is a good place to start.

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/ogre login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/ogre co -P -rv1-0 ogrenew

Once you get that to work (maybe I should say “if”, I have big trouble getting Source Forge CVS to work for me), you will have a directory called ogrenew. CD to it and we can start up the build process!

./bootstrap
./configure
make
sudo make install

The configure and make processes might throw error, but usually there is a decent clue about what is wrong. Keep plugging away and it will get done. The compile will take a looooooong time, so be patient. Maybe go for a nice walk, get some sunlight on your pasty skin, kiss a girl... [I'm getting a bit punchy]

A nicer alternative to "make install" is shown here: Checkinstall

Run a sample

You need to use the terminal to run Ogre samples.

From the ogrenew directory:

cd Samples/Common/bin
./Water

After answering the configuration questions, you should see the water demo in all its glory. :-)