-
Notifications
You must be signed in to change notification settings - Fork 111
Linux Development Guide
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.
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.
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.
build-essential
libsdl-dev
libxft-dev
libopenal-dev
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
.