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

refactor: Drop support for yaml-cpp old API #450

Merged
merged 7 commits into from
Nov 17, 2023

Conversation

aguenette
Copy link
Member

@aguenette aguenette commented Feb 20, 2021

fix #42

So, here's my attempt to upgrade libpointmatcher's yaml-cpp dependency to its new API.

As discuss in #42, libpointmatcher will no longer provides yaml-cpp sources in the contrib directory, which mean that Windows users will have to build and install yaml-cpp from sources.

I've followed this tutorial to upgrade the API.

Changes:

  • Use the new yaml-cpp API, i.e. version 0.5+.
  • No longer provide sources in the contrib directory.

Tested on:

  • Ubuntu 18.04
  • Ubuntu 20.04
  • Windows

However, these changes need to be tested on Windows, so if a Windows user feels generous and is willing to test them, it would be greatly appreciated. 😄

Any suggestions are welcomed. Thanks!

Breaking changes:
- Use the new yaml-cpp API, i.e. version 0.5+.
- No longer provide sources in the contrib directory.
@ethzasl-jenkins
Copy link

Can one of the admins verify this patch?

@pomerlef
Copy link
Collaborator

add to white list

@pomerlef
Copy link
Collaborator

ok to test

@pomerlef
Copy link
Collaborator

Tests are failing on OSX

[ 72%] Linking CXX executable icp_customized
Undefined symbols for architecture x86_64:
  "YAML::Load(std::__1::basic_istream<char, std::__1::char_traits<char> >&)", referenced from:
      PointMatcher<float>::ICPChainBase::loadFromYaml(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in libpointmatcher.a(ICP.cpp.o)
      PointMatcher<double>::ICPChainBase::loadFromYaml(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in libpointmatcher.a(ICP.cpp.o)
      PointMatcher<float>::DataPointsFilters::DataPointsFilters(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in libpointmatcher.a(DataPointsFilter.cpp.o)
      PointMatcher<double>::DataPointsFilters::DataPointsFilters(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in libpointmatcher.a(DataPointsFilter.cpp.o)
  "YAML::detail::memory::create_node()", referenced from:
      YAML::Node::EnsureNodeExists() const in libpointmatcher.a(ICP.cpp.o)
  "YAML::detail::node_data::empty_scalar", referenced from:
      bool YAML::detail::node::equals<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, boost::shared_ptr<YAML::detail::memory_holder>) in libpointmatcher.a(ICP.cpp.o)
  "YAML::detail::node_data::mark_defined()", referenced from:
      YAML::detail::node::mark_defined() in libpointmatcher.a(ICP.cpp.o)
  "YAML::detail::node_data::end()", referenced from:
      PointMatcher<float>::ICPChainBase::loadFromYaml(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<float>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<float>::DataPointsFilter> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<float>::DataPointsFilter> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::DataPointsFilter>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::DataPointsFilter>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<float>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<float>::OutlierFilter> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<float>::OutlierFilter> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::OutlierFilter>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::OutlierFilter>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<float>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<float>::TransformationChecker> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<float>::TransformationChecker> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::TransformationChecker>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::TransformationChecker>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      PointMatcher<double>::ICPChainBase::loadFromYaml(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<double>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<double>::DataPointsFilter> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<double>::DataPointsFilter> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<double>::DataPointsFilter>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<double>::DataPointsFilter>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<double>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<double>::OutlierFilter> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<double>::OutlierFilter> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<double>::OutlierFilter>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<double>::OutlierFilter>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      ...
  "YAML::detail::node_data::begin()", referenced from:
      PointMatcher<float>::ICPChainBase::loadFromYaml(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<float>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<float>::DataPointsFilter> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<float>::DataPointsFilter> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::DataPointsFilter>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::DataPointsFilter>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<float>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<float>::OutlierFilter> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<float>::OutlierFilter> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::OutlierFilter>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::OutlierFilter>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<float>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<float>::TransformationChecker> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<float>::TransformationChecker> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::TransformationChecker>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::TransformationChecker>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      PointMatcher<double>::ICPChainBase::loadFromYaml(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<double>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<double>::DataPointsFilter> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<double>::DataPointsFilter> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<double>::DataPointsFilter>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<double>::DataPointsFilter>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<double>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<double>::OutlierFilter> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<double>::OutlierFilter> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<double>::OutlierFilter>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<double>::OutlierFilter>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      ...
  "YAML::detail::node_data::set_null()", referenced from:
      YAML::Node::EnsureNodeExists() const in libpointmatcher.a(ICP.cpp.o)
  "YAML::detail::node_data::size() const", referenced from:
      PointMatcherSupport::getNameParamsFromYAML(YAML::Node const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >&) in libpointmatcher.a(Registrar.cpp.o)
ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make[2]: *** [examples/icp_customized] Error 1

make[1]: *** [examples/CMakeFiles/icp_customized.dir/all] Error 2

make: *** [all] Error 2

@xlla
Copy link

xlla commented Aug 31, 2021

I have built it on jetson nano with yaml-cpp 0.5, but failure with some tests.

[ RUN      ] Transformation.ComputeRigidTransformDataPoints3D
/mnt/c/nano/git/libpointmatcher/utest/ui/Transformations.cpp:39: Failure
Value of: transformedFeature.isApprox(transformedCloud.features.col(i), kEpsilonNumericalError)
  Actual: false
Expected: true
[  FAILED  ] Transformation.ComputeRigidTransformDataPoints3D (17 ms)
[ RUN      ] Transformation.ComputeSimilarityTransformDataPoints2D
[       OK ] Transformation.ComputeSimilarityTransformDataPoints2D (40 ms)
[ RUN      ] Transformation.ComputeSimilarityTransformDataPoints3D
/mnt/c/nano/git/libpointmatcher/utest/ui/Transformations.cpp:39: Failure
Value of: transformedFeature.isApprox(transformedCloud.features.col(i), kEpsilonNumericalError)
  Actual: false
Expected: true
[  FAILED  ] Transformation.ComputeSimilarityTransformDataPoints3D (27 ms)
[----------] 7 tests from Transformation (135 ms total)


[----------] Global test environment tear-down
[==========] 80 tests from 13 test cases ran. (87892 ms total)
[  PASSED  ] 78 tests.
[  FAILED  ] 2 tests, listed below:
[  FAILED  ] Transformation.ComputeRigidTransformDataPoints3D
[  FAILED  ] Transformation.ComputeSimilarityTransformDataPoints3D

@aguenette
Copy link
Member Author

Hi @xlla! On Ubuntu 18.04, all the tests pass. So, I'm not sure that the problem comes from the refactor of the yaml-cpp API. Have you tried to run the tests on the master branch (i.e. using the old yaml-cpp API)? If not, can you please try it and tell me if you get the same tests failure? It's just to be sure that it's not related with the changed from this branch. Thanks!

@boxanm boxanm changed the base branch from master to develop November 4, 2023 14:24
@boxanm boxanm self-assigned this Nov 15, 2023
@boxanm boxanm merged commit 410b4de into norlab-ulaval:develop Nov 17, 2023
5 checks passed
@aguenette aguenette deleted the refactor/upgrade-yaml-cpp-api branch February 17, 2024 14:26
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.

Update to newer yaml-cpp API
5 participants