Godot 4 build for Raspberry pi 4

From my limited understanding, you should in theory be able to create an export template that will compile a binary using the tool chain for the raspberry-pi architecture. These would include c++ compilers for the that specific ARM architecture, there are multiple architectures typical under the umbrella of AArch64 in build systems.

The harder part is that when you build Godot engine yourself it will default to looking at the OS environment and already installed dev libraries. This is done with the assumption that you will run output binary in the arch of the system in which you are building.

So in order to build for the raspberry-pi arm architecture you need specific compilers for that arch. you typically have to seek these out yourself. (Unless you just use the raspberry-pi itself which should have all these things already). But to build on an x86 machine for another architecture is a process called cross compiling.

For export templates the same thing applies, although I have never looked deeply at the export system. I think you could find an existing template that will work for the AArch64/PI and can be executed from your personal computer. I presume the template itself encapsulates the tool chain because you can export for mobile/Android, so your os environment is not used in this case.

Maybe @Calinou could point to a PI compatible export template?

Fyi, If you see an architecture that just says ARM I think that typically means it is arm 32 bit. AArch64/arm64 is arm 64 bit. This also matters. They can also have a suffix like “v7” which relates to a specific arm CPU architecture.

Godot 4.2.1 and later already include Linux ARM export templates, but you need to enable them in the Linux export preset in your project. By default, x86_64 is exported.

Note that Raspberry Pi 4’s reference OS, Raspbian, was installed as 32-bit ARM until early 2023, so if your installation is older than that, you need to export to arm32 and not arm64. (Of course, this doesn’t apply if you use a 64-bit ARM distribution other than Raspbian.) This is not an issue for Raspberry Pi 5 which shipped with a 64-bit ARM OS on day 1.

2 Likes

Update! I managed to get it running. The issue seemed to be that RetroPie which we tried to run it on did not have the proper drivers. Changing to Raspbian allows the software to run.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.