How do I solve GATE building file make error - cmake

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)

Related

cuda: undefined reference to `cufftExecR2C'

Im using Cudas cuFFT library and therefore I have added the library path to $LD_LIBRARY_PATH. When compiling, Im using the -lcufft flag, after including the header with #include<cufft.h>. But I still receive the following errors:
/usr/bin/ld: tmpxft_000029f1_00000000-6_render.cudafe1.cpp:(.text+0x51b): undefined reference to `cufftExecR2C'
/usr/bin/ld: tmpxft_000029f1_00000000-6_render.cudafe1.cpp:(.text+0x528): undefined reference to `cufftDestroy'
/usr/bin/ld: tmpxft_000029f1_00000000-6_render.cudafe1.cpp:(.text+0x16d8): undefined reference to `cufftPlan2d'
/usr/bin/ld: tmpxft_000029f1_00000000-6_render.cudafe1.cpp:(.text+0x16f3): undefined reference to `cufftExecC2R'
/usr/bin/ld: tmpxft_000029f1_00000000-6_render.cudafe1.cpp:(.text+0x16fd): undefined reference to `cufftDestroy'
collect2: error: ld returned 1 exit status
This is a CMake project and I link via: set(CMAKE_CUDA_FLAGS_RELEASE " -I/opt/nvidia/hpc_sdk/Linux_x86_64/22.11/math_libs/include -L/opt/nvidia/hpc_sdk/Linux_x86_64/22.11/math_libs/lib64 -lcufft")
Am I missing something crucial?

Difficulty in linking FFTW library with gfortran

I have a c++ program, which uses the FFTW3 library, which I would like to translate to Fortran. I am using Ubuntu 22.04.1.
I installed the FFTW3 library as detailed in Installation on UNIX
The c++ main program is named ksbenchmark.cpp and, using g++, I compile it and link it (to the math and fftw3 libraries) with
g++ -o my_executable.out ksbenchmark.cpp -lm -lfftw3
which works great.
I have translate the c++ code in Fortran, the source file being named ksbenchmrk.f90.
If I issue
gfortran ksbenchmark.f90 -lfftw3 -lm
I get error messages
/usr/bin/ld: /tmp/cca2xMGa.o: in function `ksintegrate_':
ksbenchmark.f90:(.text+0x59): undefined reference to `dfftw_plan_dft_1d_'
/usr/bin/ld: ksbenchmark.f90:(.text+0x94): undefined reference to `dfftw_plan_dft_1d_'
/usr/bin/ld: ksbenchmark.f90:(.text+0xcf): undefined reference to `dfftw_plan_dft_1d_'
/usr/bin/ld: ksbenchmark.f90:(.text+0x4de): undefined reference to `dfftw_execute_'
/usr/bin/ld: ksbenchmark.f90:(.text+0x5db): undefined reference to `dfftw_execute_'
/usr/bin/ld: ksbenchmark.f90:(.text+0x626): undefined reference to `dfftw_execute_'
/usr/bin/ld: ksbenchmark.f90:(.text+0x780): undefined reference to `dfftw_execute_'
/usr/bin/ld: ksbenchmark.f90:(.text+0xa1c): undefined reference to `dfftw_execute_'
collect2: error: ld returned 1 exit status
I have spent the afternoon reading about it, and it seems I may have to use -I and -L flags such as
gfortran test.f90 -L/new/path/to/lib -I/new/path/to/include -lfftw3 -lm
as illustrated in the post Problems linking FFTW with gfortran (symbol(s) not found for architecture x86_64).
The first question is, what paths to use?
I can find files referring to fftw3 in /usr/local/lib as well as in /usr/local/include, but the attempt
gfortran ksbenchmark.f90 -L/usr/local/lib -I/usr/local/include -lfftw3 -lm
returns the same error as before
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
/usr/bin/ld: /tmp/ccW2DYGP.o: in function `ksintegrate_':
ksintegrate.f90:(.text+0x62): undefined reference to `dfftw_plan_dft_1d_'
/usr/bin/ld: ksintegrate.f90:(.text+0x9d): undefined reference to `dfftw_plan_dft_1d_'
/usr/bin/ld: ksintegrate.f90:(.text+0xd8): undefined reference to `dfftw_plan_dft_1d_'
/usr/bin/ld: ksintegrate.f90:(.text+0x4df): undefined reference to `dfftw_execute_'
/usr/bin/ld: ksintegrate.f90:(.text+0x5f7): undefined reference to `dfftw_execute_'
/usr/bin/ld: ksintegrate.f90:(.text+0x643): undefined reference to `dfftw_execute_'
/usr/bin/ld: ksintegrate.f90:(.text+0x79d): undefined reference to `dfftw_execute_'
/usr/bin/ld: ksintegrate.f90:(.text+0xa5b): undefined reference to `dfftw_execute_'
collect2: error: ld returned 1 exit status
I am unable to understand which paths to the library are to be used.
How to find where the library is saved?
Why does not g++ need any paths to the library?
I apologise for how trivial the question might seem, I am a total newbie can ensure I put a significant effort in trying to sort this out. Any hint would be most appreciated, thanks
EDIT
Following Vladimir F Героям слава's advice, I tried using the nm command to verify the library contains what is expected to.
In /usr/local/lib
I found libfftw3.a and libfftw3.la files.
Issuing nm libfftw3.a I get quite a long list.
I tried looking for one of the commands I get an error about, dfftw_plan_dft_1d
nm -S libfftw3.a | grep dfftw_plan_dft_1d
and indeed it returns hits
00000000000003a0 0000000000000026 T _Z18dfftw_plan_dft_1d_PP11fftw_plan_sPiPA2_dS4_S2_S2_
0000000000002df0 0000000000000026 T _Z19dfftw_plan_dft_1d__PP11fftw_plan_sPiPA2_dS4_S2_S2_

