108
Building for Linux
Joshua Vandaële edited this page 2026-07-26 21:09:17 +02:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Prerequisites

Tools

  • ninja
  • cmake, version 3.25 or newer for Dolphin 2606-214 and newer.
  • C++ compiler such as gcc, with C++23 support for Dolphin 2512-116 and newer.

Required Dependencies

Tip

Jump ahead to the System-Specific Instructions section to find the installation command tailored for your Linux distribution.

Libraries will silently fall back to their vendored counterpart if they cannot be found on the system.

Dependency Vendored Version Debian / Ubuntu Fedora Arch Alpine
Kernel Headers linux-libc-dev kernel-headers linux-headers linux-headers
bzip2 libbz2-dev bzip2-devel bzip2 bzip2-dev
curl libcurl4-openssl-dev or libcurl4-gnutls-dev libcurl-devel curl curl-dev
enet >=1.3.18 libenet-dev enet-devel enet enet-dev
fmt >=10.1 libfmt-dev fmt-devel fmt fmt-dev
glslang >=15.0 glslang-tools glslang-dev glslang-devel glslang glslang-dev spirv-tools-dev
hidapi libhidapi-dev hidapi-devel hidapi hidapi-dev
iconv >=1.14 Built-in Built-in libiconv Built-in
libusb libusb-1.0-0-dev libusb1-devel libusb libusb-dev
lz4 >=1.8 liblz4-dev lz4-devel lz4 lz4-dev
lzma liblzma-dev xz-devel xz xz-dev
lzo liblzo2-dev lzo-devel lzo lzo-dev
mbedtls >=2.0, <=3.0 libmbedtls-dev MbedTLS 2.x is no longer shipped from Debian Trixie forward and Ubuntu 25.04 forward. mbedtls-devel MbedTLS 2.x is no longer shipped from Fedora 42 forward. mbedtls2 MbedTLS 2.x is no longer shipped as of 28/06/2026 mbedtls2-dev
minizip-ng >=4.0.4 libminizip-ng-dev In testing on Debian minizip-ng-devel minizip-ng minizip-ng-dev
pugixml libpugixml-dev pugixml-devel pugixml pugixml-dev
SFML >=3.0 libsfml-dev Version 3.x currently not available on Debian. SFML-devel Version 3.x currently not available sfml sfml-dev Version 3.x Currently not available
spng libspng-dev libspng-devel libspng libspng-dev
xxhash >=0.8.2 libxxhash-dev xxhash-devel xxhash xxhash-dev
zstd >=1.4.0 libzstd-dev libzstd-devel zstd zstd-dev
zlib >=1.3.1 zlib1g-dev zlib-devel zlib-ng zlib-dev

Optional Dependencies

Dependency Vendored Version CMake option Debian / Ubuntu Fedora Arch Alpine
ALSA ENABLE_ALSA libasound2-dev alsa-lib-devel alsa-lib alsa-lib-dev
BlueZ ENABLE_BLUEZ libbluetooth-dev bluez-libs-devel bluez-libs bluez-dev
cubeb ENABLE_CUBEB libcubeb-dev cubeb-devel Not in the repos. AUR: cubeb OR cubeb-git Not in the repos
egl ENABLE_EGL libegl1-mesa-dev mesa-libEGL-devel libglvnd mesa-egl
FFmpeg ENCODE_FRAMEDUMPS libavcodec-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev libavcodec-free-devel libavformat-free-devel libavutil-free-devel libswresample-free-devel libswscale-free-devel ffmpeg ffmpeg-dev
gettext Only optional if not present. gettext gettext gettext gettext
gtest ENABLE_TESTS libgtest-dev gtest-devel gtest gtest-dev
libevdev ENABLE_EVDEV libevdev-dev libevdev-devel libevdev libevdev-dev
libudev ENABLE_HWDB and ENABLE_EVDEV libudev-dev or libeudev-dev systemd-devel systemd-libs eudev-dev
LLVM ENABLE_LLVM llvm-dev llvm-devel llvm llvm-dev Broken packaging
mgba USE_MGBA libmgba-dev Newer MGBA versions are currently broken with Dolphin. Not in the repos libmgba Newer MGBA versions are currently broken with Dolphin. libmgba-dev Newer MGBA versions are currently broken with Dolphin.
miniupnpc >=1.6 USE_UPNP libminiupnpc-dev miniupnpc-devel miniupnpc miniupnpc-dev
OpenGL Only optional if not present. libgl1-mesa-dev mesa-libGL-devel libglvnd glfw-dev
PkgConfig Only optional if not present. pkg-config pkgconf-pkg-config pkgconf pkgconf
PulseAudio ENABLE_PULSEAUDIO libpulse-dev pulseaudio-libs-devel libpulse pulseaudio-dev
Qt6 >=6.0 ENABLE_QT qt6-base-dev qt6-base-private-dev qt6-svg-dev qt6-qtbase-devel qt6-qtbase-private-devel qt6-qtsvg-devel qt6-base qt6-svg qt6-qtbase-dev qt6-qtsvg-dev
SDL >=3.2.0 ENABLE_SDL libsdl3-dev SDL3-devel sdl3 sdl3-dev
systemd Only optional if not present. libsystemd-dev systemd-devel systemd-libs N/A
x11 ENABLE_X11 libx11-dev libxrandr-dev libxi-dev libX11-devel libXrandr-devel libXi-devel libx11 libxrandr libxi libx11-dev libxrandr-dev libxi-dev

