Cannot build ardupilot on MacOS

I’m trying to build ArduPilot for CubeOrange.

When I run “./waf configure --board CubeOrange” in terminal, I get this error " ChibiOS build requires g++ version 10.2.1 or later, found 5.4.1"

I can confirm g++ version is 13 by running “g++ --version” and seeing “g++ (Homebrew GCC 13.2.0) 13.2.0”
But I still get the upper error " ChibiOS build requires g++ version 10.2.1 or later, found 5.4.1".

Can anyone solve this problem?

I solved by changing compiler from g++ to clang.

You got an issue with your installation as we provide the toolchain to build on STM target.
That is gcc-arm-none-eabi-10.2.1 toolchain. Clang doesn’t work on STM target

For as much effort as seems to be going into building AP on Apple hardware lately, it seems like folks could just spin up a Linux VM and use the included scripts and tools rather than rolling their own compiler infrastructure. The extra time spent due to inefficiencies in VMs probably wouldn’t exceed the amount of time and frustration involved with another solution…

Another possible solution might be to use a cloud hosting service like Linode for a Linux environment. Even the cheapest (almost free) instances are pretty fast.

2 Likes

we got CI working with macos : https://github.com/ArduPilot/ardupilot/blob/master/.github/workflows/macos_build.yml#L154

We probably miss some up to date documentation about how to setup the environment.

But, yes, the linux way will always be the easier and most supported (well depending on what Linux distribution you are using…)

For anyone coming across this problem, this can easily be overcome by specifying the C++ compiler like this:-

CXX=clang++ CC=clang ./waf configure --board SpeedyBeeF405WING