I wanted and easy way to cross compile my bela/salt/pepper projects,
a variety of reasons:
- speed (much faster compilations on desktop/laptop)
- workflow improvements (e.g. using my favourite code edit),
- integrate into my normal build projects based on cmake
finally, have v1.0 working... Id be happy for any feedback, or pull requests
https://github.com/TheTechnobear/xcBela
from README...
goals
This project provides a simple to install and use cross compiler environment
simple installation of cross compiling environment
e.g ./install.sh
easy to workflow with target board
e.g xcCompileRun render.cpp
support for cmake, with cmake toolchain
use modern tools
clang-10, llvm, cmake
requirements
supported OS are:
- macOS
- Linux (debian based e.g. deb/ubuntu)
it would be easy to add other linux variants
windows could probably be done using gnu/cygwin tools
however, I dont have the time.... but Im happy to accept pull requests from others π
installation
see install.md
usage
installs and runs by default using
location: ~/xcBela
bela hostname : 192.168.7.2
, default for usb
you can override with environment variables, if using a different bela, or scripts placed somewhere else
e.g.
export XC_IP=salt.local
export XC_ROOT=~/projects/xcBela
note: when these are stored in ~/.xcBela.config
, by install.sh, and xcSetEnv, so only need to be done once, or if you are changing target etc.
setup environment
. $XC_ROOT/xcSetEnv
usage note: . (dot) - do not run as a script directly
commands
xcExec remotecmd - execute command on remote
xcCopy localfile remotefile - copy local file to remote
xcCompile patch.cpp - compile single c++ file
xcRun patch - run (local executable) patch on remote
xcCompileRun patch.cpp - compile local file and run on remote
xcScope - bring up scope
xcGui - bring up gui
using with cmake
included in this project is a template which can be used as a cmake toolchain,
see cmakefaq.md
using Bela tools
Bela commands
the 'usual' bela command line scripts are also available (and on the path),
e.g. we can disable the ide with
ide.sh stop
Accessing Bela IDE
my main intention is not to use the IDE for development so editing and compiling. but it still has a couple of useful features I will use
(assuming, Ive not disabled ide at that time π )
note: shortcuts assume chromium-browser on linux
Oscilloscope
shortcut: xcScope
this is available directly in a browser using: http://bela.local/scope
Bela Patch GUI
bela now supports web user interfaces
shortcut: xcGui
this can be access in the browser using: http://bela.local/gui
Credits & Resources
article on cross-compiling on mac
cross compile script from by Andrew Capon, can be found here:
https://github.com/AndrewCapon/OSXBelaCrossCompiler
Bela wiki on remote compilation with Eclipse
https://github.com/BelaPlatform/Bela/wiki/Compiling-Bela-projects-in-Eclipse