Open razr opened 2 months ago
@razr fixing the maximum version with CMake will not fix the build issue. Is this okay ? I think we can check the boost version in the cpp files to determine whether to include the header or not.
#include <boost/version.hpp>
#if BOOST_VERSION < 107600
#include <boost/geometry/strategies/agnostic/hull_graham_andrew.hpp>
#endif
The call to boost::geometry::convex_hull
must probably also be conditioned on the BOOST_VERSION
.
When I run this code before colcon build
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
it downgraded the boost version to 1.74. So, I am not sure how you have boost 1.81? correct me, please.
I realized that there are two boost version in my case. So, I updated the autoware_universe_utils> CMakeList.txt as :
`
cmake_minimum_required(VERSION 3.14)
project(autoware_universe_utils)
include_directories(BEFORE SYSTEM /usr/include)
set(CMAKE_IGNORE_PATH "/usr/local/include")
option(BUILD_EXAMPLES "Build examples" OFF)
find_package(autoware_cmake REQUIRED)
autoware_package()
##find_package(Boost REQUIRED)
find_package(Boost REQUIRED COMPONENTS date_time)
find_package(fmt REQUIRED)
ament_auto_add_library(autoware_universe_utils SHARED
src/geometry/alt_geometry.cpp
src/geometry/geometry.cpp
src/geometry/pose_deviation.cpp
src/geometry/boost_polygon_utils.cpp
src/geometry/random_convex_polygon.cpp
src/geometry/random_concave_polygon.cpp
src/geometry/gjk_2d.cpp
src/geometry/sat_2d.cpp
src/math/sin_table.cpp
src/math/trigonometry.cpp
src/ros/msg_operation.cpp
src/ros/marker_helper.cpp
src/ros/logger_level_configure.cpp
src/system/backtrace.cpp
src/system/time_keeper.cpp
src/geometry/ear_clipping.cpp
)
target_link_libraries(autoware_universe_utils
fmt::fmt
)
if(BUILD_TESTING)
find_package(ament_cmake_ros REQUIRED)
file(GLOB_RECURSE test_files test/**/*.cpp)
ament_add_ros_isolated_gtest(test_autoware_universe_utils ${test_files})
target_link_libraries(test_autoware_universe_utils
autoware_universe_utils
)
endif()
if(BUILD_EXAMPLES)
message(STATUS "Building examples")
file(GLOB_RECURSE example_files examples/*.cpp)
foreach(example_file ${example_files})
get_filename_component(example_name ${example_file} NAME_WE)
add_executable(${example_name} ${example_file})
target_link_libraries(${example_name}
autoware_universe_utils
)
install(TARGETS ${example_name}
DESTINATION lib/${PROJECT_NAME}
)
endforeach()
endif()
ament_auto_package()
`
then, also,
sudo mv /usr/local/include/boost /usr/local/include/boost_backup
@zehranrgi Thank you for looking into it. My OS includes Boost 1.81, which generally works well, except in this specific case. I’ve downgraded to Boost 1.76 and the issue is resolved. So, nothing critical, I just want to point out that there is a dependency in the source code on particular BOOST release.
Yes, it needs boost 1.76.
But, also I am getting these errors:
CMake Error at /opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:50 (add_executable):
Target "test_autoware_universe_utils" links to target "Boost::date_time"
but the target was not found. Perhaps a find_package() call is missing for
an IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
/opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:37 (_ament_add_gtest_executable)
/opt/ros/humble/share/ament_cmake_gtest/cmake/ament_add_gtest.cmake:68 (ament_add_gtest_executable)
/opt/ros/humble/share/ament_cmake_ros/cmake/ament_add_ros_isolated_gtest.cmake:33 (ament_add_gtest)
CMakeLists.txt:43 (ament_add_ros_isolated_gtest)
Hi, Looks like the class has been moved to boost/geometry/algorithms/detail/convex_hull/graham_andrew.hpp from boost v1.76?
Checklist
Description
I have
boost 1.81
andautoware_universe_utils
fails to compile with it.boost/geometry/strategies/agnostic/hull_graham_andrew.hpp
has been removed fromboost
starting from1.76.0
, please see https://github.com/boostorg/geometry/tree/boost-1.76.0/include/boost/geometry/strategies/agnosticMaybe find package should be written as:
Expected behavior
see description
Actual behavior
see description
Steps to reproduce
see description
Versions
No response
Possible causes
see description
Additional context
No response