Build STK on Linux
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.
- Fedora
yum install gcc-c++ autoconf automake libogg-devel libvorbis-devel openal-soft-devel fribidi-devel subversion libcurl-devel cmake irrlicht-devel
- Ubuntu
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.
- SuperTuxKart 0.7.3 should be built using Irrlicht trunk revision 3843.
- If you want to compile the current SVN of STK, you will need a recent Irrlicht trunk but NOT the very latest trunk (I recommend revision 4098).
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
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 # optional 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"
User Tools
- This page
- Other