Generic linux

From Peragro Tempus Wiki

Jump to: navigation, search

Contents

Before you start



Before you start building Peragro Tempus from source, you need to make sure that you have several development packages installed. You can refer to the dependencies page for a list of things you likely need installed in order to compile everything. Once you have all of your dependencies met then its time to start compiling!

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