colcon could not find thirdparty libraries (Poco) - cmake

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

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?

Cmake not compiling for basic PCL exmaple

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++ ..

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)

How do I solve GATE building file make error

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)

Pthread and introspection library linking with Halide generators fails

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