Ubuntu Compilation / Development Guide¶
Environment configuration¶
The easiest route to get into building RetroArch and libretro cores on Ubuntu linux is to use libretro's PPA.
For stable releases you can add the PPA like this:
1 2 |
|
For development work we recommend the testing PPA instead:
1 2 |
|
You will need git and a few build tools at least to proceed which you can install by issuing the following command:
1 |
|
RetroArch Compilation¶
Building RetroArch¶
The first step is to obtain RetroArch's source tree.
1 |
|
You can get RetroArch's dependenencies by running the following command:
1 |
|
Note
Depending on your configuration you may need to uncomment the deb-src repositories in /etc/apt/sources.list, /etc/apt/sources.list.d/libretro-ubuntu-testing-$version.list and then run apt-get update before running apt-get build-dep
For subsequent builds you will need to pull the changes from the repo
1 2 |
|
To compile RetroArch run the following commands inside RetroArch's source tree:
1 2 3 |
|
For development purposes you might want to run a debug build instead. In such case use the following commands:
1 2 3 |
|
You can then start RetroArch by running:
1 |
|
Local builds do not contain assets. On a clean build, assets will be located by default at $HOME/.config/retroarch/assets, and can be downloaded from the Main Menu via Online Updater > Update Assets
Tip
If you're building frequently you may want to add ccache to the mix to speed up the build process.
Install ccache via apt and the prepend the ccache symlink directory to your build environment path as shown below.
For further instructions check the documentation
Install ccache:
1 |
|
Configure paths:
1 |
|
Tip
You can add that last line to your ~/.bashrc to avoid having to type that every time you start your working environment.
Core Compilation¶
Fetching Cores¶
You can find the cores on libretro's GitHUB organization.
We have an all-in-one tool to fetch and compile cores which you can use to streamline the process.
You can obtain the tool by using these commands:
1 2 |
|
Then you can fetch one or all the cores by using libretro-fetch.sh
Fetch all cores:
1 |
|
Fetch one core:
1 |
|
Note
Replace corename with the name of the core you want to fetch, for example gambatte
Building Cores¶
LibRetro Super¶
The easiest way to build all the cores is to use libretro-build.sh from within libretro-super's source tree:
1 |
|
In case you only want to build one and/or more cores instead of all, you can specify the cores you want to build after the first command in no particular order:
1 |
|
Once compilation has finished, you can find the libretro cores inside dist/unix.
Manual Fetching and Compilation¶
Get the core's source tree. As an example we'll use fceumm
1 |
|
Then compile the core:
1 2 |
|
Optionally strip the build product:
1 |
|
Most cores will build with these instructions. You might need to browse to a subdirectory in some cases.