Skip to content

Build Instructions For BSD

jcm edited this page Dec 5, 2024 · 5 revisions

Note

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

Table of Contents

1. Install dependencies

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

    First, install build system dependencies:

    sudo pkg install cmake git pkgconf
    

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

    sudo pkg install ccache ninja
    

    Next, install required ares dependencies:

    sudo pkg install \
        gtk3 \
        libX11 \
        libXext \
        libXrandr \
        libXrender \
        libglvnd
    

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

    sudo pkg install \
        alsa-lib \
        libao \
        libudev-devd \
        librashader \
        openal-soft \
        pulseaudio \
        sdl2 \
        vulkan-loader
    

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 provide a number of configuration options. If you are not using Ninja, you should omit -G Ninja from the cmake invocation above. If you wish to compile with GCC but clang is your default compiler, be sure to pass -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ at the generation 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 provide the additional -j# argument, where # is the number of processor cores on your machine minus one or two.

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>

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