Unable to build px4 current version by cross-compilation on macOS Mojave 10.14.6

Whenever I run the make emlid_navio2_cross command in attempt to build the current master branch of the repository, I receive the following errors.

Firmware ⇨ ⇨ ⇨  △ △ △  👾  ⚡  || master || ⚡  👾   ⇨ ⇨ ⇨  make emlid_navio2_cross
-- PX4 version: v1.10.0-beta2-37-gc8f3f07ff7
-- PX4 config file: /Firmware/boards/emlid/navio2/cross.cmake
-- PX4 config: emlid_navio2_cross
-- PX4 platform: posix
-- PX4 lockstep: disabled
-- cmake build type: RelWithDebInfo
-- The CXX compiler identification is unknown
-- The C compiler identification is unknown
-- The ASM compiler identification is unknown
-- Found assembler: arm-linux-gnueabihf-gcc
CMake Error at CMakeLists.txt:189 (project):
  The CMAKE_CXX_COMPILER:

    arm-linux-gnueabihf-g++

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:189 (project):
  The CMAKE_C_COMPILER:

    arm-linux-gnueabihf-gcc

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:189 (project):
  The CMAKE_ASM_COMPILER:

    arm-linux-gnueabihf-gcc

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "ASM" or the CMake cache entry CMAKE_ASM_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


-- Warning: Did not find file Compiler/-ASM
-- Configuring incomplete, errors occurred!
See also `/Firmware/build/emlid_navio2_cross/CMakeFiles/CMakeOutput.log`.
See also `/Firmware/build/emlid_navio2_cross/CMakeFiles/CMakeError.log`.
Error: `/Firmware/build/emlid_navio2_cross` is not a directory
make: *** [emlid_navio2_cross] Error 1

I’m not 100% sure what seems to be going on here, but I can only build with make px4_sitl jmavsim not gazebo either.

To note:

The current path to my gcc &g++ are as follows:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++

I have also ran the sequence below in attempt to fix:
make clean
make submodules clean
git submodule update --init --recursive

Similarly, also running this:
sudo rm -rf /Library/Developer/CommandLineTools
sudp xcode-select --install
sudo xcode-select --reset

As well as this:
brew unlink gcc-arm-none-eabi
brew install gcc-arm-none-eabi-74

Any help would be greatly appreciated. Thank you!

Not sure if this is the same problem but there’s an issue reported here https://github.com/PX4/Firmware/issues/13123

Are you trying this with recent master?

Hi @rroche thank you for your response. I checked out the thread, and it doesn’t seem to be it. Yes, this is with the current, most recent master. Someone on the github repo said the following:

You are trying to cross-compile without the cross compilation toolchain available. You need gcc that can compile for RPi.

CMake Error at CMakeLists.txt:189 (project):
  The CMAKE_CXX_COMPILER:

    arm-linux-gnueabihf-g++

  is not a full path and was not found in the PATH.

but i have brew TAP PX4/px4 as well as the arm-linux-gnueabihf-binutils and when I run a search in brew for the compilers I have them. (Please see the screen shots.)

Is there something I am missing? I would assume that following the instructions for the macOS developer environment set up would be all i need to build and compile on the mac in order to build the file and then upload to the rpi.

Hello,
I am having the exact same issue and haven’t found much help online. Did you find a solution?

Having the same issue, any solutions yet?

Are you also on macOS Mojave? 10.14.6?