Downloading and Compiling under Linux

From Arx Libertatis Wiki
Jump to navigation Jump to search

ℹ️  This page describes compiling Arx Libertatis from source under Linux and assumes some familiarity with the command-line. If you just want to play the game, it might be easier to grab a binary release or snapshot if available.

ℹ️  Please see Installing the game data under Linux regarding where and how to install the game data.
Alternatively, configure Steam to use Arx Libertatis to play Arx Fatalis.

This page documents how to compile Arx Libertatis from https://github.com/arx/ArxLibertatis under Linux or FreeBSD.
There are also instructions available for Windows and macOS

Specific instructions are given for a cleanly installed Ubuntu 12.04 amd64 system, but the procedure should be similar for other Linux distributions or FreeBSD. Please update this page if something is missing.

There is also a nice, but possibly outdated video how-to on linuxgamecast.com.

Setting Up the Build Environment

To download and compile Arx Libertatis you will need the following tools:

  • git
  • CMake 3.12 or newer
  • A C++17 compatible compiler like GCC 7.1+ or Clang 5+

Your system must have the following dependencies installed, including headers / development versions:

If both SDL 1.2 and SDL 2 are installed, arx will use SDL 2 - if you don't want this, pass -DWITH_SDL=1 to cmake.

The optional crash reporter application also needs:

If both Qt 4 and Qt 5 are installed, arx will use Qt5 - if you don't want this, pass -DWITH_QT=4 to cmake.

The dependencies listed here are for the current development version of Arx Libertatis. For older versions refer to the README.md file in the respective source distribution.

Example for apt-based systems

On an apt-based system such as Debian or Ubuntu, use:

sudo apt-get install git build-essential cmake zlib1g-dev libfreetype6-dev libopenal1 libopenal-dev mesa-common-dev libgl1-mesa-dev libboost-dev libsdl2-dev libepoxy-dev libglm-dev qtbase5-dev libcurl4-nss-dev libcppunit-dev gdb

On Ubuntu 12.04 be sure to install Boost 1.48: sudo apt-get install libboost1.48-dev

You may need to install libglew-dev instead of libepoxy-dev if the latter is not available for your Debian/Ubuntu version.

Your package manager will probably prompt you to install other packages, so just say yes to those. qt-sdk is not needed for the game to run, but without it the crash reporter will be disabled, making it harder to report errors in case of a crash. gdb is used to generate detailed crash information and is not needed at compile-time.

Dependency versions in stable Linux distros

Distro GCC CMake Boost SDL GLM libepoxy GLEW FreeType Qt CURL
(required for stable) 4.3 2.8.3 1.48 1.2.10 0.9.5.0 1.2 1.5.2 2.3.0 4.7.0 7.20
(required for dev) 7.1 3.12 1.58 1.2.10 0.9.9.7 1.2 1.5.2 2.3.0 4.7.0 7.20
Debian 10 (buster) 8.3 3.13 1.67 2.0.9 0.9.9.3 1.5.3 2.1.0 2.9.1 5.11.3 7.64
Debian 11 (bullseye) 10.2 3.18 1.74 2.0.14 0.9.9.8 1.5.5 2.1.0 2.10.4 5.15.2 7.74
Debian 12 (bookworm) 12.2 3.25 1.74 2.26.5 0.9.9.8 1.5.8 2.2.0 2.12.1 6.4.2 7.88
Ubuntu 20.04 (focal) 9.3 3.16 1.71 2.0.10 0.9.9.7 1.5.4 2.1.0 2.10.1 5.12.8 7.68
Ubuntu 22.04 (jammy) 11.2 3.22 1.74 2.0.20 0.9.9.8 1.5.10 2.2.0 2.11.1 6.2.4 7.81
Ubuntu 23.10 (mantic) 13.2 3.27 1.74 2.28.3 0.9.9.8 1.5.10 2.2.0 2.13.1 6.4.2 8.2
Ubuntu 24.04 (noble) 13.2 3.28 1.83 2.30.0 0.9.9.8 1.5.10 2.2.0 2.13.2 6.4.2 8.5
Fedora 39 13.3 3.27 1.81 2.28.5 0.9.9.8 1.5.10 2.2.0 2.13.1 6.6.2 8.2
Fedora 40 14.1 3.28 1.83 2.30.3 0.9.9.8 1.5.10 2.2.0 2.13.2 6.7.1 8.6
Fedora 41 14.1 3.28 1.83 2.30.3 1.0.1 1.5.10 2.2.0 2.13.2 6.7.1 8.8
  • Green: Fully supported
  • Yellow: Supported, but not recommended (support may be removed soon)
  • Red: Unsupported

Getting the source code

There are several methods to get the Arx Libertatis source code - choose the one that suits you best:

Downloading a released version

The easiest way to get the AL source code is to download a versioned release. This will get you a reasonably up to date copy of the source code that has been tested to work.

Cloning the repository

If you want the absolute latest version of the Arx Libertatis development code and stay up to date, you can clone the AL source code repository. Beware that this will give you the current master development branch that we are actively working on. While the code in that branch should always work, it hasn't undergone any significant testing. If you just want to play the game, consider using a released version instead.

To clone the repository, type:

git clone git://github.com/arx/ArxLibertatis.git

This creates a directory called ArxLibertatis and downloads the current source code from github.

Later if you want to update your local copy of the source code, run

git pull

The git repository does not contain raster images for the icon and logo. These will be generated from scalable versions when building Arx Libertatis, but doing so requires additional dependencies (Inkscape, ImageMagick and OptiPNG). To avoid this, you can instead get the generated images from the ArxLibertatisData repo:

git clone --depth 1 git://github.com/arx/ArxLibertatisData.git

Downloading a snapshot

Alternatively you can download the current snapshot of the source code repository as a .zip or .tar.gz file and extract that:

This will give you the same code as cloning the repository, but won't let you update it without downloading everything again.

Compiling

Preparing the build directory

First go to where you downloaded / extracted the AL source code (the directory containing the `CMakeLists.txt` file):

cd ArxLibertatis

Then create a build directory that will contain compiled files.

mkdir build
cd build

Using the data repository (git checkouts only)

Next, tell the build system where to find the ArxLibertatisData repo (you can skip this if you want to generate the data files yourself or if you are building from a release source archive):

ln -s ../../ArxLibertatisData arx-libertatis-data

Replace ../../ArxLibertatisData with the path to the ArxLibertatisData checkout. Alternatively you can pass the -DDATA_FILES=../../ArxLibertatisData option to the cmake command(s) below.

Configuring

Now you should be ready to configure and compile. Run cmake:

cmake ..

If you plan on adding code, it might be a good idea to use the developer mode instead:

cmake .. -DDEVELOPER=1

This disables the unity build to allow for faster incremental builds and also enables runtime checks and debug output in the compiled binary.

Building

And now you should be able to compile with

make -j`getconf _NPROCESSORS_ONLN`

If you run out of RAM during the build, run make without the -j flag. If that is still not enough, disable the unity build by running cmake like this:

cmake .. -DUNITY_BUILD=0

Running the executable

For a manual installation, run arx by specifying a relative path to the arx executable:

./arx

If you installed arx through the package manager of your distro, just run arx.

You will need to obtain a copy of the data files from a commercial copy of Arx, or use the demo data files. Arx Libertatis comes with a script to extract these and install the files in the correct location.

The game will automatically change all used files to lower-case on the first start. If you want to run the game with read-only data you need to do this manually.

For running arx in a debugger, see Debugging