Skip to content

Build Instructions for Linux

jcm edited this page Nov 24, 2024 · 24 revisions

Note

This page applies to the in-development new build system. For current build instructions, see here.

Table of Contents

Debian-based Build Instructions

1. Install dependencies

  • In a terminal window, install ares dependencies using apt:

    First, install build system dependencies:

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

    Compiling with clang is optional, but generally recommended:

    sudo apt install clang
    

    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 \
        libsdl2-dev \
        libpulse-dev
    

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

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

During the above generation step, you can optionally configure ares in a number of ways. See the Build Options page for a full list of configuration options.

Next, build the project:

cmake --build .

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

./rundir/bin/ares

If you want to install ares to another location, you may also optionally do so with CMake:

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

Red-Hat based (Fedora, etc.)

TODO

Other

Prerequisites

  • Git
  • CMake 3.28 or higher
  • A compiler toolchain such as clang or gcc

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

  • X11
  • libGL
  • GTK3 (gtk+-3.0)

Recommended development packages include:

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

  • OpenAL
  • AO
  • ALSA
  • PulseAudio

Optional but recommended build tools include:

  • Ninja
  • clang
  • Ccache

Configuration

First, clone the ares repository:

git clone https://github.com/ares-emulator/ares
cd ares

Building ares with clang and Ninja is recommended:

mkdir build && cd build
cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -G "Ninja Multi-Config"

The generation step will report what features are enabled and disabled according to the libraries found on your system. Next, build ares:

cmake --build .

After building, products can be found in the rundir folder. ares can be run from this location, or the rundir can be relocated. ares can also be installed:

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

For further configuration options, see the Build Options page.