Build STK on Linux

(CMake: Add mention of IRRLICHT_INCLUDE_DIR)
Line 40: Line 40:
<code>cmake .. -DIRRLICHT_DIR=/full/path/to/irrlicht</code>
<code>cmake .. -DIRRLICHT_DIR=/full/path/to/irrlicht</code>
-
to make a debug build add '''-DCMAKE_BUILD_TYPE=Debug''' like this:
+
Note: if Irrlicht is installed system-wide, it may sometimes be necessary to also add <tt>-DIRRLICHT_INCLUDE_DIR</tt>. This would then be set to the <tt>include</tt> directory in your Irrlicht directory, eg
 +
 
 +
<code>cmake .. -DIRRLICHT_DIR=/full/path/to/irrlicht -DIRRLICHT_INCLUDE_DIR=/full/path/to/irrlicht/include</code>
 +
 
 +
to make a debug build add <tt>-DCMAKE_BUILD_TYPE=Debug</tt> like this:
<code>cmake .. -DCMAKE_BUILD_TYPE=Debug</code>
<code>cmake .. -DCMAKE_BUILD_TYPE=Debug</code>
-
Another option is to build the regular release version with its optimizations, but with debugging symbols still enabled. Replace the ''Debug'' with ''RelWithDebInfo'' for that.
+
Another option is to build the regular release version with its optimizations, but with debugging symbols still enabled. Replace the <tt>Debug</tt> with <tt>RelWithDebInfo</tt> for that.
And (optionally) to install:
And (optionally) to install:
Line 55: Line 59:
Our CMake build system is younger so we welcome success/failure stories :)
Our CMake build system is younger so we welcome success/failure stories :)
-
 
=== Autotools ===
=== Autotools ===

Revision as of 19:39, 12 June 2012

Contents

Installing dependencies

First of all, you will need a compiler and the autotools build system. When building the current SVN, you will also need cmake. Other dependencies you will need include openal, ogg, vorbis.

yum install gcc-c++ autoconf automake libogg-devel libvorbis-devel openal-soft-devel fribidi-devel subversion libcurl-devel cmake irrlicht-devel

sudo apt-get install autoconf automake build-essential cmake libogg-dev libvorbis-dev libopenal-dev libxxf86vm-dev libgl1-mesa-dev libglu1-mesa-dev libcurl4-openssl-dev libfribidi-dev

Installing Irrlicht

Start by installing Irrlicht from your repositories, if it is found there. Otherwise check out How to Install Irrlicht from the Irrlicht wiki.

The SVN repository of irrlicht may be found at https://irrlicht.svn.sourceforge.net/svnroot/irrlicht/trunk

Go in /source/Irrlicht inside that. Note that it's recommended to build Irrlicht in release mode for full performance (default is debug mode) NDEBUG=1 make

The build environment can use Irrlicht either from an installed package (e.g. in /usr/local), or directly from the source tree. CMake should automatically detect Irrlicht if it is installed in default directories (/usr, /usr/local). It is recommended not to install irrlicht to /usr or /usr/local if you build it from source. Just leave it in place, this will be cleaner. See below to help the build system find your Irrlicht.

If you have any problems with building irrlicht, please contact the irrlicht developers in their forum, since we most likely won't have the expertise to help with that.

Building SuperTuxKart

As of 0.7.3, you may use either CMake or autotools to build SuperTuxKart. In the current SVN, autotools isn't actively being maintained any more. As such, use of CMake is encouraged.

CMake

mkdir cmake_build cd cmake_build cmake .. make

or, if Irrlicht is not installed system-wide, replace the 'cmake' part with:

cmake .. -DIRRLICHT_DIR=/full/path/to/irrlicht

Note: if Irrlicht is installed system-wide, it may sometimes be necessary to also add -DIRRLICHT_INCLUDE_DIR. This would then be set to the include directory in your Irrlicht directory, eg

cmake .. -DIRRLICHT_DIR=/full/path/to/irrlicht -DIRRLICHT_INCLUDE_DIR=/full/path/to/irrlicht/include

to make a debug build add -DCMAKE_BUILD_TYPE=Debug like this:

cmake .. -DCMAKE_BUILD_TYPE=Debug

Another option is to build the regular release version with its optimizations, but with debugging symbols still enabled. Replace the Debug with RelWithDebInfo for that.

And (optionally) to install:

sudo make install

this will install in /usr/local. If you want to install somewhere else, replace the "cmake" command with something like:

cmake .. -DCMAKE_INSTALL_PREFIX=/opt/stk

Our CMake build system is younger so we welcome success/failure stories :)

Autotools

Note: This method is not actively being maintained in the current SVN. While it will often still work, the use of cmake is strongly advised.

Simply use the usual autotools build triplet : ./configure make

and optionally

sudo make install

(if you obtained the STK source code from SVN, you will first need to run ./autogen.sh)


If irrlicht is not installed system-wide, replace the './configure' part with :

./configure --with-irrlicht=/full/path/to/irrlicht

Troubleshooting

Depending on whether your irrlicht build uses internal or external libpng/libjpeg dependencies, you may need to configure STK this way :

./configure LDFLAGS="-lpng -ljpeg -lbz2"

Retrieved from "http://supertuxkart.sourceforge.net/Build_STK_on_Linux"

User Tools