Update Building for Linux

zqpvr01 2024-03-22 12:19:41 +01:00
parent 64d1138418
commit 38c6680a0b

@ -1,23 +1,23 @@
**This article was written for developers. Users looking to simply run yuzu should try downloading [Mainline](https://yuzu-emu.org/downloads/) first. As it is an AppImage, it only needs to be downloaded and made executable to use it.**
**This article was written for developers. Users looking to simply run suyu should try downloading [Mainline](https://suyu.dev/downloads/) first. As it is an AppImage, it only needs to be downloaded and made executable to use it.**
***
### Dependencies
You'll need to download and install the following to build yuzu:
You'll need to download and install the following to build suyu:
* [GCC](https://gcc.gnu.org/) v11+ (for C++20 support) & misc
* This page is being updated as we transition to GCC 11
* If GCC 12 is installed, [Clang](https://clang.llvm.org/) v14+ is required for compiling
* [CMake](https://www.cmake.org/) 3.15+
The following are handled by yuzu's externals:
The following are handled by suyu's externals:
* [FFmpeg](https://ffmpeg.org/)
* [SDL2](https://www.libsdl.org/download-2.0.php) 2.0.18+
* [opus](https://opus-codec.org/downloads/)
If version 5.15.2 is not already installed, pre-compiled binaries for Qt 5.15.2 will be downloaded from [here](https://github.com/yuzu-emu/ext-linux-bin) automatically by CMake:
If version 5.15.2 is not already installed, pre-compiled binaries for Qt 5.15.2 will be downloaded from [here](https://git.suyu.dev/suyu/ext-linux-bin) automatically by CMake:
* [Qt](https://qt-project.org/downloads) 5.15+
@ -43,9 +43,9 @@ Dependencies are listed here as commands that can be copied/pasted. Of course, t
- Ubuntu / Linux Mint / Debian:
- `sudo apt-get install autoconf cmake g++-11 gcc-11 git glslang-tools libasound2 libboost-context-dev libglu1-mesa-dev libhidapi-dev libpulse-dev libtool libudev-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-xkb1 libxext-dev libxkbcommon-x11-0 mesa-common-dev nasm ninja-build qtbase5-dev qtbase5-private-dev qtwebengine5-dev qtmultimedia5-dev libmbedtls-dev catch2 libfmt-dev liblz4-dev nlohmann-json3-dev libzstd-dev libssl-dev libavfilter-dev libavcodec-dev libswscale-dev`
- Ubuntu 22.04, Linux Mint 20, or Debian Bullseye or later is required.
- Users need to manually specify building with QT Web Engine enabled. This is done using the parameter `-DYUZU_USE_QT_WEB_ENGINE=ON` when running CMake.
- Users need to manually specify building with QT Web Engine enabled. This is done using the parameter `-DSUYU_USE_QT_WEB_ENGINE=ON` when running CMake.
- Users need to manually specify building with GCC 11. This can be done by adding the parameters `-DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11` when running CMake. i.e.
- Users need to manually disable building SDL2 from externals if they intend to use the version provided by their system by adding the parameters `-DYUZU_USE_EXTERNAL_SDL2=OFF`
- Users need to manually disable building SDL2 from externals if they intend to use the version provided by their system by adding the parameters `-DSUYU_USE_EXTERNAL_SDL2=OFF`
```
git submodule update --init --recursive
@ -57,8 +57,8 @@ cmake .. -GNinja -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11
- Fedora 32 or later is required.
- Due to GCC 12, Fedora 36 or later users need to install `clang`, and configure CMake to use it via `-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang`
- CMake arguments to force system libraries:
- SDL2: `-DYUZU_USE_BUNDLED_SDL2=OFF -DYUZU_USE_EXTERNAL_SDL2=OFF`
- FFmpeg: `-DYUZU_USE_EXTERNAL_FFMPEG=OFF`
- SDL2: `-DSUYU_USE_BUNDLED_SDL2=OFF -DSUYU_USE_EXTERNAL_SDL2=OFF`
- FFmpeg: `-DSUYU_USE_EXTERNAL_FFMPEG=OFF`
- [RPM Fusion](https://rpmfusion.org/) (free) is required to install `ffmpeg-devel`
- Gentoo:
- **\*\*Disclaimer\*\***: this dependency list was written by a novice Gentoo user who first set it up with a DE, and then based this list off of the Fedora dependency list. This may be missing some requirements, or includes too many. Caveat emptor.
@ -66,42 +66,35 @@ cmake .. -GNinja -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11
- GCC 11 or later is required.
- Users may need to append `pulseaudio`, `bindist` and `context` to the `USE` flag.
### Cloning yuzu with Git
### Cloning suyu with Git
**Master:**
```bash
git clone --recursive https://github.com/yuzu-emu/yuzu
cd yuzu
```
**Mainline:**
```bash
git clone --recursive https://github.com/yuzu-emu/yuzu-mainline
cd yuzu-mainline
git clone --recursive https://git.suyu.dev/suyu/suyu
cd suyu
```
The `--recursive` option automatically clones the required Git submodules.
### Building yuzu in Release Mode (Optimized)
### Building suyu in Release Mode (Optimized)
If you need to run ctests, you can disable `-DYUZU_TESTS=OFF` and install Catch2.
If you need to run ctests, you can disable `-DSUYU_TESTS=OFF` and install Catch2.
```bash
mkdir build && cd build
cmake .. -GNinja -DYUZU_USE_BUNDLED_VCPKG=ON -DYUZU_TESTS=OFF
cmake .. -GNinja -DSUYU_USE_BUNDLED_VCPKG=ON -DSUYU_TESTS=OFF
ninja
sudo ninja install
```
Optionally, you can use `cmake-gui ..` to adjust various options (e.g. disable the Qt GUI).
### Building yuzu in Debug Mode (Slow)
### Building suyu in Debug Mode (Slow)
```bash
mkdir build && cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug -DYUZU_USE_BUNDLED_VCPKG=ON -DYUZU_TESTS=OFF
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug -DSUYU_USE_BUNDLED_VCPKG=ON -DSUYU_TESTS=OFF
ninja
```
@ -109,36 +102,36 @@ ninja
```bash
mkdir build && cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_USE_BUNDLED_VCPKG=ON -DYUZU_TESTS=OFF
cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSUYU_USE_BUNDLED_VCPKG=ON -DSUYU_TESTS=OFF
ninja
```
### Running without installing
After building, the binaries `yuzu` and `yuzu-cmd` (depending on your build options) will end up in `build/bin/`.
After building, the binaries `suyu` and `suyu-cmd` (depending on your build options) will end up in `build/bin/`.
```bash
# SDL
cd build/bin/
./yuzu-cmd
./suyu-cmd
# Qt
cd build/bin/
./yuzu
./suyu
```
### Debugging
1. Enable CPU debugging
![](https://raw.githubusercontent.com/flathub/org.yuzu_emu.yuzu/master/assets/yuzu-settings-2.png)
![](https://raw.githubusercontent.com/flathub/org.suyu_emu.suyu/master/assets/suyu-settings-2.png)
2. Disable both Host MMU emulation options
![](https://raw.githubusercontent.com/flathub/org.yuzu_emu.yuzu/master/assets/yuzu-settings-1.png)
![](https://raw.githubusercontent.com/flathub/org.suyu_emu.suyu/master/assets/suyu-settings-1.png)
3. Run gdb
```bash
cd data
gdb ../build/bin/yuzu # Start GDB
(gdb) run # Run yuzu under GDB
gdb ../build/bin/suyu # Start GDB
(gdb) run # Run suyu under GDB
<crash>
(gdb) bt # Print a backtrace of the entire callstack to see which codepath the crash occurred on
```