Crosscompile to ARM (Raspberry)

Hey @johngalt91.

Whenever I enabled #define JUCE_USE_SIMD 1 I would get a compilation error. Updating from Juce 5.3 to the latest I resolved my problem after all. I believe JUCE_USE_ARM_NEON is then activated automatically, but it probably does not hurt to set it anyway.

I am not rebuilding the entire OS every time if that is what you are concerned about, it only needs to be done once (there is a handy tool named “ccache” which can save a lot of time in case you do rebuild the OS. The first time took several hours).
You set up a buildroot “package” and tell it where your CMake/Makefile is, here are the docs:
https://buildroot.org/downloads/manual/manual.html#_infrastructure_for_cmake_based_packages

To build from a local source instead of fetching from the web, add something like this in your mk file:

PIQUENCER_SITE = /music/juce/piquencer
PIQUENCER_SITE_METHOD = local

I recompile my app in buildroot after every change, the compilation time is not very long and certainly much faster than compiling on the RPI itself. One big drawback however is that buildroot does not allow building gdb for the RPI, instead it is suggested to do remote debugging from a PC.

Does the Projucer-App support building in Linux? The last time I checked it did not …

For the ARM flags I referred to this article https://gist.github.com/fm4dd/c663217935dc17f0fc73c9c81b0aa845

So these gcc flags do compile for me on RPI 3 B (I tested in raspbian gcc as well as buildroot) like suggested by the article
-mcpu=cortex-a53 -mfpu=neon-fp-armv8 -mneon-for-64bits -mfloat-abi=hard -mtune=cortex-a53

2 Likes