Kokua:Compiling (Linux)

Introduction
This guide describes how to compile the Kokua viewer for Linux. If you have problems compiling Kokua, you can find help in the IRC channel or mailing list.

This guide assumes you have already acquired the Kokua source code.

Required Tools
You will need the following tools to compile Kokua for Linux:


 * A recent version of GCC (e.g. 3.4 or 4.3, 4.4.5, 4.6) with C++ support.
 * GNU make.
 * yacc (or compatible, e.g. bison)
 * lex (or compatible, e.g. flex)
 * bzip2
 * Python 2.5 or later. (Python 3 is untested.)
 * CMake 2.8.8 or later.
 * Development headers/packages for X11, XRender, and GLX (Mesa).
 * E.g. on Ubuntu, install libx11-dev, libxrender-dev, x11proto-gl-dev, and libgl1-mesa-dev

Prebuilt binaries for the libraries used by the viewer will be downloaded automatically. If you prefer to use the libraries already installed on your system, please see the instructions for compiling in "standalone" mode.

Generating the Makefiles
Once you have the necessary tools, create a new directory called kokua-build. This is the directory where all the compiled files will be stored, such as the Makefiles and the final compiled viewer. In a terminal window, cd to the kokua-build directory, and run (assuming the Kokua source directory is at ~/kokua):

cmake ~/kokua/indra

That will set up the directory structure and Makefiles to compile the viewer. This process may take several minutes the first time, while it automatically downloads additional libraries and artwork used by the viewer.

Advanced: Choosing a Build Type
It's also possible to use a non-default build type, by giving the "-DCMAKE_BUILD_TYPE= " flag to the cmake command. There are three possible build types:


 * RelWithDebInfo (the default) is a good balance between performance and debugging ability.
 * Debug is slower than RelWithDebInfo, but more useful for debugging.
 * Release is somewhat faster and has smaller file sizes than RelWithDebInfo, but is less useful for debugging.

As an example example, you can choose the "Debug" build type by running this command (either instead of the cmake command shown earlier, or afterwards):

cmake ~/kokua/indra -DCMAKE_BUILD_TYPE=Debug

Compiling the Viewer
Once CMake is done generating the Makefiles, you can compile the viewer by simply running this command while in the kokua-build directory:

make

If you have multiple processors (or a multi-core processor), you can compile more quickly by passing the "-j" flag to make, where  is the number of files to compile simultaneously. A good number to start with is the number of processors/cores you have, plus 1. For example, if you have 4 processors/cores, you could run:

make -j5

The compile process uses a lot of system resources, so your computer may seem sluggish while compiling. It's best not to run any other processor-intensive applications while compiling. Compiling for the first time typically takes 30-90 minutes, depending on how powerful your computer is. After the first time compiling, recompiling usually takes less than 10 minutes.

With luck, the viewer will compile successfully, with no errors. You can find the results in the kokua-build/newview/packaged directory.

If you encounter errors or have problems compiling Kokua, you can find help in the IRC channel or mailing list.