gudhi-devel icon indicating copy to clipboard operation
gudhi-devel copied to clipboard

Does not build with CGAL 5.5 in non-release mode

Open gspr opened this issue 2 years ago • 3 comments

Hi. PR #670 fixed issue #663 and improved CGAL 5.5 compatibility. However, GUDHI still does not seem to build with CGAL 5.5 as of the latest git head if not building in release mode:

In file included from /usr/include/CGAL/basic.h:26, from /usr/include/CGAL/Cartesian/Cartesian_base.h:20, from /usr/include/CGAL/Cartesian.h:20, from /tmp/gudhi-devel/src/GudhUI/model/Complex_typedefs.h:18: /usr/include/CGAL/STL_Extension/internal/boost/relaxed_heap.hpp: In instantiation of 'void CGAL::internal::boost_::relaxed_heap<IndexedType, Compare, ID>::remove(const value_type&) [with IndexedType = boost::detail::edge_desc_impl<boost::undirected_tag, long unsigned int>; Compare = Gudhi::contraction::Skeleton_blocker_contractor<Gudhi::skeleton_blocker::Skeleton_blocker_geometric_complex<Gudhi::skeleton_blocker::Skeleton_blocker_simple_geometric_traits<Geometry_trait> > >::Compare_cost; ID = Gudhi::contraction::Skeleton_blocker_contractor<Gudhi::skeleton_blocker::Skeleton_blocker_geometric_complex<Gudhi::skeleton_blocker::Skeleton_blocker_simple_geometric_traits<Geometry_trait> > >::Undirected_edge_id; value_type = boost::detail::edge_desc_impl<boost::undirected_tag, long unsigned int>]': /usr/include/CGAL/Modifiable_priority_queue.h:59:53: required from 'void CGAL::Modifiable_priority_queue<IndexedType_, Compare_, ID_, heap_type>::erase(const value_type&) [with IndexedType_ = boost::detail::edge_desc_impl<boost::undirected_tag, long unsigned int>; Compare_ = Gudhi::contraction::Skeleton_blocker_contractor<Gudhi::skeleton_blocker::Skeleton_blocker_geometric_complex<Gudhi::skeleton_blocker::Skeleton_blocker_simple_geometric_traits<Geometry_trait> > >::Compare_cost; ID_ = Gudhi::contraction::Skeleton_blocker_contractor<Gudhi::skeleton_blocker::Skeleton_blocker_geometric_complex<Gudhi::skeleton_blocker::Skeleton_blocker_simple_geometric_traits<Geometry_trait> > >::Undirected_edge_id; CGAL::Heap_type heap_type = CGAL::CGAL_BOOST_PENDING_RELAXED_HEAP; value_type = boost::detail::edge_desc_impl<boost::undirected_tag, long unsigned int>]' /tmp/gudhi-devel/src/Contraction/include/gudhi/Skeleton_blocker_contractor.h:260:20: required from 'void Gudhi::contraction::Skeleton_blocker_contractor<GeometricSimplifiableComplex, EdgeProfile>::remove_from_PQ(Edge_handle, Edge_data&) [with GeometricSimplifiableComplex = Gudhi::skeleton_blocker::Skeleton_blocker_geometric_complex<Gudhi::skeleton_blocker::Skeleton_blocker_simple_geometric_traits<Geometry_trait> >; EdgeProfile = Gudhi::contraction::Edge_profile<Gudhi::skeleton_blocker::Skeleton_blocker_geometric_complex<Gudhi::skeleton_blocker::Skeleton_blocker_simple_geometric_traits<Geometry_trait> > >; Edge_handle = boost::detail::edge_desc_impl<boost::undirected_tag, long unsigned int>]' /tmp/gudhi-devel/src/Contraction/include/gudhi/Skeleton_blocker_contractor.h:515:7: required from 'void Gudhi::contraction::Skeleton_blocker_contractor<GeometricSimplifiableComplex, EdgeProfile>::on_remove_edge(Vertex_handle, Vertex_handle) [with GeometricSimplifiableComplex = Gudhi::skeleton_blocker::Skeleton_blocker_geometric_complex<Gudhi::skeleton_blocker::Skeleton_blocker_simple_geometric_traits<Geometry_trait> >; EdgeProfile = Gudhi::contraction::Edge_profile<Gudhi::skeleton_blocker::Skeleton_blocker_geometric_complex<Gudhi::skeleton_blocker::Skeleton_blocker_simple_geometric_traits<Geometry_trait> > >; Vertex_handle = Gudhi::skeleton_blocker::Skeleton_blocker_simple_traits::Vertex_handle]' /tmp/gudhi-devel/src/Contraction/include/gudhi/Skeleton_blocker_contractor.h:510:8: required from here /usr/include/CGAL/STL_Extension/internal/boost/relaxed_heap.hpp:197:9: error: no matching function for call to 'possibly(__gnu_cxx::__alloc_traits<std::allocator<boost::optional<boost::detail::edge_desc_impl<boost::undirected_tag, long unsigned int> > >, boost::optional<boost::detail::edge_desc_impl<boost::undirected_tag, long unsigned int> > >::value_type&)' 197 | CGAL_assertion(groups[get(id, x)]); | ^~~~~~~~~~~~~~ In file included from /usr/include/CGAL/assertions.h:331: /usr/include/CGAL/Uncertain.h:253:13: note: candidate: 'bool CGAL::possibly(bool)' 253 | inline bool possibly(bool b) { return b; } | ^~~~~~~~ /usr/include/CGAL/Uncertain.h:253:27: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<boost::optional<boost::detail::edge_desc_impl<boost::undirected_tag, long unsigned int> > >, boost::optional<boost::detail::edge_desc_impl<boost::undirected_tag, long unsigned int> > >::value_type' {aka 'boost::optional<boost::detail::edge_desc_impl<boost::undirected_tag, long unsigned int> >'} to 'bool' 253 | inline bool possibly(bool b) { return b; } | ~~~~~^ /usr/include/CGAL/Uncertain.h:265:6: note: candidate: 'bool CGAL::possibly(Uncertain)' 265 | bool possibly(Uncertain c) | ^~~~~~~~ /usr/include/CGAL/Uncertain.h:265:31: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<boost::optional<boost::detail::edge_desc_impl<boost::undirected_tag, long unsigned int> > >, boost::optional<boost::detail::edge_desc_impl<boost::undirected_tag, long unsigned int> > >::value_type' {aka 'boost::optional<boost::detail::edge_desc_impl<boost::undirected_tag, long unsigned int> >'} to 'CGAL::Uncertain' 265 | bool possibly(Uncertain c) | ~~~~~~~~~~~~~~~~^

In release mode (cmake -DCMAKE_BUILD_TYPE=Release), things work well. I'm guessing that simply disables the assertions in question.

gspr avatar Aug 15 '22 12:08 gspr

Thanks and you are right ! I tested my fix with CGAL versions 4.13, 4.14, 4.14.1, 5.0, 5.0.1, 5.1, 5.1.1, 5.2, 5.2.1, 5.3, 5.3.1, 5.4, 5.4.1 and 5.5, but I did not think it could fail in debug mode. This CGAL_assertion in relaxed_heap does not augur some good news.

VincentRouvreau avatar Aug 15 '22 20:08 VincentRouvreau

After investigation, it seems to be more a CGAL issue, cf. https://github.com/CGAL/cgal/issues/6799

VincentRouvreau avatar Aug 16 '22 09:08 VincentRouvreau

Interesting.

Could you elaborate on commit 71cbf8f35814d247fe7421c079a6ea78da2282f4 ? What is the role of the relaxed heap?

gspr avatar Aug 16 '22 11:08 gspr

This seems to be fixed in CGAL-5.5.1. Please reopen if I am wrong.

mglisse avatar Nov 03 '22 14:11 mglisse

Marc Glisse @.***> writes:

This seems to be fixed in CGAL-5.5.1. Please reopen if I am wrong.

I can confirm this. Thanks!

gspr avatar Nov 03 '22 15:11 gspr