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

Issue with pcl library while executing catkin_make- vtkFiltersParallelDIY2_AutoInit_Construct #128

Open
ashwinjoseph95 opened this issue Nov 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ashwinjoseph95
Copy link

ashwinjoseph95 commented Nov 15, 2024

Hi,
I was following the instructions to setup the tool using the instructions on https://koide3.github.io/direct_visual_lidar_calibration/installation/

Environment: Ubuntu 20.04 + ROS Noetic

After dealing successfully with the dependencies setup, I went ahead with the catkin_make command for direct_visual_lidar_calibration. I am getting some pcl library related undefined reference issues. Any help regarding how to fix it would be very helpful. Thank you.
My log looks like:

.
.
/usr/bin/ld: /usr/local/lib/libpcl_surface.so: undefined reference to `vtkFiltersParallelDIY2_AutoInit_Construct()'
/usr/bin/ld: /usr/local/lib/libpcl_surface.so: undefined reference to `vtkFiltersParallelDIY2_AutoInit_Destruct()'
collect2: error: ld returned 1 exit status
make[2]: *** [direct_visual_lidar_calibration/CMakeFiles/preprocess.dir/build.make:352: /home/knadmin/Ashwin/calib_ws/devel/lib/direct_visual_lidar_calibration/preprocess] Error 1
make[1]: *** [CMakeFiles/Makefile2:1372: direct_visual_lidar_calibration/CMakeFiles/preprocess.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 87%] Linking CXX executable /home/knadmin/Ashwin/calib_ws/devel/lib/direct_visual_lidar_calibration/viewer
/usr/bin/ld: /usr/local/lib/libpcl_surface.so: undefined reference to `vtkFiltersParallelDIY2_AutoInit_Construct()'
/usr/bin/ld: /usr/local/lib/libpcl_surface.so: undefined reference to `vtkFiltersParallelDIY2_AutoInit_Destruct()'
collect2: error: ld returned 1 exit status
make[2]: *** [direct_visual_lidar_calibration/CMakeFiles/viewer.dir/build.make:273: /home/knadmin/Ashwin/calib_ws/devel/lib/direct_visual_lidar_calibration/viewer] Error 1
make[1]: *** [CMakeFiles/Makefile2:1502: direct_visual_lidar_calibration/CMakeFiles/viewer.dir/all] Error 2
[ 90%] Linking CXX executable /home/knadmin/Ashwin/calib_ws/devel/lib/direct_visual_lidar_calibration/initial_guess_manual
/usr/bin/ld: /usr/local/lib/libpcl_surface.so: undefined reference to `vtkFiltersParallelDIY2_AutoInit_Construct()'
/usr/bin/ld: /usr/local/lib/libpcl_surface.so: undefined reference to `vtkFiltersParallelDIY2_AutoInit_Destruct()'
collect2: error: ld returned 1 exit status
make[2]: *** [direct_visual_lidar_calibration/CMakeFiles/initial_guess_manual.dir/build.make:273: /home/knadmin/Ashwin/calib_ws/devel/lib/direct_visual_lidar_calibration/initial_guess_manual] Error 1
make[1]: *** [CMakeFiles/Makefile2:1424: direct_visual_lidar_calibration/CMakeFiles/initial_guess_manual.dir/all] Error 2
[ 93%] Linking CXX executable /home/knadmin/Ashwin/calib_ws/devel/lib/direct_visual_lidar_calibration/calibrate
/usr/bin/ld: /usr/local/lib/libpcl_surface.so: undefined reference to `vtkFiltersParallelDIY2_AutoInit_Construct()'
/usr/bin/ld: /usr/local/lib/libpcl_surface.so: undefined reference to `vtkFiltersParallelDIY2_AutoInit_Destruct()'
collect2: error: ld returned 1 exit status
make[2]: *** [direct_visual_lidar_calibration/CMakeFiles/calibrate.dir/build.make:273: /home/knadmin/Ashwin/calib_ws/devel/lib/direct_visual_lidar_calibration/calibrate] Error 1
make[1]: *** [CMakeFiles/Makefile2:1476: direct_visual_lidar_calibration/CMakeFiles/calibrate.dir/all] Error 2
[ 96%] Linking CXX executable /home/knadmin/Ashwin/calib_ws/devel/lib/direct_visual_lidar_calibration/initial_guess_auto
/usr/bin/ld: /usr/local/lib/libpcl_surface.so: undefined reference to `vtkFiltersParallelDIY2_AutoInit_Construct()'
/usr/bin/ld: /usr/local/lib/libpcl_surface.so: undefined reference to `vtkFiltersParallelDIY2_AutoInit_Destruct()'
collect2: error: ld returned 1 exit status
make[2]: *** [direct_visual_lidar_calibration/CMakeFiles/initial_guess_auto.dir/build.make:273: /home/knadmin/Ashwin/calib_ws/devel/lib/direct_visual_lidar_calibration/initial_guess_auto] Error 1
make[1]: *** [CMakeFiles/Makefile2:1450: direct_visual_lidar_calibration/CMakeFiles/initial_guess_auto.dir/all] Error 2
[100%] Linking CXX executable /home/knadmin/Ashwin/calib_ws/devel/lib/direct_visual_lidar_calibration/preprocess_map
/usr/bin/ld: warning: libpcl_io_ply.so.1.14, needed by /usr/local/lib/libpcl_io.so, may conflict with libpcl_io_ply.so.1.10
[100%] Built target preprocess_map
make: *** [Makefile:146: all] Error 2
Invoking "make -j6" failed

