PX4-Autopilot: 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

Any help would be greatly appreciated. Thank you!

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 24 (14 by maintainers)

Most upvoted comments

You need to reset all directories that you’ve touched with the sudo command to your user (or delete them). You have now files that are owned by the super user.

I will close this issue - the things we’re discussing here (like Mac OS file permissions) are trivial system level issues that you can read up on sites like Stackoverflow and this is not a support forum. Please post to the PX4 user forum and post the link here and some might still give you pointers.

But what you’re trying is unsupported, so it is not an issue. We have a very small team and that team needs to focus its energy - so even when something seems possible (like running cross-compilation on Mac OS) we still might not spend time on it.

If you want to contribute documentation or code changes that make this easier for other Mac OS users, please send pull requests. I’m running on Mac OS myself and I would love that - but I still don’t do it, because I can spend the full year dealing with toolchain issues on different operating systems.

Which is why we’ve chosen a supported set and leave it there. Thanks!

@julianoes I haven’t tried yet. I plan to do this tonight and see if that gets me anywhere. 😦