Building Dolphin on Linux: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
(18 intermediate revisions by 8 users not shown)
Line 1: Line 1:
= Note =
'''Outdated: This has not been updated since July 2019 an no longer aligns with Dolphin's current dependencies.'''
Users running Linux distros have to build Dolphin from source. Dolphin is compatible with x86-64 and AArch64 Linux distributions. This is a guide to compiling Dolphin using the cmake build system.
Users running Linux distros have to build Dolphin from source. Dolphin is compatible with x86-64 and AArch64 Linux distributions. This is a guide to compiling Dolphin using the cmake build system.


Line 5: Line 9:
== Step 1 - Installing the Dependencies ==  
== Step 1 - Installing the Dependencies ==  
=== Ubuntu ===
=== Ubuntu ===
Follow the steps below only if you like to make your own package or use a specific git commit version. There's a [https://wiki.dolphin-emu.org/index.php?title=Installing_Dolphin#Ubuntu PPA] with dolphin already built, easy to use.
Follow the steps below only if you like to make your own package or use a specific git commit version. There's a [https://wiki.dolphin-emu.org/index.php?title=Installing_Dolphin#Ubuntu PPA] with Dolphin already built, easy to use.
 
==== 12.04 (LTS) ====
''Follow this step for Ubuntu 12.04 (LTS).''<br>
You need to install a g++ version with C++0x/C++11 support, so install this PPA first:
 
<pre>sudo add-apt-repository ppa:dolphin-emu/gcc-for-dolphin
 
sudo apt-get update</pre>
 
This PPA will update libstdc++6 package too, which is an important component from the system, so be careful and use at your own risk.
 
Cmake needs to be updated too:
 
<pre>sudo add-apt-repository ppa:kalakris/cmake
 
sudo apt-get update</pre>
 
There is no ppa for libevdev-dev, so you will need to build libevdev from source, or disable the evdev backend (<code>cmake .. -DENABLE_EVDEV=OFF -DENABLE_SDL=ON</code>)


Now, install all necessary packages by running the following command:
==== 14.04 LTS ====
 
''Follow this step for Ubuntu 14.04 LTS.''<br>
<pre>sudo apt-get install cmake pkg-config git gcc-4.9 g++-4.9 libao-dev libasound2-dev libgl1-mesa-dev libgtk2.0-dev liblzo2-dev libopenal-dev libpulse-dev libreadline-dev libsdl1.2-dev libsoil-dev libxext-dev libxrandr-dev zlib1g-dev libudev-dev</pre>
Dolphin needs GCC >= 4.9 now (see {{Issue|8636}}), so install [https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test this PPA] first:
 
==== 14.04 (LTS) ====
''Follow this step for Ubuntu 14.04 (LTS).''<br>
Dolphin needs [https://code.google.com/p/dolphin-emu/issues/detail?id=8636&can=1&q=regex GCC >= 4.9] now, so install [https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test this PPA] first:


<pre>sudo add-apt-repository ppa:ubuntu-toolchain-r/test
<pre>sudo add-apt-repository ppa:ubuntu-toolchain-r/test


sudo apt-get update</pre>
sudo apt update</pre>


Install all necessary packages by running the following command (minimum version for Wx is 3.0.1, but trusty repo comes with 3.0.0, so it will build from Externals):
Install all necessary packages by running the following command (minimum version for Wx is 3.0.1, but trusty repo comes with 3.0.0, so it will build from Externals):


<pre>sudo apt-get install cmake pkg-config git gcc-4.9 g++-4.9 libao-dev libasound2-dev libavcodec-dev libavformat-dev libbluetooth-dev libcurl4-openssl-dev libgtk2.0-dev liblzo2-dev libopenal-dev libpulse-dev libreadline-dev libsfml-dev libsoil-dev libswscale-dev libusb-1.0-0-dev libxext-dev libxrandr-dev portaudio19-dev zlib1g-dev libudev-dev libevdev-dev</pre>
<pre>sudo apt install cmake pkg-config git gcc-4.9 g++-4.9 libao-dev libasound2-dev libavcodec-dev libavformat-dev libbluetooth-dev libcurl4-openssl-dev libgtk2.0-dev liblzo2-dev libopenal-dev libpulse-dev libreadline-dev libsfml-dev libsoil-dev libswscale-dev libusb-1.0-0-dev libxext-dev libxrandr-dev portaudio19-dev zlib1g-dev libudev-dev libevdev-dev</pre>


==== 15.04, 15.10 and 16.04 (LTS) ====
==== 16.04 LTS ====
''Follow this step for Ubuntu 15.04, 15.10, 16.04 and future versions (it probably also works on Debian GNU/Linux 8).''<br>
''Follow this step for Ubuntu 16.04 LTS and later. It probably also works for Debian GNU/Linux 8.''<br>
Install all necessary packages by running the following command:
Install all necessary packages by running the following command:


<pre>sudo apt-get install cmake pkg-config git libao-dev libasound2-dev libavcodec-dev libavformat-dev libbluetooth-dev libenet-dev libgtk2.0-dev liblzo2-dev libminiupnpc-dev libopenal-dev libpulse-dev libreadline-dev libsfml-dev libsoil-dev libsoundtouch-dev libswscale-dev libusb-1.0-0-dev libwxbase3.0-dev libwxgtk3.0-dev libxext-dev libxrandr-dev portaudio19-dev zlib1g-dev libudev-dev libevdev-dev "libpolarssl-dev|libmbedtls-dev" libcurl4-openssl-dev libegl1-mesa-dev libpng-dev</pre>
<pre>sudo apt install cmake pkg-config git libao-dev libasound2-dev libavcodec-dev libavformat-dev libbluetooth-dev libenet-dev libgtk2.0-dev liblzo2-dev libminiupnpc-dev libopenal-dev libpulse-dev libreadline-dev libsfml-dev libsoil-dev libsoundtouch-dev libswscale-dev libusb-1.0-0-dev libwxbase3.0-dev libwxgtk3.0-dev libxext-dev libxrandr-dev portaudio19-dev zlib1g-dev libudev-dev libevdev-dev "libpolarssl-dev|libmbedtls-dev" libcurl4-openssl-dev libegl1-mesa-dev libpng-dev qtbase5-private-dev</pre>


For dolphin development version: it requires at least WxWidgets 3.1.0, so you don't need install libwxbase3.0-dev and libwxgtk3.0-dev; Dolphin will build it from Externals folder.
The development version of Dolphin requires at least WxWidgets 3.1.0, so you don't need install libwxbase3.0-dev and libwxgtk3.0-dev; Dolphin will build it from Externals folder.


Add -DUSE_SHARED_ENET=ON on cmake line if you want to build dolphin against shared libenet-dev.
Add -DUSE_SHARED_ENET=ON on cmake line if you want to build dolphin against shared libenet-dev.


You may not find libsoundtouch-dev in 15.04, just remove it from the install line.
=== Fedora ===
[https://wiki.dolphin-emu.org/index.php?title=Installing_Dolphin#Fedora Quick method] for Fedora 24 and later.


===Fedora===
==== 23 ====
 
====Fedora 23====
These dependencies must be installed.
These dependencies must be installed.


<pre>dnf install cmake git gcc-c++ libXext-devel libgudev gtk+-devel wxGTK-devel systemd-devel openal-soft-devel libevdev-devel</pre>
<pre>dnf install cmake git gcc-c++ libXext-devel libgudev qt5-devel systemd-devel openal-soft-devel libevdev-devel libao-devel SOIL-devel libXrandr-devel pulseaudio-libs-devel bluez-libs-devel libusb-devel </pre>
 
These dependencies are optional, but as noted below if you want full features you'll want to install them too.
<pre>dnf install libao-devel SOIL-devel libXrandr-devel pulseaudio-libs-devel bluez-libs-devel libusb-devel</pre>


These dependencies are best from [http://rpmfusion.org/ RPM Fusion] and may not be provided in Fedora repos.
The following dependencies are best from [https://rpmfusion.org/ RPM Fusion] and may not be provided in Fedora repos.
<pre>dnf install ffmpeg ffmpeg-devel</pre>
<pre>dnf install ffmpeg ffmpeg-devel</pre>


=== Other Linux Distributions ===
=== Other Linux Distributions ===
If running another distribution, see the build dependencies in [[#Addendum A - dependencies|Addendum A]] for a list of packages needed to install.
If running another distribution, see the build dependencies in [[#Addendum A|Addendum A]] for a list of packages needed to install.


== Step 2 - Get the Dolphin Repository ==
== Step 2 - Get the Dolphin Repository ==
Install git if it's not already installed:
Install git if it's not already installed:
*for apt-based distros (eg Ubuntu, Debian, Linux Mint): <code>sudo apt-get install git</code>
*for apt-based distros (eg Ubuntu, Debian, Linux Mint): <code>sudo apt install git</code>
*for rpm-based distros (eg Red Hat, Fedora): <code>sudo yum install git</code>
*for rpm-based distros (eg Red Hat, Fedora): <code>su -c 'dnf install git'</code>
*for openSUSE: <code>sudo zypper in git</code>
*for openSUSE: <code>sudo zypper in git</code>
*for pacman-based distros (eg Arch Linux): <code>sudo pacman -S git</code>
*for pacman-based distros (eg Arch Linux): <code>sudo pacman -S git</code>
Line 108: Line 86:
<code>CC=clang CXX=clang++ CXXFLAGS+=-stdlib=libc++ LDFLAGS+=-lc++ cmake ..</code>
<code>CC=clang CXX=clang++ CXXFLAGS+=-stdlib=libc++ LDFLAGS+=-lc++ cmake ..</code>


Note that you will have to add libc++-dev as dependence in this case. Clang minimum version is 3.4. Use SFML from Externals/, otherwise you'll get some '''[http://hastebin.com/raw/etarucuged undefined references]'''.
Note that you will have to add libc++-dev as dependence in this case. Clang minimum version is 3.4. Use SFML and pugixml from Externals/ (the latter is only necessary for {{revision|5.0-7026}} and later), otherwise you'll get some '''[https://hastebin.com/raw/etarucuged undefined references]'''.


Optionally you can change the install prefix by adding "-D CMAKE_INSTALL_PREFIX=/new/path". Note that this path does not need to be absolute. cmake will complete it to its absolute equivalent. The default prefix is "/usr". This means that the executable will be installed as "/usr/bin/dolphin-emu", the plugins will be installed into "/usr/lib/dolphin-emu", and the shared data files will be installed into "/usr/share/dolphin-emu".
Optionally you can change the install prefix by adding "-D CMAKE_INSTALL_PREFIX=/new/path". Note that this path does not need to be absolute. cmake will complete it to its absolute equivalent. The default prefix is "/usr". This means that the executable will be installed as "/usr/bin/dolphin-emu", the plugins will be installed into "/usr/lib/dolphin-emu", and the shared data files will be installed into "/usr/share/dolphin-emu".
Line 135: Line 113:
*'''Where can I get help?'''
*'''Where can I get help?'''


Go to the [http://forums.dolphin-emu.org/ forums]. Lots of Dolphin users use Linux, and they are very experienced with this process.
Go to the [https://forums.dolphin-emu.org forums]. Lots of Dolphin users use Linux, and they are very experienced with this process.


*'''My build failed, but I did nothing wrong!'''
*'''My build failed, but I did nothing wrong!'''


Most of the time, any problems in the build process are due to user error. It's understandable, it is a complicated process and can be quite daunting for a first timer. But sometimes even with everything right, triple checked, and it's still not working. It's rare, but sometimes a build will just be bugged. But many of Dolphin devs are Linux users, so just wait a day or so, and it will be sorted out. If you are trying on Ubuntu 16.04, it wont work (see step 1).
Most of the time, any problems in the build process are due to user error. It's understandable, it is a complicated process and can be quite daunting for a first timer. But sometimes even with everything right, triple checked, and it's still not working. It's rare, but sometimes a build will just be bugged. But many of Dolphin devs are Linux users, so just wait a day or so, and it will be sorted out. If you are trying on Ubuntu 16.04, it is tested and working now.


*'''I want a PKGBUILD!'''
*'''I want a PKGBUILD!'''
Line 225: Line 203:
This script checks for Dolphin's source code, downloads it or updates it, then compiles it and finally installs it. It is somewhat interactive and distro-independent.<br>
This script checks for Dolphin's source code, downloads it or updates it, then compiles it and finally installs it. It is somewhat interactive and distro-independent.<br>
It '''will not''' install any of the dependencies listed above, and will fail if any of them are missing. Install manually as described at [[#Step 1 - Installing the Dependencies|the first step]].<br>
It '''will not''' install any of the dependencies listed above, and will fail if any of them are missing. Install manually as described at [[#Step 1 - Installing the Dependencies|the first step]].<br>
Licence: [http://www.gnu.org/licenses/gpl-2.0.html GNU General Public Licence v2] or (at your option) any later version of the GPL.<br>
Licence: [https://www.gnu.org/licenses/gpl-2.0.html GNU General Public Licence v2] or (at your option) any later version of the GPL.<br>
<pre>
<pre>
#!/bin/bash
#!/bin/bash
Line 262: Line 240:
Within this directory, the script will create two subdirectories, ''dolphin-emu'' and ''build''. It must remain in this directory to work.<br>
Within this directory, the script will create two subdirectories, ''dolphin-emu'' and ''build''. It must remain in this directory to work.<br>
Execute the script from anywhere, by running <code>sh /path/to/the/script.sh</code>, where /path/to/the/script.sh is replaced with the actual path to the script.<br>
Execute the script from anywhere, by running <code>sh /path/to/the/script.sh</code>, where /path/to/the/script.sh is replaced with the actual path to the script.<br>
The script will download Dolphin's source, or update it if it has already been downloaded once. After building it, the script will install it. This requires root privileges. After the installation, the script exits, and Dolphin can be used. Note that the process is very fast and simple after the first time. Using a [http://askubuntu.com/a/17538 bash alias] to execute the script by running a custom command such as <code>dolphin-update</code> is recommended.
The script will download Dolphin's source, or update it if it has already been downloaded once. After building it, the script will install it. This requires root privileges. After the installation, the script exits, and Dolphin can be used. Note that the process is very fast and simple after the first time. Using a [https://askubuntu.com/a/17538 bash alias] to execute the script by running a custom command such as <code>dolphin-update</code> is recommended.


[[Category:Tutorials]]
[[Category:Tutorials]]

Navigation menu