Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help cross compiling for ros2_java/Android #117

Closed
mclayton7 opened this issue Jun 29, 2021 · 2 comments
Closed

Help cross compiling for ros2_java/Android #117

mclayton7 opened this issue Jun 29, 2021 · 2 comments

Comments

@mclayton7
Copy link

I'm looking into updating the https://github.com/ros2-java/ros2_java project to work with ROS2 Galactic, and the Android build is failing because it's trying to cross compile foonathan_memory and running the ARM64 cross compiled binary on x64. I've also read about using qemu as an emulator in these scenarios (#60)

I'm new to the ROS2 and ament ecosystem, so forgive me if this is a dumb question, but is there a way to pass arguments to ament such that qemu would get passed to the foonathan cmake scripts?

PR for Galactic

ros2-java/ros2_java#187

Build Log

Cloning into 'foo_mem-ext'...
HEAD is now at c619113 Whitespace clean up (#70)
Submodule 'cmake/comp' (https://github.com/foonathan/compatibility.git) registered for path 'cmake/comp'
Cloning into '/home/runner/work/ros2_java/ros2_java/ros2_java_ws/build/foonathan_memory_vendor/foo_mem-ext-prefix/src/foo_mem-ext/cmake/comp'...
/bin/sh: 1: ../tool/nodesize_dbg: Exec format error
make[5]: *** [src/CMakeFiles/foonathan_memory.dir/build.make:74: src/container_node_sizes_impl.hpp] Error 2
make[4]: *** [CMakeFiles/Makefile2:115: src/CMakeFiles/foonathan_memory.dir/all] Error 2
make[3]: *** [Makefile:136: all] Error 2
make[2]: *** [CMakeFiles/foo_mem-ext.dir/build.make:86: foo_mem-ext-prefix/src/foo_mem-ext-stamp/foo_mem-ext-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/foo_mem-ext.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
---
Failed   <<< foonathan_memory_vendor [11.2s, exited with code 2]
Aborted  <<< rosidl_typesupport_interface [5.45s]

Summary: 47 packages finished [38.5s]
  1 package failed: foonathan_memory_vendor
  1 package aborted: rosidl_typesupport_interface
  36 packages had stderr output: ament_cmake ament_cmake_copyright ament_cmake_core ament_cmake_cppcheck ament_cmake_cpplint ament_cmake_export_definitions ament_cmake_export_dependencies ament_cmake_export_include_directories ament_cmake_export_interfaces ament_cmake_export_libraries ament_cmake_export_link_flags ament_cmake_export_targets ament_cmake_flake8 ament_cmake_gmock ament_cmake_gtest ament_cmake_include_directories ament_cmake_libraries ament_cmake_lint_cmake ament_cmake_pep257 ament_cmake_pytest ament_cmake_python ament_cmake_ros ament_cmake_target_dependencies ament_cmake_test ament_cmake_uncrustify ament_cmake_version ament_cmake_xmllint ament_lint_auto ament_lint_common fastcdr foonathan_memory_vendor gmock_vendor gtest gtest_vendor rosidl_typesupport_interface uncrustify_vendor
  51 packages not processed
Error: Process completed with exit code 2.
@MiguelCompany
Copy link
Contributor

@mclayton7 You almost answered the question yourself. You've taken a look at #60. The important bit is that you should set CMAKE_CROSSCOMPILING_EMULATOR on your cmake toolchain file

@mclayton7
Copy link
Author

This worked, thank-you @MiguelCompany!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants