Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| compile_batocera.linux [2023/03/12 23:10] – [Easy compilation] add commands for cleaning up your build directory lbrpdx | compile_batocera.linux [2026/04/03 02:04] (current) – dmanlfc | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| ===== Install prerequisites ===== | ===== Install prerequisites ===== | ||
| - | Choose either [[# | + | Make sure you have a reasonably fast CPU, and at least **8GB of RAM** (even **12GB+** if you need to compile MAME). If you have a CPU with 8 cores/16 threads |
| - | + | ||
| - | Make sure you have a reasonably fast CPU, and at least **8GB of RAM** (even **12GB+** if you need to compile MAME). If you have a CPU with 8 cores or more (lucky you!), you might need more than 16 GB RAM to compile batocera.linux with all threads in parallel. You also need **between 80GB and 130GB of free disk space** for each platform you intend to compile for in order to download and compile the final Batocera image. | + | |
| For reference, here are some **estimates** of the space required for building certain platforms: | For reference, here are some **estimates** of the space required for building certain platforms: | ||
| - | * **x86_64**: | + | |
| - | * **bcm2837** (rpi4): 80 GB | + | |
| - | * **bcm2836** (rpi3): 70 GB | + | * **bcm2712** (rpi5): 105GB for Batocera |
| + | * **bcm2711** (rpi4): 103GB for Batocera 41 | ||
| + | * **bcm2837** (rpi3): 80 GB | ||
| + | * **bcm2836** (rpi2): 130 GB for Batocera 40 | ||
| + | * **rk3326**: 74GB for Batocera 40 | ||
| + | * **rk3399**: 45GB for Batocera 40 | ||
| * **s905gen2** (radxa zero): 65 GB | * **s905gen2** (radxa zero): 65 GB | ||
| * **rpizero**: | * **rpizero**: | ||
| Line 23: | Line 26: | ||
| If compiling inside of a VM, you may need to set its CPU type to '' | If compiling inside of a VM, you may need to set its CPU type to '' | ||
| </ | </ | ||
| + | |||
| + | ==== Install dev tools ==== | ||
| + | |||
| + | If never having compiled on the machine before you may need to install the various miscellaneous dev tools needed like '' | ||
| + | |||
| + | * Ubuntu: | ||
| + | * To install the basic dev tools: '' | ||
| + | * Fedora: | ||
| + | * To check the packages that will be installed with the group, run: '' | ||
| + | * To install them: '' | ||
| + | * Arch: | ||
| + | * To install the dev tools: '' | ||
| + | |||
| + | If you wish to be frugal, the only essential packages on the host OS for compiling Batocera in Docker are '' | ||
| ==== Docker ==== | ==== Docker ==== | ||
| - | If you already have a working Docker installation on your Linux system, | + | If you already have a working Docker installation on your Linux system, skip to the [[compile_batocera.linux# |
| - | Otherwise, the first step is to install Docker on your machine. | + | Each OS and Linux distribution has a particular way to install Docker. |
| - | //Please note that most developers use Ubuntu Linux to compile batocera.linux. In January 2022, Docker on Windows was not stable enough to compile Batocera.// | + | //Please note that most developers use Docket on Ubuntu Linux to compile batocera.linux. In January 2022, Docker on Windows was not stable enough to compile Batocera.// |
| In March 2020, with the Docker container running as non-root (regular user), you can compile Batocera on MacOS Mojave 10.14 (Darwin 18.0.0). | In March 2020, with the Docker container running as non-root (regular user), you can compile Batocera on MacOS Mojave 10.14 (Darwin 18.0.0). | ||
| * Linux Ubuntu/ | * Linux Ubuntu/ | ||
| - | * Installing from the Distribution packages is not recommended. | + | * Installing |
| * To be able to run docker without root privileges don't forget to add your user to the //docker// group: | * To be able to run docker without root privileges don't forget to add your user to the //docker// group: | ||
| + | * Fedora: | ||
| + | * Installing Docker from the snap/ | ||
| + | * To be able to run Docker without root privileges and at boot, don't forget to add your user to the //docker// group. Fedora' | ||
| + | sudo gpasswd -a ${USER} docker | ||
| + | sudo systemctl restart docker | ||
| + | newgrp docker</ | ||
| + | * To start the docker daemon at boot: '' | ||
| * Linux Solus: '' | * Linux Solus: '' | ||
| * Arch Linux: '' | * Arch Linux: '' | ||
| * (for reference) MacOS: see [[https:// | * (for reference) MacOS: see [[https:// | ||
| * (for reference) Windows: see [[https:// | * (for reference) Windows: see [[https:// | ||
| - | |||
| - | ==== Direct Compilation ==== | ||
| - | |||
| - | The way to install the necessary packages vary for each Linux distribution. You can find the necessary packages for Ubuntu below. | ||
| - | |||
| - | === Ubuntu 18.04 === | ||
| - | |||
| - | May also work with Ubuntu 16.04. | ||
| - | |||
| - | < | ||
| - | sudo apt-get install build-essential git libncurses5-dev libssl-dev mercurial texinfo zip default-jre imagemagick subversion hgsubversion autoconf automake bison scons libglib2.0-dev bc mtools u-boot-tools flex wget cpio dosfstools libtool | ||
| - | sudo dpkg --add-architecture i386 | ||
| - | sudo apt-get update | ||
| - | sudo apt-get install libc6:i386 libncurses5: | ||
| - | </ | ||
| - | |||
| - | === Ubuntu 20.04 === | ||
| - | |||
| - | Includes requirements for some experimental packages. | ||
| - | |||
| - | < | ||
| - | sudo apt-get install build-essential git libncurses5-dev libssl-dev mercurial texinfo zip default-jre imagemagick subversion autoconf automake bison scons libglib2.0-dev bc mtools u-boot-tools flex wget cpio dosfstools libtool gcc-multilib g++-multilib python3-pip | ||
| - | sudo dpkg --add-architecture i386 | ||
| - | sudo apt-get update | ||
| - | sudo apt-get install libc6:i386 libncurses5: | ||
| - | pip3 install conan | ||
| - | </ | ||
| ===== Preparations ===== | ===== Preparations ===== | ||
| Line 125: | Line 122: | ||
| **2. Start up Docker** | **2. Start up Docker** | ||
| - | Once Docker | + | If you haven' |
| <code bash> | <code bash> | ||
| Line 131: | Line 128: | ||
| </ | </ | ||
| - | then reboot in order to make sure both the service is running | + | then reboot in order to make sure both the service is running. |
| **3. Install build environment** | **3. Install build environment** | ||
| <code bash> | <code bash> | ||
| - | make batocera-docker-image | + | make build-docker-image |
| </ | </ | ||
| Line 182: | Line 179: | ||
| <code bash> | <code bash> | ||
| make x86_64-build | make x86_64-build | ||
| + | </ | ||
| + | |||
| + | If you have a lot of cores/ | ||
| + | |||
| + | <code bash> | ||
| + | PARALLEL_BUILD=1 make x86_64-build | ||
| </ | </ | ||
| Line 278: | Line 281: | ||
| Of course '' | Of course '' | ||
| - | |||
| - | ==== Traditional compilation method ==== | ||
| - | |||
| - | Of course you can still use out of tree builds to compile Batocera. So, for x86_64, you can do the following: | ||
| - | |||
| - | <code bash> | ||
| - | make O=$PWD/ | ||
| - | cd output/ | ||
| - | make | ||
| - | </ | ||
| - | |||
| - | Source tree will stay pristine and we be reused for other builds following the same procedure with a different output directory. For example: | ||
| - | |||
| - | <code bash> | ||
| - | make O=$PWD/ | ||
| - | cd output/rpi3 | ||
| - | make | ||
| - | </ | ||
| - | |||
| - | Then, you can take some time for a coffee (or two, or two hundreds actually). Depending on how powerful your CPU is, how much RAM you have, and how fast your SSD/HDD is, compiling a whole Batocera system can take many hours. Don't forget, it's the full OS with all the emulators that we are compiling here, it's not a small task. | ||
| - | |||
| - | Please also mind that the process will take a significant amount of space, **so ensure to have between 50GB (RPi) and 150+GB (x86_64) of free space on that partition**. | ||
| ===== Locating the image ===== | ===== Locating the image ===== | ||
| Line 308: | Line 289: | ||
| For instance: '' | For instance: '' | ||
| - | You can then flash it with Etcher | + | You can then flash it with Raspberry Pi Imager |
| <code bash> | <code bash> | ||
| - | gunzip output/ | + | make DEV=/dev/TARGETDEVICE x86_64-flash |
| - | dd if=output/images/batocera/ | + | |
| </ | </ | ||
| Line 348: | Line 328: | ||
| <code bash> | <code bash> | ||
| - | cd output/ | + | make x86_64-source |
| - | make source | + | |
| </ | </ | ||
| | | ||
| Line 367: | Line 346: | ||
| <code bash> | <code bash> | ||
| - | for i in output/ | + | for i in output/ |
| </ | </ | ||
| Line 515: | Line 494: | ||
| | | ||
| └─ xa-2.3.11.tar.gz | └─ xa-2.3.11.tar.gz | ||
| + | </ | ||
| + | |||
| + | This can also happen when switching to a brand new Batocera version that you are compiling for x86_64. There is a rather large wine/wow64 package, '' | ||
| + | |||
| + | ==== When compiling under Docker, sometimes wget hangs with no response ==== | ||
| + | |||
| + | This can happen if the MTU inside Docker isn't aligned with the MTU of your system. Check the **mtu** values of the host system network interface and the docker interface, through '' | ||
| + | |||
| + | For example, if you have a Wiregard interface, it can have a lower MTU than the default 1500 value. Let's say you have a Wiregard interface with an MTU value of 1420: then you need to put the Docker MTU at the same value by editing/ | ||
| + | |||
| + | < | ||
| + | { | ||
| + | " | ||
| + | } | ||
| </ | </ | ||
- compile_batocera.linux.1678662623.txt.gz
- Last modified: 3 years ago
- by lbrpdx