I tried to setup a three layer convolution generator pipeline. Build is failing at linking step.
Example followed in apps/wavelet
running make in build directory results in the following error:
[ 87%] Linking CXX executable conv-3
CMakeFiles/conv-3.dir/main.cpp.o: In function `Halide::Internal::check_introspection(void const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)':
main.cpp:(.text+0xa6): undefined reference to `Halide::Internal::Introspection::get_source_location[abi:cxx11]()'
main.cpp:(.text+0xc3): undefined reference to `Halide::Internal::Introspection::get_variable_name(void const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
CMakeFiles/conv-3.dir/main.cpp.o: In function `HalideIntrospectionCanary::(anonymous namespace)::TestCompilationUnit::TestCompilationUnit()':
main.cpp:(.text+0xa6a): undefined reference to `Halide::Internal::Introspection::test_compilation_unit(bool (*)(bool (*)(void const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)), bool (*)(void
const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&), void (*)())'
./genfiles/halide_rt_host/halide_rt_host.a(halide_rt_host.a.o): In function `halide_spawn_thread':
posix_allocator.cpp:(.text.halide_spawn_thread+0x3d): undefined reference to `pthread_create'
./genfiles/halide_rt_host/halide_rt_host.a(halide_rt_host.a.o): In function `halide_join_thread':
posix_allocator.cpp:(.text.halide_join_thread+0x1a): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
CMakeFiles/conv-3.dir/build.make:96: recipe for target 'conv-3' failed
make[2]: *** [conv-3] Error 1
CMakeFiles/Makefile2:230: recipe for target 'CMakeFiles/conv-3.dir/all' failed
make[1]: *** [CMakeFiles/conv-3.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
CMakeLists.txt
project(three_layer_conv)
cmake_minimum_required(VERSION 3.1.3)
set(HALIDE_DISTRIB_DIR "/home/user/workspace/Halide/distrib")
include(/home/user/workspace/Halide/distrib/halide.cmake)
# Define the wavelet app
add_executable(conv-3 "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp")
set_target_properties(conv-3 PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED YES CXX_EXTENSIONS NO)
target_include_directories(conv-3 PRIVATE "${HALIDE_INCLUDE_DIR}" "${HALIDE_TOOLS_DIR}")
# Define a halide_library() for each generator we have, and link each one into wavelet
#halide_library("conv_3" SRCS "conv_3_generator.cpp")
#file(GLOB GENS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*_generator.cpp")
#foreach(GEN_SRC ${GENS})
# string(REPLACE "_generator.cpp" "" GEN_NAME "${GEN_SRC}")
# halide_library("${GEN_NAME}" SRCS ${GEN_SRC})
# target_link_libraries(conv-3 "${GEN_NAME}" )
#endforeach()
#target_link_libraries(conv-3 PUBLIC "conv_3" pthread)
halide_generator(conv_3.generator SRCS conv_3_generator.cpp)
set(LIB conv_3)
halide_library_from_generator(${LIB} GENERATOR conv_3.generator)
target_link_libraries(conv-3 PRIVATE ${LIB} pthread)
make VERBOSE=1 results in
/usr/bin/c++ -rdynamic CMakeFiles/conv-3.dir/main.cpp.o -o conv-3 ./genfiles/conv_3/conv_3.a -lpthread ./genfiles/halide_rt_host/halide_rt_host.a -ldl
PS: Manually adding -lpthread to the end of the command results in resolution of the pthread linking error.
Do I need to change my CMake file?
Edit : Halide.cmake file can be found here
halide_library, halide_library_from_generator, halide_generator functions are defined in Halide.cmake
Edit 2
OS : Ubuntu 18.04.3 LTS
compiler : cc/c++ (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
linker : GNU ld (GNU Binutils for Ubuntu) 2.30
LLVM : LLVM version 8.0.0 Optimized build
LLVM options : none
Build target : binary
Please add details about:
- OS
- compiler/linker versions being used
- LLVM version being used, and whether it is a binary or built locally
- LLVM options being used
There were two ways in which this problem was solved:
Manually appending -lpthread -lHalide to
/usr/bin/c++ -rdynamic CMakeFiles/conv-3.dir/main.cpp.o -o conv-3 ./genfiles/conv_3/conv_3.a -lpthread ./genfiles/halide_rt_host/halide_rt_host.a -ldl
This solved the linking problem
setting CXX compiler to clang++-8
Related
I am trying to build https://pcl.readthedocs.io/projects/tutorials/en/latest/writing_pcd.html. using the following cmake on my university supercomputer:
include(CMakePrintHelpers)
cmake_minimum_required(VERSION 3.23 FATAL_ERROR)
project(project)
set(Boost_NO_WARN_NEW_VERSIONS 1)
set(VTK_DIR /software/spackages/linux-rocky8-x86_64/gcc-9.5.0/vtk-9.0.3-hfji6zde3waya5ig7cvvsmdylzvmdrty/lib/cmake/vtk-9.0)
find_package(PCL 1.11 REQUIRED COMPONENTS common io search impl)
set(PCL_INCLUDE_DIRS /software/spackages/linux-rocky8-x86_64/gcc-9.5.0/pcl-1.11.1-5ymdvadjcubkab43zen2svmiwnh5hmga/include/pcl-1.11 /software/spackages/linux-rocky8-x86_64/gcc-9.5.0/eigen-3.4.0-odvljtj76a2twpnkiztib7qiod346tjp)
cmake_print_variables(PCL_LIBRARIES)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable(pcd_write_test pcl_view.cpp)
target_link_libraries(pcd_write_test ${PCL_LIBRARIES})
I get the following error:
/home/pcl_view.cpp:5: warning: "_GLIBCXX_USE_CXX11_ABI" redefined
#define _GLIBCXX_USE_CXX11_ABI 0
In file included from /usr/include/c++/8/iostream:38,
from /home/rgadde/courses/CPSC4780/project/pcl_view.cpp:1:
/usr/include/c++/8/x86_64-redhat-linux/bits/c++config.h:2204: note: this is the location of the previous definition
# define _GLIBCXX_USE_CXX11_ABI 1
[100%] Linking CXX executable pcd_write_test
/software/spackages/linux-rocky8-x86_64/gcc-9.5.0/pcl-1.11.1-5ymdvadjcubkab43zen2svmiwnh5hmga/lib/libpcl_io.so: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()#GLIBCXX_3.4.26'
/software/spackages/linux-rocky8-x86_64/gcc-9.5.0/pcl-1.11.1-5ymdvadjcubkab43zen2svmiwnh5hmga/lib/libpcl_io.so: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()#GLIBCXX_3.4.26'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/pcd_write_test.dir/build.make:137: pcd_write_test] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/pcd_write_test.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
How can this error be resolved?
I tried the following:
Added # define _GLIBCXX_USE_CXX11_ABI 0
Compiled using cmake -DCMAKE_CXX_COMPILER=g++ ..
I am writing CMake file for the following command:
g++ --std=c++11 -DLOG2VLEN=7 -DRUN=1 -DASSEMBLY=1 -DBITCODE=1 -I
/home/user/Qualcomm/HALIDE_Tools/2.2.06/Halide/include -fno-rtti -O3 -g
halide_gaussian_hexagon_generate.cpp /home/user/Qualcomm/HALIDE_Tools/2.2.06/Halide/tools/GenGen.cpp
-L/home/user/Qualcomm/HALIDE_Tools/2.2.06/Halide/lib -lHalide -o
bin/halide_gaussian_hexagon_generate -ldl -lpthread -lz -D_GLIBCXX_USE_CXX11_ABI=0
Above compiling works fine but when I wrote it into CMake I got a bunch of error. I am attaching my CMake file here:
cmake_minimum_required(VERSION 3.10)
project(hexagon_polyblur)
set(CMAKE_CXX_STANDARD 11)
set(HEXAGON_DIR $ENV{HALIDE_ROOT})
set(
HEXAGON_FILES_GAUSSIAN
halide_gaussian_hexagon_generate.cpp
${HEXAGON_DIR}/tools/GenGen.cpp # we must include GenGen to compile the generator
)
set(HEXAGON_GEN_GAUSSIAN ${PROJECT_NAME}_hexagon_generate_gaussian)
add_executable(${HEXAGON_GEN_GAUSSIAN} ${HEXAGON_FILES_GAUSSIAN})
target_include_directories(
${HEXAGON_GEN_GAUSSIAN} PRIVATE
${HEXAGON_DIR}/include
${HEXAGON_DIR}/tools
)
target_link_libraries(${HEXAGON_GEN_GAUSSIAN} ${HEXAGON_DIR}/lib/libHalide.so dl pthread z)
target_compile_options(${HEXAGON_GEN_GAUSSIAN} PUBLIC -fno-rtti)
# target_compile_definitions(${HVX_GEN_GAUSSIAN} PRIVATE LOG2VLEN=7 RUN=1 ASSEMBLY=1 BITCODE=1 _GLIBCXX_USE_CXX11_ABI=0)
In CMake, I am using /usr/bin/g++ and /usr/bin/gcc (g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0), which are the same compiler I used for the command line. The ${HEXAGON_DIR} is /home/user/Qualcomm/HALIDE_Tools/2.2.06/Halide. I am not sure why I the CMkae failed here. Part of the error message is shown below:
/usr/bin/ld: CMakeFiles/hexagon_polyblur_hexagon_generate_gaussian.dir /halide_gaussian_hexagon_generate.cpp.o: in function `Halide::Internal::check_introspection(void const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)':
halide_gaussian_hexagon_generate.cpp:(.text+0xaa): undefined reference to `Halide::Internal::Introspection::get_source_location[abi:cxx11]()'
/usr/bin/ld: halide_gaussian_hexagon_generate.cpp:(.text+0xc7): undefined reference to `Halide::Internal::Introspection::get_variable_name(void const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: CMakeFiles/hexagon_polyblur_hexagon_generate_gaussian.dir/halide_gaussian_hexagon_generate.cpp.o: in function `HalideIntrospectionCanary::(anonymous namespace)::TestCompilationUnit::TestCompilationUnit()':
...
Also, when I switch to my original working halide lib that is not for hexagon development, this CMake works. I am not sure whether or not I have a wrong setup in CMake. Any help or suggestion? Thank you!
Have you considered using a more recent version of Halide? Since version 10, we've had good (and constantly improving!) CMake support via find_package.
This should be all you need:
cmake_minimum_required(VERSION 3.16)
project(example)
find_package(Halide REQUIRED)
add_executable(hexagon_gen_gaussian halide_gaussian_hexagon_generate.cpp)
target_link_libraries(hexagon_gen_gaussian PRIVATE Halide::Generator)
Then you can call add_halide_library to run the generator.
Here's a link to our CMake docs for reference: https://github.com/halide/Halide/blob/master/README_cmake.md
You should also look at our example applications (most of them have CMake builds): https://github.com/halide/Halide/tree/master/apps
Feel free to ask any follow-up questions on our GitHub Discussions since I wrote our CMake build/package code.
-L/home/user/Qualcomm/HALIDE_Tools/2.2.06/Halide/lib -lHalide
Translates literally to:
target_link_directories(.... ${THEDIR}/lib)
target_link_libraries(... Halide)
or better:
add_library(halide SHARED IMPORTED)
set_property(TARGET halide PROPERTY
IMPORTED_LOCATION ${THEDIR}/lib/libHalide.so) # or maybe find_library
#
target_link_libraries(... halide) # I wish there would be "target_link_targets"
set(CMAKE_CXX_STANDARD 11)
Better:
set_target_properties(testproject PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED on # maybe also
CXX_EXTENSIONS off
)
I am trying to build a cpp project using CMakeLists.txt.
I installed both Paho Mqtt C and Cpp and their Config.cmake can be found at /usr/local/lib/cmake/eclipse-paho-mqtt-c/eclipse-paho-mqtt-cConfig.cmake and /usr/local/lib/cmake/PahoMqttCpp/PahoMqttCppConfig.cmake in my system.
I am trying to compile the async_publish.cpp. For now I could only get it built running the following CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project("Mqtt Test")
#find_package(PahoMqttCpp REQUIRED)
#find_package(eclipse-paho-mqtt-c REQUIRED)
add_executable(mqtt_client mqtt_client.cpp)
target_link_libraries(mqtt_client pthread crypto ssl paho-mqtt3as paho-mqttpp3)
The problem is ... how do I get the libraries from find_package() and pick the right ${whatever_pkg_LIB} and maybe include files?
I tried
target_link_libraries(mqtt_client pthread crypto ssl ${PAHO_MQTT_C_LIBRARIES} ${PAHO_MQTT_CPP_LIBRARIES})
but it didn't work. I got the following error
CMakeFiles/mqtt_client.dir/mqtt_client.cpp.o: In function `main':
mqtt_client.cpp:(.text+0x3ae): undefined reference to `mqtt::async_client::async_client(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, mqtt::iclient_persistence*)'
mqtt_client.cpp:(.text+0x401): undefined reference to `mqtt::async_client::set_connected_handler(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>)'
mqtt_client.cpp:(.text+0x445): undefined reference to `mqtt::async_client::set_connection_lost_handler(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>)'
mqtt_client.cpp:(.text+0x463): undefined reference to `mqtt::connect_options::connect_options()'
mqtt_client.cpp:(.text+0x4b7): undefined reference to `mqtt::message::message(mqtt::buffer_ref<char>, mqtt::buffer_ref<char>, int, bool)'
mqtt_client.cpp:(.text+0x4ee): undefined reference to `mqtt::will_options::will_options(mqtt::message const&)'
mqtt_client.cpp:(.text+0x507): undefined reference to `mqtt::connect_options::set_will(mqtt::will_options const&)'
mqtt_client.cpp:(.text+0x520): undefined reference to `mqtt::connect_options::set_automatic_reconnect(int, int)'
mqtt_client.cpp:(.text+0x561): undefined reference to `mqtt::connect_options::connect_options(mqtt::connect_options const&)'
mqtt_client.cpp:(.text+0x581): undefined reference to `mqtt::async_client::connect(mqtt::connect_options)'
mqtt_client.cpp:(.text+0x6d1): undefined reference to `mqtt::topic::publish(mqtt::buffer_ref<char>)'
mqtt_client.cpp:(.text+0x798): undefined reference to `mqtt::topic::publish(mqtt::buffer_ref<char>)'
mqtt_client.cpp:(.text+0x8d9): undefined reference to `mqtt::async_client::~async_client()'
mqtt_client.cpp:(.text+0xb9c): undefined reference to `mqtt::async_client::~async_client()'
CMakeFiles/mqtt_client.dir/mqtt_client.cpp.o: In function `mqtt::async_client::disconnect()':
mqtt_client.cpp:(.text._ZN4mqtt12async_client10disconnectEv[_ZN4mqtt12async_client10disconnectEv]+0x45): undefined reference to `mqtt::disconnect_options::disconnect_options()'
collect2: error: ld returned 1 exit status
CMakeFiles/mqtt_client.dir/build.make:95: recipe for target 'mqtt_client' failed
make[2]: *** [mqtt_client] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/mqtt_client.dir/all' failed
make[1]: *** [CMakeFiles/mqtt_client.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
this is the CMakeLists.txt I use to make my project
cmake_minimum_required(VERSION 3.1) set(CMAKE_CXX_STANDARD 20)
project(Farm_interface)
include_directories(${PROJECT_SOURCE_DIR}/include)
add_executable(Farm.exe src/main.cpp src/subscriber.cpp)
target_link_libraries( Farm.exe paho-mqttpp3 paho-mqtt3as pthread)
I am installing gate on centOS 7. Almost finish all installation besides a little error when I try to build installation file in build directory before final installation, make install. Here is the command line response:
100%] Building CXX object CMakeFiles/Gate.dir/source/physics/src/GateXrayBoundaryPB.cc.o
[100%] Building CXX object CMakeFiles/Gate.dir/source/physics/src/GateeMultipleScatteringPB.cc.o
[100%] Building CXX object CMakeFiles/Gate.dir/source/physics/src/GatehMultipleScatteringPB.cc.o
[100%] Linking CXX executable Gate
/usr/bin/ld: warning: libtbb.so.2, needed by /home/xincao/GATE/root_v6.18/lib/libImt.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libvdt.so, needed by /home/xincao/GATE/root_v6.18/lib/libROOTVecOps.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libRDAVIX.so.6.18, needed by /home/xincao/GATE/root_v6.18/lib/libROOTDataFrame.so, not found (try using -rpath or -rpath-link)
/home/xincao/GATE/root_v6.18/lib/libROOTDataFrame.so: undefined reference to `Davix::DavPosix::pread(Davix_fd*, void*, unsigned long, long, Davix::DavixError**)'
/home/xincao/GATE/root_v6.18/lib/libImt.so: undefined reference to `tbb::task_scheduler_init::initialize(int)'
/home/xincao/GATE/root_v6.18/lib/libImt.so: undefined reference to `tbb::task::note_affinity(unsigned short)'
/home/xincao/GATE/root_v6.18/lib/libImt.so: undefined reference to `tbb::internal::throw_exception_v4(tbb::internal::exception_id)'
/home/xincao/GATE/root_v6.18/lib/libImt.so: undefined reference to `tbb::task_group_context::is_group_execution_cancelled() const'
/home/xincao/GATE/root_v6.18/lib/libImt.so: undefined reference to `vtable for tbb::task'
/home/xincao/GATE/root_v6.18/lib/libImt.so: undefined reference to `tbb::task_group_context::reset()'
/home/xincao/GATE/root_v6.18/lib/libImt.so: undefined reference to `tbb::interface7::internal::task_arena_base::internal_terminate()'
...
/home/xincao/GATE/root_v6.18/lib/libROOTDataFrame.so: undefined reference to `Davix::DavPosix::stat(Davix::RequestParams const*, std::string const&, stat*, Davix::DavixError**)'
/home/xincao/GATE/root_v6.18/lib/libROOTDataFrame.so: undefined reference to `Davix::DavixError::getErrMsg() const'
/home/xincao/GATE/root_v6.18/lib/libImt.so: undefined reference to `tbb::interface7::internal::task_arena_base::internal_execute(tbb::interface7::internal::delegate_base&) const'
/home/xincao/GATE/root_v6.18/lib/libROOTDataFrame.so: undefined reference to `Davix::Context::~Context()'
/home/xincao/GATE/root_v6.18/lib/libImt.so: undefined reference to `tbb::internal::allocate_root_with_context_proxy::allocate(unsigned long) const'
collect2: error: ld returned 1 exit status
make[2]: *** [Gate] Error 1
make[1]: *** [CMakeFiles/Gate.dir/all] Error 2
make: *** [all] Error 2
Does anyone can help? Any reply will be highly appreciated!!
Thanks!
It is because the geant4.sh script in the Geant4 bin has not been run. This sets up the LD_LIBRARY_PATH variable which then allows these libraries to be found. (Note that you will need the data from CERN in order to successfully run geant4.sh)
I am trying to cross-compile ROS2 for Arm. The steps I am following can be found in here: https://github.com/ros2-for-arm/ros2/wiki/ROS2-on-arm-architecture
The build command used is
colcon build --symlink-install --cmake-force-configure --cmake-args -DCMAKE_TOOLCHAIN_FILE=aarch64_toolchainfile.cmake -DTHIRDPARTY=ON -DBUILD_TESTING:BOOL=OFF
The poco library cannot be found, however it is in "/work/ROS2_Bouncy/ros2_ws/install/poco_vendor/lib/libPocoFoundation.so.50" and it is correctly cross-compiled:
/work/ROS2_Bouncy/ros2_ws/install/poco_vendor/lib/libPocoFoundation.so.50: ELF 64-bit LSB shared object, ARM aarch64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=6ba44c72e2162ca056b0dbde681dd4a8b5da5e35, not stripped
I wonder where I can modify the CMake script to specify the path to the thirdparty libraries. I tried to specify manually the path to Poco but it did not work:
add_library(Poco_import SHARED IMPORTED)
set_target_properties(Poco_import PROPERTIES
IMPORTED_LOCATION "/work/ROS2_Bouncy/ros2_ws/install/poco_vendor/lib/libPocoFoundation.so.50"
)
I also tried adding the path to the Poco library in CMAKE_EXE_LINKER_FLAGS
(-L) but no success.
Everything look to be compiled correctly, but I got an error at the linking stage:
Failed <<< examples_rclcpp_minimal_publisher [ Exited with code 2 ]
--- stderr: examples_rclcpp_minimal_timer
/work/Documents/aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/6.1.1/../../../../aarch64-linux-gnu/bin/ld: warning: libPocoFoundation.so.50, needed by /work/ROS2_Bouncy/ros2_ws/install/rosidl_typesupport_cpp/lib/librosidl_typesupport_cpp.so, not found (try using -rpath or -rpath-link)
/work/Documents/aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/6.1.1/../../../../aarch64-linux-gnu/bin/ld: warning: libyaml.so, needed by /work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so, not found (try using -rpath or -rpath-link)
/work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_event_delete'
/work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_parser_parse'
/work/ROS2_Bouncy/ros2_ws/install/rosidl_typesupport_cpp/lib/librosidl_typesupport_cpp.so: undefined reference to `Poco::SharedLibrary::getSymbol(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_parser_delete'
/work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_parser_initialize'
/work/ROS2_Bouncy/ros2_ws/install/rosidl_typesupport_cpp/lib/librosidl_typesupport_cpp.so: undefined reference to `Poco::SharedLibrary::hasSymbol(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/work/ROS2_Bouncy/ros2_ws/install/rosidl_typesupport_cpp/lib/librosidl_typesupport_cpp.so: undefined reference to `Poco::SharedLibrary::SharedLibrary(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_parser_set_input_file'
collect2: error: ld returned 1 exit status
gmake[2]: *** [timer_lambda] Error 1
gmake[1]: *** [CMakeFiles/timer_lambda.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
/work/Documents/aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/6.1.1/../../../../aarch64-linux-gnu/bin/ld: warning: libPocoFoundation.so.50, needed by /work/ROS2_Bouncy/ros2_ws/install/rosidl_typesupport_cpp/lib/librosidl_typesupport_cpp.so, not found (try using -rpath or -rpath-link)
/work/Documents/aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/6.1.1/../../../../aarch64-linux-gnu/bin/ld: warning: libyaml.so, needed by /work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so, not found (try using -rpath or -rpath-link)
/work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_event_delete'
/work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_parser_parse'
/work/ROS2_Bouncy/ros2_ws/install/rosidl_typesupport_cpp/lib/librosidl_typesupport_cpp.so: undefined reference to `Poco::SharedLibrary::getSymbol(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_parser_delete'
/work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_parser_initialize'
/work/ROS2_Bouncy/ros2_ws/install/rosidl_typesupport_cpp/lib/librosidl_typesupport_cpp.so: undefined reference to `Poco::SharedLibrary::hasSymbol(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/work/ROS2_Bouncy/ros2_ws/install/rosidl_typesupport_cpp/lib/librosidl_typesupport_cpp.so: undefined reference to `Poco::SharedLibrary::SharedLibrary(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_parser_set_input_file'
collect2: error: ld returned 1 exit status
gmake[2]: *** [timer_member_function] Error 1
gmake[1]: *** [CMakeFiles/timer_member_function.dir/all] Error 2
gmake: *** [all] Error 2
Thanks to Tsyvarev who pointed to me the correct flag.
I added the following to the toolchain file and it solved the issue.
set(PATH_POCO_LIB "${CMAKE_CURRENT_LIST_DIR}/build/poco_vendor/poco_external_project_install/lib/")
set(PATH_YAML_LIB "${CMAKE_CURRENT_LIST_DIR}/build/libyaml_vendor/libyaml_install/lib/")
set(CMAKE_BUILD_RPATH "${PATH_POCO_LIB};${PATH_YAML_LIB}")