Difference between revisions of "Help:Building RPCS3"

From RPCS3 Wiki
(Never use H1)
(Fix-up formatting)
Line 9: Line 9:
 
* [https://www.qt.io/download-qt-installer Qt 5.10+]
 
* [https://www.qt.io/download-qt-installer Qt 5.10+]
  
In addition, a relatively modern compiler is needed. The project uses c++17, and as a result GCC 7.3 or Clang 5.0 are the minimum needed compilers.
+
In addition, a relatively modern compiler is needed. The project uses C++17, and as a result GCC 7.3 or Clang 5.0 are the minimum needed compilers.
  
 
== Acquiring ==
 
== Acquiring ==
Line 22: Line 22:
  
 
== macOS ==
 
== macOS ==
 
+
Support for macOS is in its early stages. A few members of the community are working on getting Vulkan working on Macs, via gfx-rs and MoltenVK. Support for OpenGL will likely never come to the platform. For development, it is recommended to use Xcode and install the following through the terminal:
Support for macOS is in its early stages. A few members of the community are working on getting Vulkan working on Macs, via Apple's awful MoltenVK. Support for OpenGL will likely never come to the platform. For development, it is recommended to use Xcode and install the following through the terminal
 
  
 
<pre>
 
<pre>
Line 31: Line 30:
 
You will also need to remember to set environment vars:
 
You will also need to remember to set environment vars:
  
<pre>LLVM_DIR=/usr/local/opt/llvm/</pre> OR, wherever llvm was installed
+
: <code>LLVM_DIR=/usr/local/opt/llvm/</code> OR, wherever LLVM is installed
<pre>Qt5_DIR=/usr/local/opt/qt/lib/cmake/Qt5</pre> OR, wherever qt was installed
+
: <code>Qt5_DIR=/usr/local/opt/qt/lib/cmake/Qt5</code> OR, wherever Qt is installed
 
 
Build:
 
  
 +
=== Build ===
 
<pre>
 
<pre>
 
cd ../ && mkdir rpcs3_build && cd rpcs3_build
 
cd ../ && mkdir rpcs3_build && cd rpcs3_build
Line 41: Line 39:
 
</pre>
 
</pre>
  
Run RPCS3 with ./bin/rpcs3
+
=== Run ===
 +
<pre>
 +
./bin/rpcs3
 +
</pre>
  
 
== Msys2 ==
 
== Msys2 ==
Line 47: Line 48:
  
 
=== Dependencies ===
 
=== Dependencies ===
<pre>pacman -S base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-yasm mingw-w64-x86_64-python2 mingw-w64-x86_64-ntldd-git mingw-w64-x86_64-qt5 mingw-w64-x86_64-openal mingw-w64-x86_64-glew git</pre>
+
<pre>
 +
pacman -S base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-yasm mingw-w64-x86_64-python2 mingw-w64-x86_64-ntldd-git mingw-w64-x86_64-qt5 mingw-w64-x86_64-openal mingw-w64-x86_64-glew git
 +
</pre>
  
 
=== Clone ===
 
=== Clone ===
<pre>git clone https://github.com/RPCS3/rpcs3.git
+
<pre>
 +
git clone https://github.com/RPCS3/rpcs3.git
 
cd rpcs3
 
cd rpcs3
git submodule update --init</pre>
+
git submodule update --init
 +
</pre>
  
 
=== Configure ===
 
=== Configure ===
<pre>cd .. && mkdir rpcs3_build && cd rpcs3_build
+
<pre>
 +
cd .. && mkdir rpcs3_build && cd rpcs3_build
 
cmake -G "MSYS Makefiles" -DCMAKE_MAKE_PROGRAM=mingw32-make ../rpcs3/
 
cmake -G "MSYS Makefiles" -DCMAKE_MAKE_PROGRAM=mingw32-make ../rpcs3/
mingw32-make.exe GitVersion && mingw32-make.exe discord-rpc</pre>
+
mingw32-make.exe GitVersion && mingw32-make.exe discord-rpc
 +
</pre>
  
 
=== Build ===
 
=== Build ===
<pre>mingw32-make -jX #X is core count</pre>
+
<pre>
 +
mingw32-make -jX #X is core count
 +
</pre>
  
 
=== Install ===
 
=== Install ===
<pre>cd ./bin
+
<pre>
 +
cd ./bin
 
for l in $(ntldd.exe -R rpcs3.exe|grep mingw64|sed -e 's/^[ \t]*//'|cut -d' ' -f3);do cp $l .;done
 
for l in $(ntldd.exe -R rpcs3.exe|grep mingw64|sed -e 's/^[ \t]*//'|cut -d' ' -f3);do cp $l .;done
  
Line 70: Line 80:
 
cp /mingw64/share/qt5/plugins/imageformats/{qgif.dll,qicns.dll,qico.dll,qjpeg.dll,qtga.dll,qtiff.dll,qwbmp.dll,qwebp.dll} ./qt/plugins/imageformats/
 
cp /mingw64/share/qt5/plugins/imageformats/{qgif.dll,qicns.dll,qico.dll,qjpeg.dll,qtga.dll,qtiff.dll,qwbmp.dll,qwebp.dll} ./qt/plugins/imageformats/
 
cp /mingw64/share/qt5/plugins/platforms/qwindows.dll ./qt/plugins/platforms/
 
cp /mingw64/share/qt5/plugins/platforms/qwindows.dll ./qt/plugins/platforms/
cp /mingw64/share/qt5/plugins/styles/qwindowsvistastyle.dll ./qt/plugins/styles/</pre>
+
cp /mingw64/share/qt5/plugins/styles/qwindowsvistastyle.dll ./qt/plugins/styles/
 +
</pre>
  
 
=== Run ===
 
=== Run ===
<pre>./rpcs3</pre>
+
<pre>
 +
./rpcs3
 +
</pre>
  
 
== CMake Build Options ==
 
== CMake Build Options ==

Revision as of 09:59, 20 December 2018

Official, up-to-date instructions for Windows and Linux can be found in the readme. However, many build platforms are supported partially by the development team i.e. pull requests are accepted from various members of the community who have taken to ensuring that other platforms can also build RPCS3 correctly. However, they are not actively maintained by the development team, and as a result many Unices such as macOS and FreeBSD break often. You can find the build process detailed for several less-common platforms below.

Dependencies

RPCS3 uses many 3rd party libraries and projects. Most notably, in order to build the project, you will need the following:

In addition, a relatively modern compiler is needed. The project uses C++17, and as a result GCC 7.3 or Clang 5.0 are the minimum needed compilers.

Acquiring

Clone and initialize the repository:

git clone https://github.com/RPCS3/rpcs3.git
cd rpcs3/
git submodule update --init

macOS

Support for macOS is in its early stages. A few members of the community are working on getting Vulkan working on Macs, via gfx-rs and MoltenVK. Support for OpenGL will likely never come to the platform. For development, it is recommended to use Xcode and install the following through the terminal:

brew install glew llvm qt cmake

You will also need to remember to set environment vars:

LLVM_DIR=/usr/local/opt/llvm/ OR, wherever LLVM is installed
Qt5_DIR=/usr/local/opt/qt/lib/cmake/Qt5 OR, wherever Qt is installed

Build

cd ../ && mkdir rpcs3_build && cd rpcs3_build
cmake ../rpcs3/ && make GitVersion && make

Run

./bin/rpcs3

Msys2

There is some support for non-MSVC based compilation on Windows. The Msys2 platform using the Mingw build tools did work at one point, though it should be noted that the following instructions are outdated.

Dependencies

pacman -S base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-yasm mingw-w64-x86_64-python2 mingw-w64-x86_64-ntldd-git mingw-w64-x86_64-qt5 mingw-w64-x86_64-openal mingw-w64-x86_64-glew git

Clone

git clone https://github.com/RPCS3/rpcs3.git
cd rpcs3
git submodule update --init

Configure

cd .. && mkdir rpcs3_build && cd rpcs3_build
cmake -G "MSYS Makefiles" -DCMAKE_MAKE_PROGRAM=mingw32-make ../rpcs3/
mingw32-make.exe GitVersion && mingw32-make.exe discord-rpc

Build

mingw32-make -jX #X is core count

Install

cd ./bin
for l in $(ntldd.exe -R rpcs3.exe|grep mingw64|sed -e 's/^[ \t]*//'|cut -d' ' -f3);do cp $l .;done

mkdir -p ./qt/plugins/{bearer,imageformats,platforms,styles}
cp /mingw64/share/qt5/plugins/bearer/qgenericbearer.dll ./qt/plugins/bearer/
cp /mingw64/share/qt5/plugins/imageformats/{qgif.dll,qicns.dll,qico.dll,qjpeg.dll,qtga.dll,qtiff.dll,qwbmp.dll,qwebp.dll} ./qt/plugins/imageformats/
cp /mingw64/share/qt5/plugins/platforms/qwindows.dll ./qt/plugins/platforms/
cp /mingw64/share/qt5/plugins/styles/qwindowsvistastyle.dll ./qt/plugins/styles/

Run

./rpcs3

CMake Build Options

Build against the shared libpng instead of using the built-in one. libpng 1.6+ highly recommended. Try this option if you get version conflict errors or only see black game icons.

-DUSE_SYSTEM_LIBPNG=ON/OFF (default = *OFF*)

Build against the shared ffmpeg libraries instead of using the built-in patched version. Try this if the built-in version breaks the OpenGL renderer for you.

-DUSE_SYSTEM_FFMPEG=ON/OFF (default = *OFF*)

This forces RPCS3 to build with LLVM.

-DWITH_LLVM=ON/OFF (default = *ON*)

This builds RPCS3 with support for debugging PS3 games using gdb.

-DWITH_GDB=ON/OFF (default = *OFF*)

This builds RPCS3 with Vulkan support.

-DUSE_VULKAN=ON/OFF (default = *ON*)

This builds RPCS3 with -march=native, which is useful for local builds, but not good for packages.

-DUSE_NATIVE_INSTRUCTIONS=ON/OFF (default = *ON*)