Created by: naakkapeddi
This is as far as I've gotten with cross-compiling performance_test.
Generate SYSROOT based on ROS instructions (
https://github.com/ros2/ros2_documentation/blob/master/source/Tutorials/Cross-compilation.rst#cross-compiling-ros2
)
Set SYSROOT variable to generated sysroot
Set TOOLCHAIN_FILE for aarch64 compiler, linker, etc
(i.e.)
set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER /usr/bin/aarch64-linux-gnu-g++)
mkdir perf_test_ws
cd
perf_test_ws
Clone performance test and osrf_testing_tools
colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN_FILE}"
The sysroot I am using is Ubuntu Bionic w/
libboost-all-dev
package installed.
This is the error message I am recieving
Starting >>> osrf_testing_tools_cpp
-- Setting C Standard to 11.
-- Setting C++ Standard to 14.
-- Setting SECURITY to ON.
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc
-- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++
-- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- googletest version '1.8.0' selected, of versions: '1.8.0'
-- building googletest from '/home/naveen.akkapeddi/grand_central/perf_test_ws/src/osrf_testing_tools_cpp/osrf_testing_tools_cpp/vendor/google/googletest/release-1.8.0.tar.gz'...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/naveen.akkapeddi/grand_central/perf_test_ws/build/osrf_testing_tools_cpp/googletest-1.8.0-extracted
Scanning dependencies of target googletest
[ 11%] Creating directories for 'googletest'
[ 22%] Performing download step (verify and extract) for 'googletest'
-- verifying file...
file='/home/naveen.akkapeddi/grand_central/perf_test_ws/src/osrf_testing_tools_cpp/osrf_testing_tools_cpp/vendor/google/googletest/release-1.8.0.tar.gz'
-- verifying file... done
-- extracting...
src='/home/naveen.akkapeddi/grand_central/perf_test_ws/src/osrf_testing_tools_cpp/osrf_testing_tools_cpp/vendor/google/googletest/release-1.8.0.tar.gz'
dst='/home/naveen.akkapeddi/grand_central/perf_test_ws/build/osrf_testing_tools_cpp/googletest-1.8.0-extracted/googletest-1.8.0-src'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 33%] No patch step for 'googletest'
[ 44%] No update step for 'googletest'
[ 55%] No configure step for 'googletest'
[ 66%] No build step for 'googletest'
[ 77%] No install step for 'googletest'
[ 88%] No test step for 'googletest'
[100%] Completed 'googletest'
[100%] Built target googletest
-- Found PythonInterp: /usr/bin/python (found version "2.7.12")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/naveen.akkapeddi/grand_central/perf_test_ws/build/osrf_testing_tools_cpp
Scanning dependencies of target gtest
Scanning dependencies of target test_runner
Scanning dependencies of target memory_tools
[ 4%] Building CXX object src/test_runner/CMakeFiles/test_runner.dir/main.cpp.o
[ 8%] Building CXX object googletest-1.8.0-extracted/googletest-1.8.0-build/googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[ 12%] Building CXX object src/memory_tools/CMakeFiles/memory_tools.dir/implementation_monitoring_override.cpp.o
[ 16%] Building CXX object src/memory_tools/CMakeFiles/memory_tools.dir/memory_tools_service.cpp.o
[ 20%] Building CXX object src/memory_tools/CMakeFiles/memory_tools.dir/is_working.cpp.o
[ 24%] Building CXX object src/memory_tools/CMakeFiles/memory_tools.dir/testing_helpers.cpp.o
[ 28%] Building CXX object src/memory_tools/CMakeFiles/memory_tools.dir/custom_memory_functions.cpp.o
[ 32%] Building CXX object src/memory_tools/CMakeFiles/memory_tools.dir/monitoring.cpp.o
[ 36%] Building CXX object src/memory_tools/CMakeFiles/memory_tools.dir/initialize.cpp.o
[ 40%] Building CXX object src/memory_tools/CMakeFiles/memory_tools.dir/stack_trace.cpp.o
[ 44%] Building CXX object src/memory_tools/CMakeFiles/memory_tools.dir/verbosity.cpp.o
[ 48%] Building CXX object src/memory_tools/CMakeFiles/memory_tools.dir/register_hooks.cpp.o
[ 52%] Linking CXX executable test_runner
[ 52%] Built target test_runner
[ 56%] Linking CXX shared library libmemory_tools.so
[ 56%] Built target memory_tools
Scanning dependencies of target memory_tools_interpose
[ 60%] Building CXX object src/memory_tools/CMakeFiles/memory_tools_interpose.dir/memory_tools.cpp.o
[ 64%] Linking CXX shared library libmemory_tools_interpose.so
[ 64%] Built target memory_tools_interpose
[ 68%] Linking CXX static library libgtest.a
[ 68%] Built target gtest
Scanning dependencies of target gtest_main
[ 72%] Building CXX object googletest-1.8.0-extracted/googletest-1.8.0-build/googlemock/gtest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
[ 76%] Linking CXX static library libgtest_main.a
[ 76%] Built target gtest_main
Scanning dependencies of target test_memory_tools
Scanning dependencies of target assert_env_vars
Scanning dependencies of target test_parse_environment_variable
[ 80%] Building CXX object test/memory_tools/CMakeFiles/test_memory_tools.dir/test_memory_tools.cpp.o
[ 84%] Building CXX object test/test_runner/CMakeFiles/test_parse_environment_variable.dir/test_parse_environment_variable.cpp.o
[ 88%] Building CXX object test/test_runner/CMakeFiles/assert_env_vars.dir/assert_env_vars.cpp.o
[ 92%] Linking CXX executable test_parse_environment_variable
[ 92%] Built target test_parse_environment_variable
[ 96%] Linking CXX executable assert_env_vars
[ 96%] Built target assert_env_vars
[100%] Linking CXX executable test_memory_tools
/home/naveen.akkapeddi/grand_central/sysroot_arm64v8_ubuntu_bionic_libssl_boost/usr/lib/aarch64-linux-gnu/libdl.so: undefined reference to `_dl_catch_error@GLIBC_PRIVATE'
/home/naveen.akkapeddi/grand_central/sysroot_arm64v8_ubuntu_bionic_libssl_boost/usr/lib/aarch64-linux-gnu/libdl.so: undefined reference to `_dl_signal_error@GLIBC_PRIVATE'
collect2: error: ld returned 1 exit status
make[2]: *** [test/memory_tools/test_memory_tools] Error 1
test/memory_tools/CMakeFiles/test_memory_tools.dir/build.make:98: recipe for target 'test/memory_tools/test_memory_tools' failed
CMakeFiles/Makefile2:1383: recipe for target 'test/memory_tools/CMakeFiles/test_memory_tools.dir/all' failed
make[1]: *** [test/memory_tools/CMakeFiles/test_memory_tools.dir/all] Error 2
make: *** [all] Error 2
Makefile:138: recipe for target 'all' failed
--- stderr: osrf_testing_tools_cpp
/home/naveen.akkapeddi/grand_central/sysroot_arm64v8_ubuntu_bionic_libssl_boost/usr/lib/aarch64-linux-gnu/libdl.so: undefined reference to `_dl_catch_error@GLIBC_PRIVATE'
/home/naveen.akkapeddi/grand_central/sysroot_arm64v8_ubuntu_bionic_libssl_boost/usr/lib/aarch64-linux-gnu/libdl.so: undefined reference to `_dl_signal_error@GLIBC_PRIVATE'
collect2: error: ld returned 1 exit status
make[2]: *** [test/memory_tools/test_memory_tools] Error 1
make[1]: *** [test/memory_tools/CMakeFiles/test_memory_tools.dir/all] Error 2
make: *** [all] Error 2
Failed <<< osrf_testing_tools_cpp [ Exited with code 2 ]
Summary: 0 packages finished [11.9s]
1 package failed: osrf_testing_tools_cpp
1 package had stderr output: osrf_testing_tools_cpp
2 packages not processed
@esteve