(venv3) ashwin@KN-Precision-7540:~/Ashwin/calib_ws$ 

My CMakelists looks like:

cmake_minimum_required(VERSION 3.16)
project(direct_visual_lidar_calibration)

add_compile_options(-std=c++17)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake")

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build." FORCE)
  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

if($ENV{ROS_VERSION} EQUAL 1)
  # ROS1
  find_package(catkin REQUIRED COMPONENTS rosbag sensor_msgs cv_bridge)
  catkin_package()
else()
  # ROS2
  find_package(ament_cmake_auto REQUIRED)
  find_package(ament_cmake_python REQUIRED)
  ament_auto_find_build_dependencies()
endif()

find_package(PCL REQUIRED)
include_directories(/usr/local/include/pcl-1.14)
find_package(Ceres REQUIRED)
find_package(GTSAM REQUIRED)
find_package(OpenCV REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem program_options)
find_package(Iridescence REQUIRED)

#set(PCL_INCLUDE_DIRS "/home/knadmin/Ashwin/pcl/build/include/pcl")
#set(PCL_LIBRARIES "/home/knadmin/Ashwin/pcl/build/lib/libpcl_common.so") # Adjust based on actual libraries installed
set(PCL_INCLUDE_DIRS "/usr/local/include/pcl-1.14/pcl")

set(PCL_LIBRARIES "/usr/local/lib/libpcl_common.so;/usr/local/lib/libpcl_search.so;/usr/local/lib/libpcl_io_ply.so;/usr/local/lib/libpcl_io.so;/usr/local/lib/libpcl_surface.so")




set(OLD_DISTRO "humble;galactic;foxy")
if($ENV{ROS_DISTRO} IN_LIST OLD_DISTRO)
  add_definitions(-DCV_BRIDGE_INCLUDE_H)
else()
  add_definitions(-DCV_BRIDGE_INCLUDE_HPP)
endif()

find_package(OpenMP)
if (OPENMP_FOUND)
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()

# direct_visual_lidar_calibration
add_library(direct_visual_lidar_calibration SHARED
  src/camera/create_camera.cpp
  src/vlcal/common/frame.cpp
  src/vlcal/common/frame_cpu.cpp
  src/vlcal/common/ivox.cpp
  src/vlcal/common/cloud_covariance_estimation.cpp
  src/vlcal/common/time_keeper.cpp
  src/vlcal/common/estimate_fov.cpp
  src/vlcal/common/estimate_pose.cpp
  src/vlcal/common/points_color_updater.cpp
  src/vlcal/common/visual_lidar_data.cpp
  src/vlcal/common/visual_lidar_visualizer.cpp
  src/vlcal/preprocess/preprocess.cpp
  src/vlcal/preprocess/generate_lidar_image.cpp
  src/vlcal/preprocess/static_point_cloud_integrator.cpp
  src/vlcal/preprocess/dynamic_point_cloud_integrator.cpp
  src/vlcal/calib/cost_calculator_nid.cpp
  src/vlcal/calib/view_culling.cpp
  src/vlcal/calib/visual_camera_calibration.cpp
)
target_include_directories(direct_visual_lidar_calibration PUBLIC
  include
  thirdparty/json/include
  thirdparty/Bonxai/include
  thirdparty/nanoflann/include
  thirdparty/Sophus
  ${Boost_INCLUDE_DIRS}
  ${CERES_INCLUDE_DIRS}
  ${GTSAM_INCLUDE_DIRS}
  ${PCL_INCLUDE_DIRS}
  ${OpenCV_INCLUDE_DIRS}
)
target_link_libraries(direct_visual_lidar_calibration
  fmt
  ${Boost_LIBRARIES}
  ${PCL_LIBRARIES}
  ${CERES_LIBRARIES}
  ${GTSAM_LIBRARIES}
  ${OpenCV_LIBRARIES}
  ${PCL_LIBRARIES}
  Iridescence::Iridescence
  pcl_common
  pcl_search
  pcl_filters
  pcl_surface
  pcl_io
  pcl_io_ply   # Link specific I/O module for PLY

)


if($ENV{ROS_VERSION} EQUAL 1)
  # ROS1
  add_executable(preprocess
    src/preprocess_ros1.cpp
  )
  target_link_libraries(preprocess
    direct_visual_lidar_calibration
  )
  target_include_directories(preprocess PUBLIC
    ${catkin_INCLUDE_DIRS}
  )
  target_link_libraries(preprocess
    ${catkin_LIBRARIES}
  )
else()
  # ROS2
  ament_auto_add_executable(preprocess
    src/preprocess_ros2.cpp
  )
  target_link_libraries(preprocess
    direct_visual_lidar_calibration
  )
endif()

# preprocess_map
add_executable(preprocess_map
  src/preprocess_map.cpp
)
target_include_directories(preprocess_map PRIVATE
  ${catkin_INCLUDE_DIRS}
)
target_link_libraries(preprocess_map
  direct_visual_lidar_calibration
)

# initial_guess_manual
add_executable(initial_guess_manual
  src/initial_guess_manual.cpp
)
target_include_directories(initial_guess_manual PRIVATE
  ${catkin_INCLUDE_DIRS}
)
target_link_libraries(initial_guess_manual
  direct_visual_lidar_calibration
)

# initial_guess_auto
add_executable(initial_guess_auto
  src/initial_guess_auto.cpp
)
target_include_directories(initial_guess_auto PRIVATE
  ${catkin_INCLUDE_DIRS}
)
target_link_libraries(initial_guess_auto
  direct_visual_lidar_calibration
)

# calibrate
add_executable(calibrate
  src/calibrate.cpp
)
target_include_directories(calibrate PRIVATE
  ${catkin_INCLUDE_DIRS}
)
target_link_libraries(calibrate
  direct_visual_lidar_calibration
)

# viewer
add_executable(viewer
  src/viewer.cpp
)
target_include_directories(viewer PRIVATE
  ${catkin_INCLUDE_DIRS}
)
target_link_libraries(viewer
  direct_visual_lidar_calibration
)

install(
  TARGETS
  direct_visual_lidar_calibration
)

install(
  TARGETS
  preprocess_map
  initial_guess_manual
  initial_guess_auto
  calibrate
  viewer
  DESTINATION
  lib/${PROJECT_NAME}
)

if($ENV{ROS_VERSION} EQUAL 1)
  # ROS1
else()
  # ROS2
  ament_python_install_package(${PROJECT_NAME})
  install(PROGRAMS scripts/find_matches_superglue.py DESTINATION lib/${PROJECT_NAME})
  ament_export_libraries(direct_visual_lidar_calibration)
  ament_auto_package()
endif()
@ashwinjoseph95 ashwinjoseph95 added the bug Something isn't working label Nov 15, 2024
@ashwinjoseph95 ashwinjoseph95 changed the title Issue with pcl library while executing catkin_make Issue with pcl library while executing catkin_make- vtkFiltersParallelDIY2_AutoInit_Construct Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant