How to compile

This page explains how to build Lagrange in a POSIX-compatible environment. The required tools are a C11 compiler (e.g., Clang or GCC), CMake and pkg-config.

See platform-specific notes below for additional requirements.

Compiling via CLI

Step 1

Download and extract a source tarball. Please note that the GitHub/Gitea-generated tarballs do not contain the “the_Foundation” submodule; check which tarball you are getting. Alternatively, you may also clone the repository and its submodules:

git clone --recursive --branch release \

Step 2

Check that you have the dependencies installed: SDL2, OpenSSL, libpcre, zlib, libunistring. For example, on macOS this would do the trick (using Homebrew):

brew install cmake sdl2 openssl@1.1 pcre libunistring

Or on Ubuntu:

sudo apt install cmake libsdl2-dev libssl-dev libpcre3-dev \
  zlib1g-dev libunistring-dev

Step 3

Optionally, install the mpg123 decoder library for MPEG audio support. For example, the macOS Homebrew package is "mpg123" and on Ubuntu it is "libmpg123-dev".

Step 4

Create a build directory.

Step 5

In your empty build directory, run CMake:

cmake {path_of_lagrange_sources}

Step 6

Build it:

cmake --build .

Step 7

Now you can run "lagrange", "lagrange.exe", or "".

Installing to a directory

To install to "/dest/path":

cmake {path_of_lagrange_sources} -DCMAKE_INSTALL_PREFIX=/dest/path
cmake --build . --target install

This will also install an XDG .desktop file for launching the app.

Compiling on macOS

When compiling on macOS there are a couple of things to note: Homebrew's OpenSSL needs to be manually added to pkg-config's search path, and SDL requires a small patch to enable smooth trackpad momentum scrolling to work as expected.

Compiling on Windows

Windows builds require MSYS2. Cygwin should also work, although hasn't been tested.

Compiling on Raspberry Pi 2/3

You should use a version of SDL that is compiled to take advantage of the Broadcom VideoCore OpenGL ES hardware. This provides the best performance when running Lagrange in a console.

When running under X11, software rendering is the best choice and in that case the SDL from Raspbian etc. is sufficient.

The following build options are recommended on Raspberry Pi:

UI translations

Weblate has a separate working copy of the Lagrange repository. New and updated .po files have to be manually merged to the main repository.

At runtime, the app does not directly use the .po files. The Python script "" (under "po/") must be run to convert the strings into a format that gets loaded at runtime. After running "", the strings are stored in "res/lang/". When you run CMake, these will be combined with all other resources into the "resources.lgr" file.

Summarizing, the steps to update UI translations are: