Ubuntu jaunty

From Peragro Tempus Wiki

Jump to: navigation, search

Contents

Version 9.04

Before you start



Before you start building Peragro Tempus from source, you need to make sure that you have several development packages installed. The instructions here are tested using Ubuntu Jaunty Linux.

Please Note, this guide is for Ubuntu Jaunty though it should work as a reference guide for most Linux distro's.

Since Hardy is installed by default with minimal packages, many required packages are not installed. This command should install all necessary packages. You will also need your universe and multiverse repositories enabled. To enable these do the following:

First open a terminal. This is located in Applications ---> Accessories ---> Terminal This will open a command prompt in which you are going to be typing the following commands. Don't close it accidentally like I do all the time!

# sudo gedit /etc/apt/sources.list


Delete everything in it that you haven't added yourself (which is often everything in the file), and paste the following into the file and save it:



# If you get GPG errors with this sources.list, locate the GPG key in this file
# and run these commands (where KEY is replaced with that key)
#
# gpg --keyserver hkp://subkeys.pgp.net --recv-keys KEY
# gpg --export --armor KEY | sudo apt-key add -

deb http://us.archive.ubuntu.com/ubuntu/ jaunty main restricted
deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates main restricted
deb http://us.archive.ubuntu.com/ubuntu/ jaunty universe
deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ jaunty-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu jaunty-security main restricted
deb http://security.ubuntu.com/ubuntu jaunty-security universe
deb http://security.ubuntu.com/ubuntu jaunty-security multiverse
 
 


Now we need to double check that the gpg keys are added correctly to avoid gpg errors. Sounds scary, but worry not! All it takes is one simple command:

# gpg --keyserver hkp://subkeys.pgp.net --recv-keys 437D05B5 &&  gpg --export --armor 437D05B5 | sudo apt-key add -



After that we need to refresh our sources.list file like so:

# sudo apt-get update


Once that is completed, we can now fetch all packages that are needed using the following command:

# sudo apt-get --assume-yes install libjpeg62-dev x11proto-gl-dev autoconf jam bison flex-old automake1.9 libcurl4-openssl-dev libmng-dev libmikmod2-dev libogg-dev libvorbis-dev zlib1g-dev libpng12-dev build-essential libtool libglu1-mesa-dev libglu1-xorg-dev xserver-xorg-dev libxt-dev libopenal1 libopenal-dev subversion zlibc libttf2 libfreetype6-dev libfreetype6 libasound2-dev alsa-oss libxxf86vm-dev libxext-dev x11proto-xext-dev libboost1.37-dev libxerces-c2-dev libode0-dev swig libpcre3-dev



T

Obtain Necessary Tools

You should use the toolkit from nVidia (no matter what card you have).

A word regarding superuser access: This guide uses the sudo command in a few places as the method for gaining root access. If your distro ships without sudo then you can su root and perform the sudo actions as root in that manner then exit back to normal user to continue with the rest of the guide. The superuser access is needed only to install the Nvidia Cg libraries and to create the installation directory with the right permissions.

x86 (32 bit)

Do NOT use the following wget command unless you are on a regular 32 bit x86 processor (if you don't know what you have chances are it's what you use).

# wget http://developer.download.nvidia.com/cg/Cg_2.2/Cg-2.2_April2009_x86.tgz

Next copy the file to the systems root directory.

# sudo mv Cg-2.2_April2009_x86.tgz /

The next step is extracting it, then removing the old .gz file.

# cd /
# sudo tar -xf Cg-2.2_April2009_x86.tgz
# sudo rm Cg-2.2_April2009_x86.tgz

x86_64 (64 bit)

Do NOT use the following wget command unless you are on a 64 bit x86 processor.

# wget http://developer.download.nvidia.com/cg/Cg_2.2/Cg-2.2_April2009_x86_64.tgz

Next copy the file to the systems root directory.

# sudo mv Cg-2.2_April2009_x86_64.tgz /

The next step is extracting it, then removing the old .gz file.

# cd /
# sudo tar -xf Cg-2.2_April2009_x86_64.tgz
# sudo rm Cg-2.2_April2009_x86_64.tgz

PPC

Please note that there are no Cg libraries for PPC processors. If you are on a PPC processor it is safe to skip this step but you will possibly encounter a few graphics anomalies.


Getting Sources

T

Note: The following commands ought to be executed in some base working directory (you decide what and where). For example, if you created the directory /home/yourusername/peragro_svn as your Peragro Tempus workspace, then these commands should be executed there. The following directory structure would exist after all commands have been completed:

/home/yourusername/peragro_svn/peragro
/home/yourusername/peragro_svn/CS_latest
/home/yourusername/peragro_svn/CEL_latest
/home/yourusername/peragro_svn/CEGUI-0.7.1

I usually assign a variable to my working directory so that I can access it quickly. I usually name it $ptdir. Its simple to do, just follow along:

First we create the directory:

mkdir ~/peragro_svn

Next assign a variable name to it for quick reference later on:

export ptdir=~/peragro_svn

Get the Peragro Tempus sources.

$ cd $ptdir
$ svn co https://cyanox.nl/peragro/trunk peragro

Download CrystalSpace sources.

$ svn co https://crystal.svn.sourceforge.net/svnroot/crystal/CS/trunk CS_latest

Download Crystal Entity Layer (CEL)

$ svn co https://cel.svn.sourceforge.net/svnroot/cel/cel/trunk CEL_latest

Download CeGui sources.

$ wget -c http://prdownloads.sourceforge.net/crayzedsgui/CEGUI-0.7.1.tar.gz?download
$ tar -xf CEGUI-0.7.1.tar.gz
$ rm CEGUI-0.7.1.tar.gz

Build Instructions

Create a profile file that sets all the necessary environment variables. We'll use a simple command to automatically create the file for you. Remember you should be in the directory you created, usually peragro_svn.

Make sure you're in the correct directory by issuing the command:

cd $ptdir

Now export the variables:

echo 'export CRYSTAL=$PWD/CS_latest
export CEL=$PWD/CEL_latest
export CSCONFPATH=$PWD/CEL_latest
export CEGUI=$PWD/CEGUI-0.7.1
export LD_LIBRARY_PATH=$CEGUI/lib:\
$PWD/CS_latest/:$PWD/CEL_latest/:$LD_LIBRARY_PATH'  > profile

Then load the profile. You have to reload the profile every time you exit the console and start another one.

peragro_svn $ source profile

Build CeGui 0.7.1

peragro_svn/ $ cd $ptdir/CEGUI-0.7.1
peragro_svn/CEGUI-0.7.1 $ ./configure --prefix=$CEGUI --disable-xerces-c
peragro_svn/CEGUI-0.7.1 $ make
peragro_svn/CEGUI-0.7.1 $ make install

Build CrystalSpace

peragro_svn/CEGUI-0.7.1 $ cd $ptdir/CS_latest
peragro_svn/CS_latest $ ./configure --without-java --with-CEGUI=$CEGUI

Note: If you want to compile with optimizations for your specific processor, add the following tag to the configure command above. Be warned this may make things less stable.

--enable-cpu-specific-optimizations

Note: If you want to compile debug enabled, add the following tag to the configure command above. Be warned this may make things slower.

--enable-debug

Note: If you want to compile more quickly while utilizing multiple cores in newer multicore systems you might want to try adding the following tag.

-j3
peragro_svn/CS_latest $ jam -aq libs plugins cs-config cs-config-1.9 walktest

Build CEL

peragro_svn/CS_latest $ cd $ptdir/CEL_latest
peragro_svn/CEL_latest $ ./autogen.sh
peragro_svn/CEL_latest $ ./configure

Note: If you want to compile with optimizations for your specific processor, add the following tag to the configure command above. Be warned this may make things less stable.

--enable-cpu-specific-optimizations
peragro_svn/CEL_latest $ jam -aq libs plugins cel-config cel-config-1.9

Build Peragro Tempus

peragro_svn/CEL_latest $ cd $ptdir/peragro
peragro_svn/peragro $ ./autogen.sh
peragro_svn/peragro $ ./configure --with-CEGUI=$CEGUI
peragro_svn/peragro $ jam -q

If everything went right you should now have a fully compiled client rearing and ready to go!

Running and testing with a local server

In order to run the client simply make sure to load your profile variables in peragro_svn by running the following command from your peragro_svn directory:

$ source profile 

Then cd into the peragro directory like so (assuming you are in the peragro_svn directory):

$ cd peragro

Then to run the client run:

peragro_svn/peragro $ ./peragro

To test a local server you must launch one with:

peragro_svn/peragro $ ./peragro-server &

This will open the server in the background. Run ./peragro to launch the client then select localhost in the server list.

If client crashes try to remove the local shadercache

rm -rf $HOME/.crystalspace/shadercache/ 
Personal tools