Skip to content

Build Instructions for Linux

thekovic edited this page Dec 10, 2025 · 36 revisions

Table of Contents

1. Install dependencies

Note that ares currently only supports building with CMake version 3.28 or higher. Some LTS or less recent distributions may not package this version out of the box. If your distribution does not include 3.28, it should be possible to be install via either CMake's binary distribution or the dedicated Kitware apt repository.

Debian-based (Ubuntu, etc.)
  • In a terminal window, install ares dependencies using apt:

    First, install build system dependencies:

    sudo apt install build-essential cmake pkg-config curl git
    

    Compiling with clang, Ninja and Ccache is optional, but generally recommended:

    sudo apt install clang ninja-build ccache
    

    Next, install required ares dependencies:

    sudo apt install \
        libgtk-3-dev \
        libcanberra-gtk-module \
        libgl-dev
    

    Lastly, install optional dependencies (at least one audio driver is recommended):

    sudo apt install \
        libasound2-dev \
        libao-dev \
        libopenal-dev \
        libsdl3-dev \
        libpulse-dev \
        libudev-dev
    

    Installing librashader (via Open Build Service) is also recommended but not required.

Red Hat-based (Fedora, etc.)
  • In a terminal window, install ares dependencies using dnf:

    First, install required build system dependencies:

    sudo dnf install cmake pkg-config curl git
    

    Optionally, install dependencies for compiling with clang, Ninja, and Ccache. This is not required, but generally recommended:

    sudo dnf install clang ninja-build ccache
    

    Next, install required ares dependencies:

    sudo dnf install \
        libX11-devel \
        libXrandr-devel \
        mesa-libGL-devel 
    

    Next, install application toolkit dependencies. Currently, it is recommended to use GTK3:

    sudo dnf install gtk3-devel
    

    Optionally, you can use Qt6 instead. Using this toolkit with ares is currently experimental and things might be broken on your system:

    sudo dnf install qt6-qtbase-devel
    

    Lastly, install optional dependencies (at least one audio driver is recommended):

    sudo dnf install \
        openal-soft-devel \
        alsa-lib-devel \
        SDL3-devel \
        pulseaudio-libs-devel \
        libao-devel 
    

    Installing librashader (via Open Build Service) is also recommended but not required.

Other distributions
  • Building ares on other Linux distributions should not present a high degree of difficulty. The primary requirement is that OpenGL and one of ares's audio drivers is supported on the system, as well as X11. The general package requirements are as follows:

    Prerequisites

    • Git
    • CMake 3.28 or higher
    • Clang or GCC
    • pkg-config

    Optional but recommended build tools include:

    • Ninja
    • Ccache

    ares requires development versions of the following packages in order to build:

    • X11
    • libGL
    • GTK3

    Recommended development packages include:

    You may also configure with development packages for other audio drivers:

    • OpenAL
    • AO
    • ALSA
    • PulseAudio

2. Get the source code

  1. In a terminal window, navigate to a directory where you would like to build ares.
  2. Clone the ares repository and change into its directory:
git clone https://github.com/ares-emulator/ares
cd ares

3. Build ares

First, generate a build environment:

mkdir build && cd build
cmake .. -G Ninja

By default, ares will fetch slang-shaders via download when configuring with CMake; this requires internet access and for your CMake installation to have been built with SSL/TLS support. If you are building ares in an environment without network access or TLS, or if you already have slang-shaders installed on your system, you should provide -DARES_SKIP_DEPS=ON when configuring to skip fetching them.

If you are not using Ninja, you should omit -G Ninja from the cmake invocation above. If you wish to compile with clang but GCC is your default compiler, be sure to pass -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ at the configuration step.

In order to use Qt6 for ares, be sure to pass -DUSE_QT6=ON at the configuration step.

See the Build Options page for a full list of configuration options.

Next, build the project:

cmake --build .

If you are building with Makefiles (the default), you should add --parallel # to the above command, where # is the number of processor cores on your machine minus one or two, in order to build ares faster.

With ares built, you may run it from the staging directory:

./rundir/bin/ares

Note: On systems using a Wayland session, ares built with Qt6 currently requires to first define environment variable QT_QPA_PLATFORM=xcb in order to run.

If you want to install ares to another location (for example, ~/.local), you may also optionally do so with CMake:

cmake --install . --prefix </your/chosen/prefix>

For further configuration options, see the Build Options page.

Staging Directory Structure

The build staging directory uses a standard prefix structure described below. Since ares does not ship any libraries, ares can be run freely from this staging directory, and the rundir can also be relocated. It is still, however, recommended to use CMake's --install command to install ares in a particular location. Installs and staging follow CMake GNUInstallDirs conventions for directory naming.

If you wish to not install slang-shaders underneath the ares data directory, pass -DARES_BUNDLE_SHADERS=NO during build configuration.

rundir
  ├─ bin
  │   ├─ ares
  │   └─ sourcery
  └─ share
      ├─ ares
      │   ├─ Database
      │   │     ├─ Arcade.bml
      │   │     ├─ BS Memory.bml
      │   │     ├─ Famicom.bml
      │   │     ├─ MSX.bml
      │   │     ├─ MSX2.bml
      │   │     ├─ Neo Geo.bml
      │   │     ├─ Sufami Turbo.bml
      │   │     ├─ Super Famicom Boards.bml
      │   │     └─ Super Famicom.bml
      │   └─ Shaders
      │         └─ <contents of slang-shaders>
      ├─ applications
      │       └─ ares.desktop
      └─ icons
           └─ hicolor
                 └─ 256x256
                       └─ apps
                            └─ ares.png

Clone this wiki locally