Egghead.page Logo

How to Compile RetroArch from Source on Linux

This guide outlines the necessary steps to build RetroArch from source code on a Linux system. You will learn how to install required dependencies, clone the official repository, compile the binary files, and install the application for optimal performance and customization.

Prerequisites and Dependencies

Before compiling, you must ensure your system has the necessary build tools and libraries. On Debian-based distributions like Ubuntu, open a terminal and update your package list before installing the build essentials and development libraries.

sudo apt update
sudo apt install build-essential git libssl-dev libgl1-mesa-dev libudev-dev libasound2-dev libpulse-dev libxi-dev libx11-dev libxrandr-dev libxcursor-dev libxinerama-dev libwayland-dev libxkbcommon-dev

Cloning the Repository

Once the dependencies are installed, you need to download the latest source code from the official RetroArch GitHub repository. Navigate to your desired installation directory and clone the project.

git clone https://github.com/libretro/RetroArch.git
cd RetroArch

Compiling the Source Code

With the source code downloaded, you can begin the compilation process. It is recommended to use all available CPU cores to speed up the build process. Run the make command with the job flag set to the number of processing units available.

./configure
make -j$(nproc)

If the configuration step detects missing libraries, review the output error messages and install any additional packages required for your specific hardware or desktop environment.

Installing RetroArch

After the compilation finishes successfully, you can install the binary to your system directories. This step requires superuser privileges to write to system folders.

sudo make install

Verifying the Installation

To ensure RetroArch was installed correctly, launch the application from your terminal or application menu. Running the version command confirms the binary is accessible and functioning.

retroarch --version

You have now successfully compiled and installed RetroArch from source on your Linux machine. You can proceed to configure cores and load content through the graphical interface.