yuzu-wiki/Building-for-Linux.md

97 lines
3.1 KiB
Markdown
Raw Normal View History

2018-01-18 17:05:17 +00:00
### Dependencies
2018-01-14 06:14:02 +00:00
You'll need to download and install the following to build yuzu:
* GCC v7+ (for C++17 support) & misc
* [CMake](https://www.cmake.org/) 3.6+
* [SDL2](https://www.libsdl.org/download-2.0.php)
* [Qt](https://qt-project.org/downloads)
* [Python2](https://www.python.org/download/releases/2.7/) 2.7
All other dependencies will be downloaded by [conan](https://conan.io/downloads.html) if needed:
* [Boost](https://www.boost.org/users/download/)
* [Catch2](https://github.com/catchorg/Catch2)
* [fmt](https://fmt.dev/)
* [lz4](http://www.lz4.org)
* [nlohmann_json](https://github.com/nlohmann/json)
2020-05-08 10:38:52 +00:00
* [OpenSSL](https://www.openssl.org/source/)
* [opus](https://opus-codec.org/downloads/)
* [ZLIB](https://www.zlib.net/)
* [zstd](https://facebook.github.io/zstd/)
| Distro | Commands
| --------------- | ----------------
2020-05-08 14:26:46 +00:00
| Arch | `sudo pacman -S --needed git base-devel ninja cmake sdl2 qt5 python2 python-pip boost catch2 fmt libzip lz4 mbedtls nlohmann-json openssl opus zlib zstd && sudo pip install conan`
2020-05-10 08:50:03 +00:00
| Ubuntu / Debian | `sudo apt-get install git build-essential ninja-build cmake libsdl2-dev qtbase5-dev libqt5opengl5-dev qtwebengine5-dev qtbase5-private-dev python2 python3-pip libboost-dev libboost-context-dev libfmt-dev libzip-dev liblz4-dev libmbedtls-dev nlohmann-json3-dev libssl-dev libopus-dev zlib1g-dev libzstd-dev && sudo pip3 install conan`
2020-05-08 14:26:46 +00:00
| Fedora | `sudo dnf install git gcc ninja-build cmake SDL2-devel qt5-qtbase-devel python2 python-pip boost-devel fmt-devel libzip-devel libzstd-devel lz4-devel mbedtls-devel openssl-devel opus-devel zlib-devel && sudo pip install conan`
2020-05-08 14:17:35 +00:00
| 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 && sudo pip install conan`
2018-01-18 17:15:51 +00:00
### Cloning yuzu with Git
2018-01-14 06:14:02 +00:00
2019-10-19 16:04:17 +00:00
**Master:**
2019-02-20 17:15:55 +00:00
```bash
git clone --recursive https://github.com/yuzu-emu/yuzu
cd yuzu
```
2018-01-14 06:14:02 +00:00
2019-10-19 16:04:17 +00:00
**Mainline (no assert):**
2019-02-20 17:15:55 +00:00
```bash
git clone --recursive https://github.com/yuzu-emu/yuzu-mainline
cd yuzu-mainline
```
2019-02-20 17:15:55 +00:00
The `--recursive` option automatically clones the required Git submodules.
2018-01-14 06:14:02 +00:00
2020-05-08 09:54:18 +00:00
### Building yuzu in Release Mode (Optimized)
2018-01-14 06:14:02 +00:00
2018-01-18 16:55:02 +00:00
```bash
2018-01-14 06:14:02 +00:00
mkdir build && cd build
2020-05-08 09:54:18 +00:00
cmake .. -GNinja
ninja
sudo ninja install # (currently doesn't work, needs to be fixed)
2018-01-14 06:14:02 +00:00
```
Optionally, you can use `cmake-gui ..` to adjust various options (e.g. disable the Qt GUI).
2018-01-14 06:14:02 +00:00
2020-05-08 09:54:18 +00:00
### Building yuzu in Debug Mode (Slow)
2018-01-14 06:14:02 +00:00
2018-01-18 16:55:02 +00:00
```bash
2018-01-14 06:14:02 +00:00
mkdir build && cd build
2020-05-08 09:54:18 +00:00
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug
ninja
2018-01-14 06:14:02 +00:00
```
2018-01-18 17:05:17 +00:00
### Building with debug symbols
2018-01-14 06:14:02 +00:00
2018-01-18 16:55:02 +00:00
```bash
2020-05-08 09:54:18 +00:00
mkdir build && cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo
ninja
2018-01-14 06:14:02 +00:00
```
2018-01-18 17:05:17 +00:00
### Running without installing
2018-01-14 06:14:02 +00:00
2018-09-10 07:40:23 +00:00
After building, the binaries `yuzu` and `yuzu-cmd` (depending on your build options) will end up in `build/bin/`.
2018-01-14 06:14:02 +00:00
```bash
# SDL
cd build/bin/
./yuzu-cmd
2018-01-14 06:14:02 +00:00
# Qt
cd build/bin/
./yuzu
```
2018-01-14 06:14:02 +00:00
2018-01-18 17:05:17 +00:00
### Debugging
2018-01-14 06:14:02 +00:00
2018-01-18 16:55:02 +00:00
```bash
2018-01-14 06:14:02 +00:00
cd data
2018-09-10 07:40:23 +00:00
gdb ../build/bin/yuzu # Start GDB
(gdb) run # Run yuzu under GDB
2018-01-14 06:14:02 +00:00
<crash>
(gdb) bt # Print a backtrace of the entire callstack to see which codepath the crash occurred on
2018-01-14 06:14:02 +00:00
```