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

PSP_3: Fix pointmatcher support #5350

Merged

Conversation

maxGimeno
Copy link
Contributor

Summary of Changes

Fixes to OpenGR and pointmatcher examples.

Release Management

  • Affected package(s):Point_set_processing_3_Examples

@maxGimeno maxGimeno added this to the 5.1.3 milestone Jan 14, 2021
@maxGimeno maxGimeno self-assigned this Jan 14, 2021
@@ -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)
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

@maxGimeno maxGimeno marked this pull request as ready for review January 15, 2021 13:11
@maxGimeno maxGimeno requested a review from lrineau January 15, 2021 13:11
@maxGimeno maxGimeno changed the base branch from master to 5.1.x-branch January 15, 2021 13:14
Comment on lines 157 to 159
\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.
Copy link
Member

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.

Comment on lines 2 to 18
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()
Copy link
Member

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)

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor

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

Copy link
Member

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

@maxGimeno
Copy link
Contributor Author

My PR for the min/max problem in OpenGR on windows STORM-IRIT/OpenGR#87

@maxGimeno
Copy link
Contributor Author

@lrineau
Copy link
Member

lrineau commented Feb 2, 2021

My PRs for pointmatcher :

* [ethz-asl/libpointmatcher#437](https://github.com/ethz-asl/libpointmatcher/pull/437)

* [ethz-asl/libpointmatcher#436](https://github.com/ethz-asl/libpointmatcher/pull/436)

Both are merged now. Congratulation! 🍾

@maxGimeno
Copy link
Contributor Author

@lrineau lrineau added rm only: ready for master For the release team only: that indicates that a PR is about to be merged in 'master' rm only: ready for release branch For the release team only: that indicates that a PR is about to be merged in a release branch labels Feb 18, 2021
Comment on lines +157 to +160
\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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sgiraudot Please review.

@lrineau lrineau merged commit 7d760d8 into CGAL:5.1.x-branch Feb 18, 2021
lrineau added a commit that referenced this pull request Feb 18, 2021
…maxGimeno

PSP_3: Fix pointmatcher support
@lrineau lrineau removed Ready to be tested Under Testing rm only: ready for release branch For the release team only: that indicates that a PR is about to be merged in a release branch labels Feb 18, 2021
@lrineau lrineau deleted the PSP_3-Fixes-for_pointmatcher-maxGimeno branch February 18, 2021 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants