Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
compile_batocera.linux [2024/09/04 15:54] – [Install prerequisites] Updated about the disk requirements with recent builds lbrpdxcompile_batocera.linux [2026/04/03 02:04] (current) dmanlfc
Line 8: Line 8:
  
 ===== Install prerequisites ===== ===== Install prerequisites =====
- 
-Choose either [[#docker|Docker]] or [[#direct_compilation|Direct Compilation]]. 
  
 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 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 250GB of free disk space** for each platform you intend to compile for in order to download and compile the final Batocera image. 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 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 250GB of free disk space** for each platform you intend to compile for in order to download and compile the final Batocera image.
Line 19: Line 17:
   * **bcm2711** (rpi4): 103GB for Batocera 41   * **bcm2711** (rpi4): 103GB for Batocera 41
   * **bcm2837** (rpi3): 80 GB   * **bcm2837** (rpi3): 80 GB
-  * **bcm2836** (rpi2): 70 GB +  * **bcm2836** (rpi2): 130 GB for Batocera 40
   * **rk3326**: 74GB for Batocera 40   * **rk3326**: 74GB for Batocera 40
   * **rk3399**: 45GB for Batocera 40   * **rk3399**: 45GB for Batocera 40
Line 36: Line 34:
     * To install the basic dev tools: ''sudo apt-get install build-essential''     * To install the basic dev tools: ''sudo apt-get install build-essential''
   * Fedora:   * Fedora:
-    * check the packages that will be installed with the group, run: ''%%sudo dnf group info "Development Tools" "Development Libraries"%%''+    * To check the packages that will be installed with the group, run: ''%%sudo dnf group info "Development Tools" "Development Libraries"%%''
     * To install them: ''%%sudo dnf groupinstall "Development Tools" "Development Libraries"%%''     * To install them: ''%%sudo dnf groupinstall "Development Tools" "Development Libraries"%%''
   * Arch:   * Arch:
Line 49: Line 47:
 Each OS and Linux distribution has a particular way to install Docker. 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/Debian:    * Linux Ubuntu/Debian: 
-    * Installing from the Distribution packages is not recommended. Refer to the official documentation instead: [[https://docs.docker.com/engine/install/ubuntu/]]+    * Installing Docker from the Distribution packages is not recommended. Refer to the official documentation instead: [[https://docs.docker.com/engine/install/ubuntu/]]
     * To be able to run docker without root privileges don't forget to add your user to the //docker// group:  ''sudo usermod -aG docker your-user'', then log out and log back in.     * To be able to run docker without root privileges don't forget to add your user to the //docker// group:  ''sudo usermod -aG docker your-user'', then log out and log back in.
   * Fedora:   * Fedora:
-    * Installing from the snap/appimages/flatpak packages is not recommended. Refer to the official documentation instead: [[https://docs.docker.com/engine/install/fedora/]]+    * Installing Docker from the snap/appimages/flatpak packages is not recommended. Refer to the official documentation instead: [[https://docs.docker.com/engine/install/fedora/]]
     * To be able to run Docker without root privileges and at boot, don't forget to add your user to the //docker// group. Fedora's own instructions on how to do so: [[https://developer.fedoraproject.org/tools/docker/docker-installation.html]]. In case those instructions fail, run the following sequentially in the terminal: <code bash>sudo groupadd docker     * To be able to run Docker without root privileges and at boot, don't forget to add your user to the //docker// group. Fedora's own instructions on how to do so: [[https://developer.fedoraproject.org/tools/docker/docker-installation.html]]. In case those instructions fail, run the following sequentially in the terminal: <code bash>sudo groupadd docker
 sudo gpasswd -a ${USER} docker sudo gpasswd -a ${USER} docker
Line 67: Line 65:
   * (for reference) MacOS: see [[https://docs.docker.com/docker-for-mac/]]   * (for reference) MacOS: see [[https://docs.docker.com/docker-for-mac/]]
   * (for reference) Windows: see [[https://store.docker.com/editions/community/docker-ce-desktop-windows]]   * (for reference) Windows: see [[https://store.docker.com/editions/community/docker-ce-desktop-windows]]
- 
-==== 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. 
- 
-<code> 
-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:i386 libstdc++6:i386 
-</code> 
- 
-=== Ubuntu 20.04 === 
- 
-Includes requirements for some experimental packages. 
- 
-<code> 
-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:i386 libstdc++6:i386 
-pip3 install conan 
-</code> 
  
 ===== Preparations ===== ===== Preparations =====
Line 162: Line 133:
  
 <code bash> <code bash>
-make batocera-docker-image+make build-docker-image
 </code> </code>
  
Line 208: Line 179:
 <code bash> <code bash>
 make x86_64-build make x86_64-build
 +</code>
 +
 +If you have a lot of cores/threads on your compilation CPU, and enough RAM to support it, you can accelerate the compilation time by parallelizing package builds with:
 +
 +<code bash>
 +PARALLEL_BUILD=1 make x86_64-build
 </code> </code>
  
Line 304: Line 281:
  
 Of course ''x86_64'' is an example in the commands above, you can use any supported arch. Of course ''x86_64'' is an example in the commands above, you can use any supported arch.
- 
-==== 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/output/x86_64 BR2_EXTERNAL=$PWD -C $PWD/buildroot batocera-x86_64_defconfig 
-cd output/x86_64 
-make 
-</code> 
- 
-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/output/rpi3 BR2_EXTERNAL=$PWD -C $PWD/buildroot batocera-rpi3_defconfig 
-cd output/rpi3 
-make 
-</code> 
- 
-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 =====
  • compile_batocera.linux.1725465294.txt.gz
  • Last modified: 20 months ago
  • by lbrpdx