Fixed an unknown symbol error when importing libpointmatcher's Python bindings on arm64-based MacOS.
Also, fixed failing tests on new boost version.
Changes and type of changes (quick overview):
When importing pypointmatcher in Python on arm64-based MacOS, I was getting this error:
"ImportError: dlopen(/Volumes/CaseSensitive/libpointmatcher/python/pypointmatcher/pypointmatcher_native.cpython-312-darwin.so, 0x0002): symbol not found in flat namespace '__ZNK14PointMatcherIOIfE10PLYElementeqERKS1_'"
Demangling the symbol error, it complains about this function:
Following this discussion, I replaced the direct definitions of the __eq__ method with pybind11::self == pybind11::self and pybind11::self != pybind11::self and overwriting the C++ operator== and operator!= with friend functions.
I think that the issue did not occur on Ubuntu distros due to different build tools, but I'm not certain. In any case, it solves the problem on MacOS.
Checklist:
Code related
[x] I have made corresponding changes to the documentation
(i.e.: function, class, script header, README.md)
[x] I have commented hard-to-understand code
[x] I have added tests that prove my fix is effective or that my feature works
[x] All tests pass locally with my changes
(Check contributing_instructions.md for local testing procedure using libpointmatcher-build-system)
PR creation related
[x] My pull request base ref branch is set to the develop branch
(the build-system won't be triggered otherwise)
[x] My pull request branch is up-to-date with the develop branch
(the build-system will reject it otherwise)
PR description related
[x] I have included a quick summary of the changes
[x] I have indicated the related issue's id with # <issue-id> if changes are of type fix
[x] I have included a high-level list of changes and their corresponding types
(See commit_msg_reference.md for details)
Description
Summary:
Fixed an unknown symbol error when importing libpointmatcher's Python bindings on arm64-based MacOS. Also, fixed failing tests on new boost version.
Changes and type of changes (quick overview):
pypointmatcher
in Python on arm64-based MacOS, I was getting this error:Demangling the symbol error, it complains about this function:
__eq__
method withpybind11::self == pybind11::self
andpybind11::self != pybind11::self
and overwriting the C++operator==
andoperator!=
with friend functions.I think that the issue did not occur on Ubuntu distros due to different build tools, but I'm not certain. In any case, it solves the problem on MacOS.
Checklist:
Code related
PR creation related
base ref
branch is set to thedevelop
branch (the build-system won't be triggered otherwise)develop
branch (the build-system will reject it otherwise)PR description related
# <issue-id>
if changes are of typefix