Installing XPCE Prolog in Ubuntu

One of my current coding projects at UBC right now is designing a program to help someone play the board game Clue (aka. Cluedo). I can't give away any of the implementation details because part of our grade will depend on how well our program helps us play against the other teams, but I just wanted to share how I got XPCE (the graphical user interface library for Prolog) to work under Ubuntu as it doesn't by default. I did find some help online but it took me a while to understand what this guy meant when he explained the fix. Hopefully I can clear up how to do it.

Guide to Setting Up the Perfect Karmic Desktop

Mostly for my own benefit I'm going to describe the process I go through to setup my desktop on a new install of Ubuntu 9.10 (Karmic Koala). The benefit for myself is that if anything goes horribly wrong, a reinstall becomes incredibly easy as everything I've done is written down in one place.