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!

Hi Joshua,

Unfortunately, we don’t officially support PX4 firmware for Navio2. I’d recommend contacting PX4 github/forum with this issue.

Hi polina.buriak,

I upload the 1.9.0dev PX4 firmware to navio2 through “make emlid_navio2_cross”, but the flight under position mode is very bad. I’m wondering if the reason is that “don’t officially support PX4 firmware for Navio2” ?

The URL below is one of my log( I have been tunning the pid using qgc for a week and still can’t make the quadcopter fly well in position mode).
https://review.px4.io/plot_app?log=c6cae95b-6677-4322-bb0d-193d33003541

Best,
yuan wei.

Hi @polina.buriak thank you for the help. I appreciate it! I have created an issue in the repo without much help. Do you know if it is possible to cross-compile from macOS?

Hi @s10030789 Thank you for the response. Are you cross compiling from macOS Mojave? If so, could you help me out ?

Hi @neumonic, I’m not familiar with mac. I follow this website Building the Code · PX4 Developer Guide with ubuntu 16.04, and directly use “make emlid_navio2_cross”, and it works.

1 Like

Thank you @s10030789

Hi Yuan,

Sorry for the delayed response!

We haven’t tested the PX4 firmware on Navio2. However, according to our users, it’s possible to make it work :slight_smile:

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.