The reason of the failure seems to be related to ‘ExternalProject_Add’ macro for CONFIGURE_COMMAND doesn’t take cross-compiling arguments into ‘autoconf/automake’ style packages.
By-passing the issue on libcurl_vendor and resource_retriever by ‘–skip-packages’. However, it seems now I am blocked by another strange issue.
[ 82%] Building C object CMakeFiles/std_srvs__rosidl_typesupport_c__pyext.dir/rosidl_generator_py/std_srvs/_std_srvs_s.ep.rosidl_typesupport_c.c.o
In file included from /usr/include/python3.5m/Python.h:8:0,
from /home/sirius/projects/ros2/build_isolated/std_srvs/rosidl_generator_py/std_srvs/_std_srvs_s.ep.rosidl_typesupport_introspection_c.c:4:
/usr/include/python3.5m/pyconfig.h:9:12: fatal error: aarch64-linux-gnu/python3.5m/pyconfig.h: No such file or directory
# include <aarch64-linux-gnu/python3.5m/pyconfig.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
It is complaining that the header file is missing. However, I do have the file install with multiple-arch solution in my Ubuntu 16.04 box.
It seems that ‘ament’ doesn’t take ‘/usr/include’ into its INCLUDE_PATH. I have also tried out to add the path in by define ‘-DCMAKE_INCLUDE_PATH=/usr/include’ which was rejected by ‘amend’.
However, ‘ExternalProject_Add’ macro could not take toolchain settings into CMake based vendor package. That is the reason why ‘resource_retriever’ package is skipped. I may spend some time to look into the issue.
I am working on Jetson TX2 board, which has Ubuntu 16.04 arm64 installed. I think I can ‘rsync’ to fetch back the rootfs and try to cross-compile against.
I am not family with ‘polly’ and ‘docker’ but ‘ros2_raspbian_tools’ looks pretty good. If it could work with any rootfs rather than raspbain only that will be great.
Hmmmm, if it is about a python publish, will it work with ‘multiarch’ enabled Ubuntu box. What I am trying to do is about to install ‘libpython3-dev:arm64’ package for python dev headers and libs. However, it seems ‘ament’ cannot find them in ‘/usr/include’ or ‘/usr/lib’.
Yeah, you’ll need python3-dev:arm64 because it contains the pkgconfig files for Python3 that ament uses to “discover” the location of the Python headers and libraries.
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_SYSROOT $ENV{SYSROOT})
# specify the cross compiler
set(CMAKE_C_COMPILER $ENV{CROSS_COMPILE}gcc)
set(CMAKE_CXX_COMPILER $ENV{CROSS_COMPILE}g++)
# where is the target environment
set(CMAKE_FIND_ROOT_PATH ${CMAKE_CURRENT_LIST_DIR}/install)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# This assumes that pthread will be available on the target system
# (this emulates that the return of the TRY_RUN is a return code "0"
set(THREADS_PTHREAD_ARG "0"
CACHE STRING "Result from TRY_RUN" FORCE)
Apt ‘sources.list’
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted
#deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted
#deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted
#deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted
I try to reproduce the cross-compilation of the complete stack and get some issue during the process.
I try to follow esteve approach with docker to build the rootfs based on a arm64v8 ubuntu docker image. The cmake used is similar to the one above, and I’m using esteve “build_ros2.bash” script to trigger the build.
During the process, I got the following error:
fatal error: Eigen/Core: No such file or directory #include <Eigen/Core>
CMake ignore the manually specified location : “DEIGEN3_INCLUDE_DIR=”${RASPBERRYPI_CROSS_COMPILE_SYSROOT}/usr/include/eigen3"
and use the default “/usr/include” path:
– Using Eigen3 include dirs: /usr/include/eigen3
I’m struggling to understand why CMake ignore the specified path… Any idea ?
Hi…i am a new user here. As per my knowledge the 64-bit ARM environment is relatively new. This means that most applications, including ROS, need to be ported to the new processor. For a complicated application like ROS, this may necessitate a variety of code and environment changes to support the new computer architecture.
There is no issue to build ROS2 for aarch64. You can follow the wiki instruction on your aarch64 machine and build the complete stack, it will just take some time =)
For cross-compilation, you can build a subset of ROS2 by following the instruction here. @jcadam and @esteve already have successfully cross-compile the complete ROS2 for raspi (arm 32) and the Jetson TX2 (arm 64).
FYI to the community, none of the above mentioned approaches work with the release of Crystal without a good deal of digging into the scripts to address moved or added dependencies like python-catkin-pkg-modules, and others. At least I haven’t been able to find a working solution…so I’m going at it from scratch. As soon as I have it, I’ll post.
A new documentation page just get merged explaining how to achieve cross-compilation of the Crystal release, based on the assets available at ros2/cross_compile
Please let me know if you have any issue with it !