-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
PSP_3: Fix pointmatcher support #5350
PSP_3: Fix pointmatcher support #5350
Conversation
…en used to build pointmatcher.
@@ -93,6 +93,7 @@ if ( CGAL_FOUND ) | |||
find_package(libpointmatcher QUIET) | |||
include(CGAL_pointmatcher_support) | |||
if (TARGET CGAL::pointmatcher_support) | |||
find_package(Boost COMPONENTS thread filesystem system program_options date_time chrono REQUIRED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is that find_package(Boost ...)
for? It does not seem used in the following lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libpointmatcher forwards all its boost dependencies, and those are the said dependencies. Without this find_package, cmake generation fails with
CMake Error at CMakeLists.txt:117 (add_executable):
Target "registration_with_opengr_pointmatcher_pipeline" links to target
"Boost::thread" but the target was not found. Perhaps a find_package()
call is missing for an IMPORTED target, or an ALIAS target is missing?
and more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to put that line in CGAL_pointmatcher_support.cmake
.
Actually, it should be also upstreamed in libpointmatcherConfig.cmake
.
\attention On Windows, we only test the following setup : PointMatcher 1.3.1 with Eigen 3.3.7. Also, to make it work, you should follow the instructions at | ||
`https://github.com/ethz-asl/libpointmatcher/blob/master/doc/CompilationWindows.md`, but replace `NABO_INCLUDE_DIR` by `libnabo_INCLUDE_DIRS` | ||
and `NABO_LIBRARY` by `libnabo_LIBRARIES` when configuring PointMatcher. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that paragraph needs a bit a polish and rewording.
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL Windows) | ||
find_package(Boost COMPONENTS thread filesystem system program_options date_time chrono) | ||
endif() | ||
if(NOT (WIN32 OR CMAKE_SYSTEM_NAME STREQUAL Windows) | ||
OR ( Boost_chrono_FOUND | ||
AND Boost_thread_FOUND | ||
AND Boost_filesystem_FOUND | ||
AND Boost_system_FOUND | ||
AND Boost_program_options_FOUND | ||
AND Boost_date_time_FOUND) ) | ||
add_library(CGAL::pointmatcher_support INTERFACE IMPORTED) | ||
target_compile_definitions(CGAL::pointmatcher_support INTERFACE "CGAL_LINKED_WITH_POINTMATCHER") | ||
target_include_directories(CGAL::pointmatcher_support INTERFACE "${libpointmatcher_INCLUDE_DIR}") | ||
target_link_libraries(CGAL::pointmatcher_support INTERFACE "${libpointmatcher_LIBRARIES}") | ||
else() | ||
message(STATUS "NOTICE : the libpointmatcher library requires the following boost components: thread filesystem system program_options date_time chrono.") | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know the details... Are those Boost libraries only needed on Windows?
What I do not like is that this code seems fragile: it works with the version of libpointmatcher
that was tested, and there is no guarantee that it will still work with the next one.
@sgiraudot @maxGimeno If that library is important for us, I think we should work with the maintainers of libpointmatcher
to improve their CMake support. In the end, that code should simply be:
add_library(CGAL::pointmatcher_support INTERFACE IMPORTED)
target_compile_definitions(CGAL::pointmatcher_support INTERFACE "CGAL_LINKED_WITH_POINTMATCHER")
target_link_libraries(CGAL::pointmatcher_support INTERFACE libpointmatcher::libpointmatcher)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the current time, either we fix the support in our code, either we completely drop the support of the Windows platforms. I already reported the bugs in Pointmatcher's cmake scripts here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we don't need it to work with the next version, as it is documented that we do not support another version. At least until they fix the bugs we reported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we don't need it to work with the next version, as it is documented that we do not support another version. At least until they fix the bugs we reported.
I know that is documented that way, but that is very aggressive for our users. Imagine somebody said "we only support CGAL version 4.13.2"... That is why, if that library is important for us (@sgiraudot?) then we should collaborate with libpointmatcher
to improve their CMake support. And I think we should contribute pull-requests, and not only issues, against if that is important for us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's really "just" a wrapper.
It's important in the sense that it is something that we do provide and thus we should make sure it works, but I'm not sure how much time and effort it makes sense to put into that (especially if they have an almost non-existent Windows support, it might be a long run to make it clean).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's really "just" a wrapper.
It's important in the sense that it is something that we do provide and thus we should make sure it works, but I'm not sure how much time and effort it makes sense to put into that (especially if they have an almost non-existent Windows support, it might be a long run to make it clean).
The same way we helped Eigen3 with their Windows support, maybe we could help libpointmatcher
with their Windows support. I do not know how much effort we can put, though. We should ask Andreas (@afabri).
My PR for the min/max problem in OpenGR on windows STORM-IRIT/OpenGR#87 |
My PRs for pointmatcher : |
Both are merged now. Congratulation! 🍾 |
Successfully tested in https://cgal.geometryfactory.com/CGAL/testsuite/results-5.3-Ic-65.shtml |
\attention On Windows, we only support version 1.3.1 of PointMatcher with version 3.3.7 of Eigen, with some changes to the recipe at | ||
`https://github.com/ethz-asl/libpointmatcher/blob/master/doc/CompilationWindows.md`:`NABO_INCLUDE_DIR` becomes `libnabo_INCLUDE_DIRS` | ||
and `NABO_LIBRARY` becomes `libnabo_LIBRARIES` in the "Build libpointmatcher" section. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sgiraudot Please review.
…maxGimeno PSP_3: Fix pointmatcher support
Summary of Changes
Fixes to OpenGR and pointmatcher examples.
Release Management