Skip to content

Linux Development Guide

Peter Robinson edited this page Oct 14, 2021 · 2 revisions

Introduction

This guide will show you how to build Torque2D on Linux. We offer a number of configurations in different directories. You'll need to run commands from one of the subsections below in one of these directories.

Configuration Directory
Intel/x86 32-bit Linux engine/compilers/Make-32bit/
Intel/x64 64-bit Linux engine/compilers/Make-64bit/

We suggest using the Docker build option for simplicity. It requires the fewest changes to your computer's configuration, and is the most repeatable.

How to Build in Docker

There are many different Linux distributions, and Linux developers are extremely opinionated about them. We test our builds on Ubuntu 20.04 which is a release supported through 2030. Whether you use Ubuntu or not on your personal Linux computer, we provide support for building in the supported Ubuntu environment on any Linux distribution that can use Docker. You can find instructions for setting up Docker in the official Docker documentation, or in your distribution's documentation.

In addition to Docker, you'll need make, which is fairly universally available across distributions.

Once you have both installed, it should be as straightforward to build as changing to the working directory for the appropriate configuration, then running:

make

If successful, the build system should deposit both a debug and a release binary in the root of the repository.

You will still need to install libsdl, libxft, and libopenal on the machine you intend to run the binary you're building on.

How to Build x86 or x64 Outside of Docker

First, you'll need the packages below. Their names may be different from distribution to distribution, these are the names of the relevant packages in Ubuntu.

  1. build-essential
  2. libsdl-dev
  3. libxft-dev
  4. libopenal-dev
  5. nasm

The Dockerfile in the appropriate build directory is a fairly procedural accounting of the steps needed to configure a machine to build for that configuration. If you're struggling, be sure to consult this file to see how the "official" build is set up.

Then change to the appropriate working directory (listed in the table in the Introduction) and for a debug build run:

make debug

If you wish to compile a release build run:

make release

The build system, if successful, will deposit the appropriate binaries in the root of the repository.

make will run single-threaded by default. You can suggest that it should take more processor cores to speed up the build by adding the -j argument. For instance, make -j release will run much faster than make release.

Clone this wiki locally