System-Specific Instructions

Debian / Ubuntu

Ubuntu users of these versions may need alternative flags or sources to meet minimum version requirements:

25.04 and older:

  • SDL: PPA OR -DUSE_SYSTEM_SDL3=OFF
  • FMT: PPA OR -DUSE_SYSTEM_FMT=OFF
  • ENET: -DUSE_SYSTEM_ENET=OFF
  • ZLIB: -DUSE_SYSTEM_ZLIB=OFF

25.10 and older:

  • minizip-ng: -DUSE_SYSTEM_MINIZIP-NG=OFF
  • SFML: -DUSE_SYSTEM_SFML=OFF

Ubuntu CMake Flags: -DUSE_SYSTEM_MBEDTLS=OFF -DUSE_SYSTEM_LIBMGBA=OFF Debian CMake Flags: -DUSE_SYSTEM_MINIZIP-NG=OFF -DUSE_SYSTEM_SFML=OFF -DUSE_SYSTEM_MBEDTLS=OFF -DUSE_SYSTEM_LIBMGBA=OFF

Install Command
apt install \
    # PkgConfig
    pkg-config \
    # OpenGL
    libgl1-mesa-dev \
    # X11
    libx11-dev \
    libxrandr-dev \
    libxi-dev \
    # EGL
    libegl1-mesa-dev \
    # FFMPEG
    libavcodec-dev \
    libavformat-dev \
    libavutil-dev \
    libswresample-dev \
    libswscale-dev \
    # udev (Use libeudev-dev if on non-systemd)
    libudev-dev \
    # evdev
    libevdev-dev \
    # SDL
    libsdl3-dev \
    # FMT
    libfmt-dev \
    # glslang
    glslang-dev \
    glslang-tools \
    # pugixml
    libpugixml-dev \
    # enet
    libenet-dev \
    # xxhash
    libxxhash-dev \
    # bzip2
    libbz2-dev \
    # LZMA
    liblzma-dev \
    # zstd
    libzstd-dev \
    # zlib
    zlib1g-dev \
    # minizip-ng
    libminizip-ng-dev \
    # lzo
    liblzo2-dev \
    # lz4
    liblz4-dev \
    # spng
    libspng-dev \
    # cubeb
    libcubeb-dev \
    # libusb
    libusb-1.0-0-dev \
    # SFML
    libsfml-dev \
    # MiniUPNPC
    libminiupnpc-dev \
    # MbedTLS
    ## We are using an outdated 2.x version, and Debian/Ubuntu only ship 3.x now
    # cURL (this could also be libcurl4-gnutls-dev)
    libcurl4-openssl-dev \
    # hidapi
    libhidapi-dev \
    # mgba
    ## libmgba-dev \
    ## Newer MGBA versions are currently broken with Dolphin
    # systemd
    libsystemd-dev \
    # gtest
    libgtest-dev \
    # ALSA
    libasound2-dev \
    # PulseAudio
    libpulse-dev \
    # LLVM
    llvm-dev \
    # BlueZ
    libbluetooth-dev \
    # Qt6
    qt6-base-dev \
    qt6-base-private-dev \
    qt6-svg-dev \
    # Gettext
    gettext

