How do I compile TnL?
Written by Jonas   
Monday, 27 September 2004

So, you bravely downloaded the source package or darcs repo and are eager to try compiling it. But how?


Update: These instructions will work for the current darcs versions.


I will only cover compiling on Linux.

1. Requirements 

Compiling TnL is almost as simple as compiling every other project. But before compiling, you will need to download a patched version of the Io scripting language. For instructions on downloading TnL's and Io's sources read this FAQ entry: How to download current sources and data?

 Next, please make sure you have the following packages installed:

  • SDL 1.2, including header files
  • OpenGL header files
  • OpenAL, including header files
  • libALut, including header files (the reference implementation is called freealut, sometimes included in the OpenAL package)
  • libSigC++ version 1.2, including header files (yes, this is a legacy version, but it is usually included in distros)
  • libGLEW, including header files (no longer needed, has been included in the sources)
  • autoconf, automake, gnu make, g++ and the usual suspects

If these requirements are fulfilled, you are ready to compile TnL.

2. Preparation 

We assume that you are using some directory "src" in your home directory and that you have the TnL sources in "~/src/TnL-source/". If you downloaded a tarball version, you might end up with a directory like "src/TnL-source-060203".  Just substitute accordingly.

 We also assume that the Io directory is "~/src/Io".

At this point, we should create an install directory, since you probably don't want to install into your system directories:

> cd ~/src
> mkdir TnL-install

 In order to use TnL, the TnL data files must reside in the installation directory. We assume you downloaded the darcs version to ~/src/TnL-data. Then type:

> cd TnL-install
> mkdir share
> ln -s ~/src/TnL-data/share/* share

The installation directory is where both the patched Io and the TnL binaries should end up. To compile and install Io, do the following:

> cd ~/src/Io
> make
> make install INSTALL_PREFIX=$HOME/src/TnL-install

If 'make' complains about missing dependencies during addon compilation, don't give it too much attention. Most addons aren't needed by TnL and you can ignore the warnings.

We should also create a build directory so our original build tree will not be accidently modified:

> mkdir ~/src/TnL-build

3. Compilation 

If you downloaded the darcs version of TnL, the first step of compilation is generating a configure file.

> cd ~/src/TnL-source
> autoreconf

Now we are ready to configure!

> cd ~/src/TnL-build
> ~src/TnL-source/configure \
    --prefix=$HOME/src/TnL-install \
    --with-io-dir=$HOME/src/Io

This is the absolute minimum of parameters. All the aforementioned libraries will be found using pkg-config. You should watch the configure script's output carefully. If configure can't find some library, it will tell you. You might have to pass additional parameters.

To see what real-life command line the author uses, read this FAQ entry

If you didn't get any errors, the rest is easy:

> make
> make install

and TnL will be installed into the TnL-install directory you created. As I suspect this is the step that will make the most problems, please let me know about your experiences!

Last Updated ( Wednesday, 21 November 2007 )