JUCE Cross Compilation for Pi4

Hi there,

I’m trying to build a JUCE plugin to run on Elk OS Pi4. My setup until now has been all on Mac.

I’m following instructions here and have a make file located on my Mac. All the module global paths in JUCE are relative to my mac folders where I have the Elk specific Projucer built in Xcode.

To get the toolchain installed, I have followed all the instructions here. I have docker setup and the shell script has run and I can see ‘environment-setup-aarch64-elk-linux’ script on the shared samba drive.

What is not clear now is what to do next. From other forum posts it seems people are copying their JUCE plugin and the Elk JUCE fork from their mac to the docker instance, but all the paths in the make file will be relating to my mac. I tried that and just got loads of no such file errors when building.

What are the exact steps to execute cross compilation once docker is setup and the make file is generated on my mac - its not clear from where I should be running commands and how the referencing of JUCE files/folders/modules should be managed?

Thanks so much in advance,
R

Hi, I’ve bee doing this with no problem following the Docker instructions. I made some Python scripts to automate the cross-compilation so that you don’t need to use samba all the time (only for the first installation steps) and well, to make cross-compiling easy for me. The script will run the docker container and mount your app code in it to do the cross-compilation.

Here’s my project repository https://github.com/ffont/octopush
It should be fairly easy to adapt to your system. Some hints:

  • Check the “Building for the ELK platform” instructions section. Pay special attention to the configuration of code requirements. You’ll need VST2 sdk as well. Instead of my custom JUCE fork you could probably use ELK’s “official” one. Mine is based on ELK’s, I just updated it to the version of JUCE I needed for my project.
  • Check the JUCE project configuration for the “ELKAudioOS” target (specially some libraries that you need to link, etc). You’ll need to apply the same to your project. Note that most paths are relative so there are no problems with paths. Some are absolute but relate to the docker container paths that will be mounted by the script.
  • Copy the octopush/scripts folder to your project.
  • Adapt paths in the compile method of fabfile.py. Also you might be interested in adapting the send method so that you can easily deploy your plugin to the platform. Should be much simpler that for my app because I have external things that need to be added to the board.
  • Also adapt paths at the end of octopush/scripts/custom-esdk-launch.py.

After you do all the steps you should be able to cross compile simply running fab compile. I’ve been using this and it is very handy. I’d be nice to do some more work to make this system more generic, maybe has its own repository, but I have not had time to do that.

This is tested with RPI4 and ELK Audio OS 0.7.1.

I wrote this all very quickly, let me know if you find any issues or need more info!

1 Like