Fedora

A simpler alternative way to install all the necessary build dependencies is with dnf builddep dolphin-emu. This command installs everything required to build Fedora's dolphin-emu package, which should be close to up-to-date.

CMake Flags: -DUSE_SYSTEM_SFML=OFF -DUSE_SYSTEM_MBEDTLS=OFF -DUSE_SYSTEM_LIBMGBA=OFF

Install Command
dnf install \
    # PkgConfig
    pkgconf-pkg-config \
    # OpenGL
    mesa-libGL-devel \
    # X11
    libX11-devel \
    libXrandr-devel \
    libXi-devel \
    # EGL
    mesa-libEGL-devel \
    # FFMPEG
    libavcodec-free-devel \
    libavformat-free-devel \
    libavutil-free-devel \
    libswresample-free-devel \
    libswscale-free-devel \
    # udev
    systemd-devel \
    # evdev
    libevdev-devel \
    # SDL
    SDL3-devel \
    # FMT
    fmt-devel \
    # glslang
    glslang-devel \
    # pugixml
    pugixml-devel \
    # enet
    enet-devel \
    # xxhash
    xxhash-devel \
    # bzip2
    bzip2-devel \
    # LZMA
    xz-devel \
    # zstd
    libzstd-devel \
    # zlib
    zlib-devel \
    # minizip-ng
    minizip-ng-devel \
    # lzo
    lzo-devel \
    # lz4
    lz4-devel \
    # spng
    libspng-devel \
    # cubeb
    cubeb-devel \
    # libusb
    libusb1-devel \
    # SFML
    ## SFML-devel \
    ## SFML 3.0 is not yet shipped on Fedora
    # MiniUPNPC
    miniupnpc-devel \
    # MbedTLS
    ## We are using an outdated 2.x version, and Fedora only ships 3.x now
    # cURL
    libcurl-devel \
    # hidapi
    hidapi-devel \
    # mgba
    ## Not in the Fedora repos
    # systemd (already installed for udev)
    # gtest
    gtest-devel \
    # ALSA
    alsa-lib-devel \
    # PulseAudio
    pulseaudio-libs-devel \
    # LLVM
    llvm-devel \
    # BlueZ
    bluez-libs-devel \
    # Qt6
    qt6-qtbase-devel \
    qt6-qtbase-private-devel \
    qt6-qtsvg-devel \
    # Gettext
    gettext

Arch

If you are not using Cubeb from the AUR, you will need to add -DUSE_SYSTEM_CUBEB=OFF to the CMake flags.

CMake Flags: -DUSE_SYSTEM_LIBMGBA=OFF

Install Command
pacman -Syu \
    # Kernel headers
    linux-headers \
    # PkgConf
    pkgconf \
    # OpenGL
    libglvnd \
    # X11
    libx11 \
    libxrandr \
    libxi \
    # EGL (Already installed with OpenGL)
    # FFMPEG
    ffmpeg \
    # udev
    systemd-libs \
    # evdev
    libevdev \
    # SDL
    sdl3 \
    # FMT
    fmt \
    # glslang
    glslang \
    # pugixml
    pugixml \
    # enet
    enet \
    # xxhash
    xxhash \
    # bzip2
    bzip2 \
    # LZMA
    xz \
    # zstd
    zstd \
    # zlib
    zlib-ng \
    # minizip-ng
    minizip-ng \
    # lzo
    lzo \
    # lz4
    lz4 \
    # spng
    libspng \
    # cubeb
    ## Currently only in the AUR as `cubeb` or `cubeb-git`
    # libusb
    libusb \
    # SFML
    sfml \
    # MiniUPNPC
    miniupnpc \
    # MbedTLS
    ## No longer part of the repos
    # cURL
    curl \
    # hidapi
    hidapi \
    # systemd (Already installed with udev)
    # gtest
    gtest \
    # ALSA
    alsa-lib \
    # PulseAudio
    libpulse \
    # LLVM
    llvm \
    # BlueZ
    bluez-libs \
    # Qt6
    qt6-base \
    qt6-svg \
    # Gettext
    gettext

See also dolphin-emu-git's dependencies

Alpine

CMake Flags: -DUSE_SYSTEM_SFML=OFF -DUSE_SYSTEM_LIBMGBA=OFF -DUSE_SYSTEM_CUBEB=OFF -DENABLE_LLVM=OFF

