yuzu-wiki/Building-for-Linux.md

4.0 KiB

This article was written for developers. Users looking to simply run yuzu should try downloading Mainline first. It requires installing the same dependencies listed below, though && pip install --user conan can be omitted.

Dependencies

You'll need to download and install the following to build yuzu:

All other dependencies will be downloaded by conan if needed:

  • Boost
  • Catch2
  • fmt
  • lz4
  • nlohmann_json
  • OpenSSL
  • opus
  • ZLIB
  • zstd
    Distro Commands
    Arch sudo pacman -S --needed git base-devel ninja cmake sdl2 qt5 python2 python-pip boost catch2 ffmpeg fmt libzip lz4 mbedtls nlohmann-json openssl opus zlib zstd && pip install --user conan
    Ubuntu / Mint sudo apt-get install git build-essential ninja-build cmake libsdl2-dev qtbase5-dev libqt5opengl5-dev qtwebengine5-dev qtbase5-private-dev python python3-pip libboost-dev libboost-context-dev libavcodec-dev libavutil-dev libswscale-dev libzip-dev liblz4-dev libmbedtls-dev libssl-dev libopus-dev zlib1g-dev libzstd-dev && pip3 install --user conan
    Fedora sudo dnf install git gcc ninja-build cmake make libzip-tools SDL2-devel qt5-qtbase-devel qt5-qtbase-private-devel qt5-qtwebengine-devel qt5-linguist python2 python-pip boost-devel fmt-devel libzip-devel libzstd-devel lz4-devel mbedtls-devel openssl-devel opus-devel zlib-devel ffmpeg-devel && pip install --user conan
    Gentoo emerge dev-vcs/git =sys-devel/gcc-7.1.0 dev-util/ninja dev-util/cmake media-libs/libsdl2 dev-qt/qtcore dev-qt/qtopengl && pip install --user conan

After installing conan, $HOME/.local/bin needs to be included in the PATH variable. Check your $HOME/.profile and $HOME/.bashrc files, if PATH=$HOME/.local/bin:$PATH is not present, append that line to one of either file, then log out and log back in. Fedora and Ubuntu by default already have this covered.

Fedora users need to setup RPM Fusion (free) to install FFmpeg dependencies.

Cloning yuzu with Git

Master:

git clone --recursive https://github.com/yuzu-emu/yuzu
cd yuzu

Mainline (no assert):

git clone --recursive https://github.com/yuzu-emu/yuzu-mainline
cd yuzu-mainline

The --recursive option automatically clones the required Git submodules.

Building yuzu in Release Mode (Optimized)

mkdir build && cd build
cmake .. -GNinja
ninja
sudo ninja install # (currently doesn't work, needs to be fixed)

Optionally, you can use cmake-gui .. to adjust various options (e.g. disable the Qt GUI).

Building yuzu in Debug Mode (Slow)

mkdir build && cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug
ninja

Building with debug symbols

mkdir build && cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo
ninja

Running without installing

After building, the binaries yuzu and yuzu-cmd (depending on your build options) will end up in build/bin/.

# SDL
cd build/bin/
./yuzu-cmd

# Qt
cd build/bin/
./yuzu

Debugging

cd data
gdb ../build/bin/yuzu            # Start GDB
(gdb) run                        # Run yuzu under GDB
<crash>
(gdb) bt                         # Print a backtrace of the entire callstack to see which codepath the crash occurred on