What causes the following linking error with CMake and Imagemagick library?

I have a main.cpp file that includes a header file from the same directory where I have used the boost library, magickimage c++ library, and eigen library. Here is my CMakeLists.txt file where I have linked the .lib and .a files to my target and set the includer paths.
cmake_minimum_required(VERSION 3.20.2)
project(blackjackAI)
add_executable(blackjackAI main.cpp)
target_link_libraries(blackjackAI PRIVATE C:/Users/Ejer/Desktop/c++/c++Dep/boost_1_77_0/stage/lib/libboost_filesystem-gcc10-mt-x64-1_77.a)
target_link_libraries(blackjackAI PRIVATE C:/Users/Ejer/Desktop/c++/c++Dep/ImageMagick-7.1.0-Q16-HDRI/lib/CORE_RL_Magick++_.lib)
target_link_libraries(blackjackAI PRIVATE C:/Users/Ejer/Desktop/c++/c++Dep/ImageMagick-7.1.0-Q16-HDRI/lib/CORE_RL_MagickCore_.lib)
target_link_libraries(blackjackAI PRIVATE C:/Users/Ejer/Desktop/c++/c++Dep/ImageMagick-7.1.0-Q16-HDRI/lib/CORE_RL_MagickWand_.lib)
target_include_directories(blackjackAI PRIVATE C:/Users/Ejer/Desktop/c++/c++Dep/ImageMagick-7.1.0-Q16-HDRI/include)
target_include_directories(blackjackAI PRIVATE C:/Users/Ejer/Desktop/c++/c++Dep/eigen-3.4.0)
target_include_directories(blackjackAI PRIVATE C:/Users/Ejer/Desktop/c++/c++Dep/boost_1_77_0)
target_include_directories(blackjackAI PRIVATE C:/Users/Ejer/Desktop/c++/blackjackAI)
For some reason when I compile my CMakeLists.txt file with the "MinGW Makefiles" generator and then use the makefile I get the following linker error:
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: CMakeFiles\blackjackAI.dir/objects.a(main.cpp.obj):C:\Users\Ejer
\Desktop\c++\blackjackAI\main.cpp:(.text$_ZN6CnnNetC1ESs[_ZN6CnnNetC1ESs]+0x3dd): undefined reference to `Magick::Image::Image()'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: CMakeFiles\blackjackAI.dir/objects.a(main.cpp.obj):C:\Users\Ejer
\Desktop\c++\blackjackAI\main.cpp:(.text$_ZN6CnnNetC1ESs[_ZN6CnnNetC1ESs]+0x413): undefined reference to `Magick::Image::read(std::str
ing const&)'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: CMakeFiles\blackjackAI.dir/objects.a(main.cpp.obj):C:\Users\Ejer
\Desktop\c++\blackjackAI\main.cpp:(.text$_ZN6CnnNetC1ESs[_ZN6CnnNetC1ESs]+0x436): undefined reference to `Magick::Image::type(MagickCo
re::ImageType)'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: CMakeFiles\blackjackAI.dir/objects.a(main.cpp.obj):C:\Users\Ejer
\Desktop\c++\blackjackAI\main.cpp:(.text$_ZN6CnnNetC1ESs[_ZN6CnnNetC1ESs]+0x45b): undefined reference to `Magick::Image::~Image()'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: CMakeFiles\blackjackAI.dir/objects.a(main.cpp.obj):C:\Users\Ejer
\Desktop\c++\blackjackAI\main.cpp:(.text$_ZN6CnnNetC1ESs[_ZN6CnnNetC1ESs]+0x539): undefined reference to `Magick::Image::~Image()'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: CMakeFiles\blackjackAI.dir/objects.a(main.cpp.obj):C:\Users\Ejer
\Desktop\c++\blackjackAI\main.cpp:(.text$_ZN9__gnu_cxx13new_allocatorIN6Magick5ImageEE9constructIS2_JRKS2_EEEvPT_DpOT0_[_ZN9__gnu_cxx1
3new_allocatorIN6Magick5ImageEE9constructIS2_JRKS2_EEEvPT_DpOT0_]+0x46): undefined reference to `Magick::Image::Image(Magick::Image co
nst&)'
/usr/lib/gcc/x86_64-pc-cygwin/10/../../../../x86_64-pc-cygwin/bin/ld: CMakeFiles\blackjackAI.dir/objects.a(main.cpp.obj):C:\Users\Ejer
\Desktop\c++\blackjackAI\main.cpp:(.text$_ZSt10_ConstructIN6Magick5ImageEJRKS1_EEvPT_DpOT0_[_ZSt10_ConstructIN6Magick5ImageEJRKS1_EEvP
T_DpOT0_]+0x42): undefined reference to `Magick::Image::Image(Magick::Image const&)'
collect2: error: ld returned 1 exit status
CMakeFiles\blackjackAI.dir\build.make:102: recipe for target 'blackjackAI.exe' failed
mingw32-make[2]: *** [blackjackAI.exe] Error 1
CMakeFiles\Makefile2:81: recipe for target 'CMakeFiles/blackjackAI.dir/all' failed
mingw32-make[1]: *** [CMakeFiles/blackjackAI.dir/all] Error 2
Makefile:89: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
It says that I have undefined references to the use of the Image class in my header file, even though I have linked my includer path and .lib files in CMakeLists.txt file and my main.cpp file to the imagemagick library. What is causing the problem?

How to add Paho Mqtt C and Cpp libraries to a CMakeLists.txt

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)

colcon could not find thirdparty libraries (Poco)

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}")