Install Command
apk add \
    # Kernel headers
    linux-headers \
    # PkgConfig
    pkgconf \
    # OpenGL
    glfw-dev \
    # X11
    libx11-dev \
    libxrandr-dev \
    libxi-dev \
    # EGL
    mesa-egl \
    # FFMPEG
    ffmpeg-dev \
    # udev
    eudev-dev \
    # evdev
    libevdev-dev \
    # SDL
    sdl3-dev \
    # fmt
    fmt-dev \
    # glslang
    glslang-dev \
    spirv-tools-dev \
    # pugixml
    pugixml-dev \
    # enet
    enet-dev \
    # xxhash
    xxhash-dev \
    # bzip2
    bzip2-dev \
    # LZMA
    xz-dev \
    # zstd
    zstd-dev \
    # zlib
    zlib-dev \
    # minizip-ng
    minizip-ng-dev \
    # lzo
    lzo-dev \
    # lz4
    lz4-dev \
    # spng
    libspng-dev \
    # cubeb
    ## Not available in repositories
    # libusb
    libusb-dev \
    # SFML
    ## libsfml-dev \
    ## SFML 3.0 is not yet shipped on Alpine
    # MiniUPNPC
    miniupnpc-dev \
    # MbedTLS
    mbedtls2-dev \
    # cURL
    curl-dev \
    # hidapi
    hidapi-dev \
    # mgba
    ## libmgba-dev \
    ## Newer MGBA versions are currently broken with Dolphin
    # systemd
    ## N/A
    # gtest
    gtest-dev \
    # ALSA
    alsa-lib-dev \
    # PulseAudio
    pulseaudio-dev \
    # LLVM
    ## llvm-dev \
    ## LLVM is currently badly packaged
    # BlueZ
    bluez-dev \
    # Qt6
    qt6-qtbase-dev \
    qt6-qtsvg-dev \
    # Gettext
    gettext

Chrome/Chromium OS (via Chromebrew)

Important

This is still a work in progress.

Install Command
crew install binutils wayland cmake gcc buildessential git libx11 pkg-config libxi libxext qtbase qtwayland mesa libxfixes libxxf86vm libusb libdrm libxrandr gettext linuxheaders enet libxshmfence libunwind lm_sensors elfutils patchelf vulkan_icd_loader

# Intel hardware
crew install xorg_intel_driver

# Nvidia hardware
crew install xorg_nouveau_driver

Building

If your systems default compiler is too old to support C++23, youll need to specify a newer version manually when configuring the build.

For example, on Ubuntu 20.04, you can install gcc-13 from this PPA or clang-18 from LLVM's APT repository.

After installation, use the newer compiler explicitly during configuration, like so:

cmake --preset ninja-release-x64 -DCMAKE_C_COMPILER=gcc-13 -DCMAKE_CXX_COMPILER=g++-13
# or
cmake --preset ninja-release-x64 -DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18

You may then proceed with the clone instructions in the Cloning guide and build instructions in the Building With CMake guide.

Distributable .deb Package

Following the instructions from the PR where this feature was implemented:

sudo apt install dpkg-dev file
cmake --preset ninja-release-x64 -DCPACK_PACKAGE_CONTACT="Your Name Here" # You're responsible for what you distribute.
cmake --build --preset ninja-build-release-x64
cd build/x64/
cpack -G DEB

Externally Managed Packages

Dolphin maintains official Flatpak repositories for both releases and development builds. Additionally, on some distributions of Linux, package maintainers provide unofficial, unmodified builds of Dolphin. These are listed below:

Troubleshooting

  • The compiler will normally tell you what's going on if you run into an error. Read the error messages closely and look them up verbatim to see if it's something missing on your system and/or a typo in recent Dolphin commits.
  • Need more speed? Add the -DCMAKE_CXX_FLAGS=-march=native -DCMAKE_C_FLAGS=-march=native configure-time flags. The resulting build will be optimized specifically for YOUR processor! The difference is more noticeable the weaker your computer is. Note that this may result in longer compile times, and the binaries you build will almost certainly be unusable on any computer besides your own. AUR users of *-git packages can get a similar effect by following https://wiki.archlinux.org/title/makepkg#Building_optimized_binaries