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:
2018-01-18 16:59:05 +00:00
- [SDL2 ](https://www.libsdl.org/download-2.0.php )
2018-01-14 06:14:02 +00:00
- Arch: `pacman -S sdl2`
2019-11-06 01:55:03 +00:00
- Ubuntu: `apt-get install libsdl2-2.0-0 libsdl2-dev`
2019-11-06 01:53:42 +00:00
- Debian: `apt-get install sdl2 libsdl2-2.0-0 libsdl2-dev`
2018-01-14 06:14:02 +00:00
- Fedora: `dnf install SDL2-devel`
2018-01-14 19:01:07 +00:00
- Gentoo: `emerge media-libs/libsdl2`
2018-01-18 16:59:05 +00:00
- [Qt ](http://qt-project.org/downloads )
2018-01-14 06:14:02 +00:00
- Arch: `pacman -S qt5`
2018-01-18 16:51:18 +00:00
- Debian: `apt-get install qtbase5-dev libqt5opengl5-dev`
2018-01-14 06:14:02 +00:00
- Fedora: `dnf install qt5-qtbase qt5-qtbase-devel`
2018-01-14 19:01:07 +00:00
- Gentoo: `emerge dev-qt/qtcore dev-qt/qtopengl`
2018-01-18 16:59:05 +00:00
- GCC v7+ (for C++17 support)
2018-01-14 06:14:02 +00:00
- Arch: `pacman -S base-devel`
2018-01-18 16:51:18 +00:00
- Debian: `apt-get install build-essential`
2018-01-16 18:00:09 +00:00
- Fedora: `dnf install gcc`
2018-01-16 18:05:43 +00:00
- Gentoo: `emerge =sys-devel/gcc-7.1.0`
2018-01-18 16:59:05 +00:00
- [CMake ](http://www.cmake.org/ ) 3.6+
2018-01-14 06:14:02 +00:00
- Arch: `pacman -S cmake`
2018-01-18 16:51:18 +00:00
- Debian: `apt-get install cmake`
2018-01-14 06:14:02 +00:00
- Fedora: `dnf install cmake`
2018-01-14 19:01:07 +00:00
- Gentoo: `emerge dev-util/cmake`
2018-01-17 23:27:06 +00:00
2018-01-18 16:51:18 +00:00
Note: Depending on your distro, the version of CMake you get may not be what's required to build yuzu. Check with cmake --version. Version 3.6 or greater is required for you to be able to build!
2018-01-18 17:05:17 +00:00
2018-01-18 16:59:05 +00:00
- [Clang ](https://github.com/llvm-mirror/clang ) 3.8 (optional build alternative)
2018-09-05 13:21:15 +00:00
- Arch: `pacman -S clang` , `libc++` is in the AUR. Use yay to install it.
2018-01-18 16:51:18 +00:00
- Debian: `apt-get install clang libc++-dev` (in some distros, clang-3.8).
2018-01-14 19:01:07 +00:00
- Gentoo: `emerge sys-devel/clang sys-libs/libcxx`
2018-01-14 06:14:02 +00:00
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
2018-01-18 16:55:02 +00:00
```bash
2018-01-14 06:14:02 +00:00
git clone --recursive https://github.com/yuzu-emu/yuzu
cd yuzu
```
2019-10-19 16:04:17 +00:00
**Mainline (no assert):**
2019-02-20 17:15:55 +00:00
```bash
2019-10-19 16:04:17 +00:00
git clone --recursive https://github.com/yuzu-emu/yuzu-mainline
cd yuzu-mainline
2019-02-20 17:15:55 +00:00
```
2018-01-14 06:14:02 +00:00
The `--recursive` option automatically clones the required Git submodules too.
2018-01-18 17:05:17 +00:00
### Building yuzu in Debug Mode (Slow)
2018-01-14 06:14:02 +00:00
2018-01-18 17:05:17 +00:00
#### Using GCC
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
2018-01-16 17:15:54 +00:00
cmake ../
2018-01-14 06:14:02 +00:00
make
sudo make install
```
2019-02-09 22:26:03 +00:00
Note: you can use **make -jN** where N is the number of processors available to accelerate the building
2018-01-18 16:56:52 +00:00
Optionally, you can use `cmake -i ..` to adjust various options (e.g. disable the Qt GUI).
2018-01-14 06:14:02 +00:00
2018-01-18 17:05:17 +00:00
#### Using clang
2018-01-14 06:14:02 +00:00
2019-10-24 15:44:29 +00:00
Note: It is important you use libc++ vs. , otherwise your build will likely fail. libc++ is not 100% complete on GNU/Linux, but works well for this build. The libstdc++ std::string is a different data structure than the libc++ std::string. See: [LLVM.org ](https://llvm.org/svn/llvm-project/www-releases/trunk/3.8.0/projects/libcxx/docs/UsingLibcxx.html ). If libc++ is not used, some warnings are treated as errors. Using clang is only really recommended for users not using GCC >= 5. Also see [Clang Comparison ](http://clang.llvm.org/comparison.html ).
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
2018-01-18 17:05:17 +00:00
cmake -DCMAKE_CXX_COMPILER=clang++-3.8 \
-DCMAKE_C_COMPILER=clang-3.8 \
-DCMAKE_CXX_FLAGS="-O2 -g -stdlib=libc++" \
..
2018-01-14 06:14:02 +00:00
make
2018-01-18 17:05:17 +00:00
sudo make install # (currently doesn't work, needs to be fixed)
2018-01-14 06:14:02 +00:00
```
2018-01-18 16:55:02 +00:00
2018-01-14 06:14:02 +00:00
Debian/Ubuntu: Owing to bug [#808086 ](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808086 ) the build might
fail. To have it build, add the following after line 1938 of `/usr/include/c++/v1/string` . (see discussion on
[StackOverflow ](http://stackoverflow.com/questions/37096062/get-a-basic-c-program-to-compile-using-clang-on-ubuntu-16 )
for more details.)
2018-01-18 16:55:02 +00:00
```cpp
2018-01-14 06:14:02 +00:00
#if _LIBCPP_STD_VER <= 14
_NOEXCEPT_ (is_nothrow_copy_constructible< allocator_type > ::value)
#else
_NOEXCEPT
#endif
```
2018-01-18 16:55:02 +00:00
Additionally, on Ubuntu, do:
2018-01-18 17:05:17 +00:00
2018-01-18 16:55:02 +00:00
```bash
sudo apt-get install libc++abi-dev & & sudo ln -s /usr/include/libcxxabi/__cxxabi_config.h /usr/include/c++/v1/__cxxabi_config.h
```
2018-01-14 06:14:02 +00:00
2018-01-18 17:05:17 +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
2018-01-16 17:15:54 +00:00
cmake .. -DCMAKE_BUILD_TYPE=Release
2018-01-14 06:14:02 +00:00
make
2018-01-18 17:06:08 +00:00
sudo make install # (currently doesn't work, needs to be fixed)
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
2018-01-16 17:15:54 +00:00
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
2018-01-14 06:14:02 +00:00
make
```
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
2018-01-18 16:55:02 +00:00
```bash
2018-01-14 06:14:02 +00:00
# SDL
2018-01-21 14:04:45 +00:00
cd build/bin/
2018-09-10 07:40:23 +00:00
./yuzu-cmd
2018-01-14 06:14:02 +00:00
# Qt
2018-01-21 14:04:45 +00:00
cd build/bin/
2018-09-10 07:40:23 +00:00
./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
2018-01-18 17:12:14 +00:00
(gdb) run # Run yuzu under GDB
2018-01-14 06:14:02 +00:00
< crash >
2018-01-18 17:12:14 +00:00
(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
```