Cannot build ROS2 humble (rclcpp) with Android NDK
I'm trying to build ros2 humble release using the Android NDK compiler (v 25) and am receiving issues in trying to build ament_cmake and rclcpp
After following the instructions here for building on Windows 10 (x86): https://docs.ros.org/en/humble/Instal...
At the "Build ROS2 step" I'm trying to run colcon build and specifying the Android NDK as cmake arguments:
colcon build --cmake-args -DCMAKE_TOOLCHAIN_FILE=D:\Android\Sdk\ndk\25.1.8937393\build\cmake\android.toolchain.cmake -DCMAKE_ANDROID_NDK=D:\Android\Sdk\ndk\25.1.8937393 -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=31 -DCMAKE_ANDROID_API=31 -DCMAKE_ANDROID_ARCH_ABI=x86_64 -DCMAKE_STL=c++_shared -DANDROID_TOOLCHAIN=clang --merge-install --packages-up-to rclcpp
I receive the following error:
Starting >>> ament_package
Starting >>> ament_lint
Starting >>> ament_cppcheck
Starting >>> gtest_vendor
Starting >>> gtest
Starting >>> fastcdr
Starting >>> osrf_testing_tools_cpp
Starting >>> google_benchmark_vendor
Starting >>> iceoryx_hoofs
Starting >>> osrf_pycommon
Starting >>> ament_pycodestyle
Finished <<< gtest_vendor [7.31s]
Starting >>> gmock_vendor
Finished <<< gmock_vendor [3.50s]
--- stderr: ament_package
c:\python38\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
---
Finished <<< ament_package [11.1s]
--- stderr: ament_lint
c:\python38\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
---
Finished <<< ament_lint [11.2s]
--- stderr: ament_cppcheck
c:\python38\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
---
Finished <<< ament_cppcheck [11.3s]
Starting >>> ament_cmake_core
Starting >>> ament_flake8
--- stderr: ament_pycodestyle
c:\python38\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
---
Finished <<< ament_pycodestyle [11.3s]
--- stderr: osrf_pycommon
c:\python38\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
---
Finished <<< osrf_pycommon [11.5s]
--- stderr: google_benchmark_vendor
CMake Error at C:/Program Files/CMake/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:62 (message):
The C++ compiler
"D:/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: D:/ros2-humble/build/google_benchmark_vendor/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/MSBuild/Current/Bin/MSBuild.exe cmTC_e6ad5.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=16.0 /v:m && Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
ANDROID_HOME=
ANT_HOME=
JAVA_HOME=
NDK_ROOT=
testCXXCompiler.cxx
TRACKER : error TRK0005: Failed to locate: "clang.exe". The system cannot find the file specified. [D:\ros2-humble\build\google_benchmark_vendor\CMakeFiles\CMakeTmp\cmTC_e6ad5.vcxproj]
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
---
Failed <<< google_benchmark_vendor [11.7s, exited with code 1]
Aborted <<< ament_cmake_core [0.47s]
Aborted <<< ament_flake8 [0.45s]
Aborted <<< ...