Closed jmount-boss closed 2 weeks ago
One potential is to cross-compile, rather than use emulation. Zenoh-C cross compile steps are provided here. Summary of steps here:
"-DZENOHC_CUSTOM_TARGET=armv7-unknown-linux-gnueabihf"
top the CMAKE_ARGSament_vendor(zenoh_c_vendor
VCS_URL https://github.com/eclipse-zenoh/zenoh-c.git
VCS_VERSION 548ee8dde0f53a58c06e68a2949949b31140c36c
CMAKE_ARGS
"-DZENOHC_CARGO_FLAGS=${ZENOHC_CARGO_FLAGS}"
"-DZENOHC_CUSTOM_TARGET=armv7-unknown-linux-gnueabihf"
)
# Install arm gcc compiler
apt-get install gcc-arm-linux-gnueabihf
apt-get remove rustc curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.carg/env
rustup target add armv7-unknown-linux-gnueabihf
3. Build
source <path/to/ros2/jazzy>/install/setup.bash
export RUSTFLAGS="-Clinker=arm-linux-gnueabihf-gcc -Car=arm-linux-gnueabihf-ar"
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
Can, and should, the CMakeLists.txt be altered in some way to allow for a command line argument to be provided when running the colcon build command to set the `DZENOHC_CUSTOM_TARGET` flag?
Can, and should, the CMakeLists.txt be altered in some way to allow for a command line argument to be provided when running the colcon build command to set the
DZENOHC_CUSTOM_TARGET
flag?
I think that is a fine option to have in zenoh_c_vendor
. We do something similar in https://github.com/ros2/yaml_cpp_vendor/blob/cb9b3a0cfd15a27e8362ce6deb183e486796f8ec/CMakeLists.txt#L29, for example.
A PR adding that option would be welcome.
Pull request created. Given a solution has been found to the issue, happy for conversation to occur in the PR instead as it is now more around implementation.
Closed with #272
Attempting to compile RMW Zenoh for ARM-HF using Docker Emulation. After creating a ARM-HF (Linux/arm/v7) docker image and running an interactive container emulating the ARM architecture. I get the following error when attempting to build the zenoh_c_vendor package.
Dockerfile
Colcon Build Error
I believe it has to do with the issue outlined here. However, I am not familiar with cargo and unsure on how to apply a solution to the CMakeList.txt within the zenoh_c_vendor package.