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

Build breaks with clang-19: error: ambiguous partial specializations of 'rebind_container<long, xt::svector<unsigned long>>' #168

Open
yurivict opened this issue Nov 2, 2024 · 2 comments

Comments

@yurivict
Copy link

yurivict commented Nov 2, 2024

In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/python/src/eroders.cpp:4:
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/include/fastscapelib/eroders/spl.hpp:14:
In file included from /usr/local/include/xtensor/xbroadcast.hpp:23:
In file included from /usr/local/include/xtensor/xaccessible.hpp:14:
In file included from /usr/local/include/xtensor/xstrides.hpp:21:
In file included from /usr/local/include/xtensor/xshape.hpp:23:
In file included from /usr/local/include/xtensor/xstorage.hpp:23:
In file included from /usr/local/include/xtensor/xtensor_simd.hpp:17:
/usr/local/include/xtensor/xutils.hpp:896:31: error: ambiguous partial specializations of 'rebind_container<long, xt::svector<unsigned long>>'
  896 |         using type = typename rebind_container<std::ptrdiff_t, S>::type;
      |                               ^
/usr/local/include/xtensor/xutils.hpp:924:5: note: in instantiation of template class 'xt::get_strides_type<xt::svector<unsigned long>>' requested here
  924 |     using get_strides_t = typename get_strides_type<C>::type;
      |     ^
/usr/local/include/xtensor/xarray.hpp:53:30: note: in instantiation of template type alias 'get_strides_t' requested here
   53 |         using strides_type = get_strides_t<shape_type>;
      |                              ^
/usr/local/include/xtensor/xcontainer.hpp:36:43: note: in instantiation of template class 'xt::xcontainer_inner_types<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
   36 |         using inner_shape_type = typename xcontainer_inner_types<D>::inner_shape_type;
      |                                           ^
/usr/local/include/xtensor/xarray.hpp:64:11: note: in instantiation of template class 'xt::xcontainer_iterable_types<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
   64 |         : xcontainer_iterable_types<xarray_container<EC, L, SC, Tag>>
      |           ^
/usr/local/include/xtensor/xiterable.hpp:43:43: note: in instantiation of template class 'xt::xiterable_inner_types<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
   43 |         using inner_shape_type = typename iterable_types::inner_shape_type;
      |                                           ^
/usr/local/include/xtensor/xiterable.hpp:151:30: note: (skipping 1 context in backtrace; use -ftemplate-backtrace-limit=0 to see all)
  151 |     class xiterable : public xconst_iterable<D>
      |                              ^
/usr/local/include/xtensor/xiterable.hpp:311:42: note: in instantiation of template class 'xt::xiterable<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
  311 |     class xcontiguous_iterable : private xiterable<D>
      |                                          ^
/usr/local/include/xtensor/xcontainer.hpp:71:31: note: in instantiation of template class 'xt::xcontiguous_iterable<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
   71 |     class xcontainer : public xcontiguous_iterable<D>,
      |                               ^
/usr/local/include/xtensor/xcontainer.hpp:260:39: note: in instantiation of template class 'xt::xcontainer<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
  260 |     class xstrided_container : public xcontainer<D>
      |                                       ^
/usr/local/include/xtensor/xarray.hpp:82:37: note: in instantiation of template class 'xt::xstrided_container<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
   82 |     class xarray_container : public xstrided_container<xarray_container<EC, L, SC, Tag>>,
      |                                     ^
/wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/include/fastscapelib/flow/flow_graph_impl.hpp:253:30: note: in instantiation of template class 'xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>' requested here
  253 |             xt::xarray<bool> m_mask;
      |                              ^
/usr/local/include/xtensor/xutils.hpp:883:12: note: partial specialization matches [with X = long, C = xt::svector, T = unsigned long, N = 4]
  883 |     struct rebind_container<X, C<T, N>>
      |            ^
/usr/local/include/xtensor/xstorage.hpp:1415:12: note: partial specialization matches [with X = long, T = unsigned long, N = 4, A = std::allocator<unsigned long>, B = true]
 1415 |     struct rebind_container<X, svector<T, N, A, B>>
      |            ^
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/python/src/eroders.cpp:4:
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/include/fastscapelib/eroders/spl.hpp:14:
In file included from /usr/local/include/xtensor/xbroadcast.hpp:25:
/usr/local/include/xtensor/xiterable.hpp:45:50: error: no type named 'stepper' in 'xt::xiterable_inner_types<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
   45 |         using stepper = typename iterable_types::stepper;
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/local/include/xtensor/xiterable.hpp:151:30: note: in instantiation of template class 'xt::xconst_iterable<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
  151 |     class xiterable : public xconst_iterable<D>
      |                              ^
/usr/local/include/xtensor/xiterable.hpp:311:42: note: in instantiation of template class 'xt::xiterable<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
  311 |     class xcontiguous_iterable : private xiterable<D>
      |                                          ^
/usr/local/include/xtensor/xcontainer.hpp:71:31: note: in instantiation of template class 'xt::xcontiguous_iterable<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
   71 |     class xcontainer : public xcontiguous_iterable<D>,
      |                               ^
/usr/local/include/xtensor/xcontainer.hpp:260:39: note: in instantiation of template class 'xt::xcontainer<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
  260 |     class xstrided_container : public xcontainer<D>
      |                                       ^
/usr/local/include/xtensor/xarray.hpp:82:37: note: in instantiation of template class 'xt::xstrided_container<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
   82 |     class xarray_container : public xstrided_container<xarray_container<EC, L, SC, Tag>>,
      |                                     ^
/wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/include/fastscapelib/flow/flow_graph_impl.hpp:253:30: note: in instantiation of template class 'xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>' requested here
  253 |             xt::xarray<bool> m_mask;
      |                              ^
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/python/src/eroders.cpp:4:
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/include/fastscapelib/eroders/spl.hpp:14:
In file included from /usr/local/include/xtensor/xbroadcast.hpp:25:
/usr/local/include/xtensor/xiterable.hpp:46:56: error: no type named 'const_stepper' in 'xt::xiterable_inner_types<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
   46 |         using const_stepper = typename iterable_types::const_stepper;
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/python/src/eroders.cpp:4:
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/include/fastscapelib/eroders/spl.hpp:15:
In file included from /usr/local/include/xtensor/xtensor.hpp:20:
/usr/local/include/xtensor/xcontainer.hpp:140:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
  140 |         using accessible_base::at;
      |               ^~~~~~~~~~~~~~~~~
/usr/local/include/xtensor/xcontainer.hpp:260:39: note: in instantiation of template class 'xt::xcontainer<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
  260 |     class xstrided_container : public xcontainer<D>
      |                                       ^
/usr/local/include/xtensor/xarray.hpp:82:37: note: in instantiation of template class 'xt::xstrided_container<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
   82 |     class xarray_container : public xstrided_container<xarray_container<EC, L, SC, Tag>>,
      |                                     ^
/wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/include/fastscapelib/flow/flow_graph_impl.hpp:253:30: note: in instantiation of template class 'xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>' requested here
  253 |             xt::xarray<bool> m_mask;
      |                              ^
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/python/src/eroders.cpp:4:
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/include/fastscapelib/eroders/spl.hpp:15:
In file included from /usr/local/include/xtensor/xtensor.hpp:20:
/usr/local/include/xtensor/xcontainer.hpp:141:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
  141 |         using accessible_base::shape;
      |               ^~~~~~~~~~~~~~~~~
/usr/local/include/xtensor/xcontainer.hpp:142:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
  142 |         using accessible_base::operator[];
      |               ^~~~~~~~~~~~~~~~~
/usr/local/include/xtensor/xcontainer.hpp:143:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
  143 |         using accessible_base::back;
      |               ^~~~~~~~~~~~~~~~~
/usr/local/include/xtensor/xcontainer.hpp:144:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
  144 |         using accessible_base::front;
      |               ^~~~~~~~~~~~~~~~~
/usr/local/include/xtensor/xcontainer.hpp:145:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
  145 |         using accessible_base::in_bounds;
      |               ^~~~~~~~~~~~~~~~~
/usr/local/include/xtensor/xcontainer.hpp:146:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
  146 |         using accessible_base::periodic;
      |               ^~~~~~~~~~~~~~~~~
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/python/src/eroders.cpp:4:
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/include/fastscapelib/eroders/spl.hpp:19:
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/include/fastscapelib/utils/xtensor_utils.hpp:10:
/usr/local/include/xtensor/xarray.hpp:93:52: error: no type named 'allocator_type' in 'xt::xstrided_container<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
   93 |         using allocator_type = typename base_type::allocator_type;
      |                                ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/include/fastscapelib/flow/flow_graph_impl.hpp:253:30: note: in instantiation of template class 'xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>' requested here
  253 |             xt::xarray<bool> m_mask;
      |                              ^
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/python/src/eroders.cpp:4:
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/include/fastscapelib/eroders/spl.hpp:19:
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/include/fastscapelib/utils/xtensor_utils.hpp:10:
/usr/local/include/xtensor/xarray.hpp:102:54: error: no type named 'backstrides_type' in 'xt::xstrided_container<xt::xarray_container<xt::uvector<bool>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
  102 |         using backstrides_type = typename base_type::backstrides_type;
      |                                  ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/python/src/eroders.cpp:4:
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/include/fastscapelib/eroders/spl.hpp:15:
In file included from /usr/local/include/xtensor/xtensor.hpp:20:
/usr/local/include/xtensor/xcontainer.hpp:855:21: error: no matching function for call to 'make_sequence'
  855 |         m_strides = xtl::make_sequence<inner_strides_type>(base_type::dimension(), 0);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/xtensor/xarray.hpp:502:11: note: in instantiation of member function 'xt::xstrided_container<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>::xstrided_container' requested here
  502 |         : base_type()
      |           ^
/usr/local/include/xtensor/xsemantic.hpp:601:24: note: in instantiation of function template specialization 'xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>::xarray_container<xt::xbroadcast<const xt::xfunction<xt::detail::minus, const xt::pyarray<double, xt::layout_type::row_major> &, xt::xstrided_view<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, std::array<unsigned long, 2>, xt::layout_type::dynamic>> &, xt::sequence_view<xt::xbuffer_adaptor<unsigned long *>, 0>>>' requested here
  601 |         temporary_type tmp(e);
      |                        ^
/usr/local/include/xtensor/xsemantic.hpp:749:24: note: in instantiation of function template specialization 'xt::xsemantic_base<xt::xview<xt::pyarray<double, xt::layout_type::row_major> &, xt::xall<unsigned long>, xt::xall<unsigned long>>>::operator=<xt::xbroadcast<const xt::xfunction<xt::detail::minus, const xt::pyarray<double, xt::layout_type::row_major> &, xt::xstrided_view<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, std::array<unsigned long, 2>, xt::layout_type::dynamic>> &, xt::sequence_view<xt::xbuffer_adaptor<unsigned long *>, 0>>>' requested here
  749 |             base_type::operator=(broadcast(rhs.derived_cast(), this->derived_cast().shape()));
      |                        ^
/usr/local/include/xtensor/xview.hpp:935:31: note: in instantiation of function template specialization 'xt::xview_semantic<xt::xview<xt::pyarray<double, xt::layout_type::row_major> &, xt::xall<unsigned long>, xt::xall<unsigned long>>>::operator=<xt::xfunction<xt::detail::minus, const xt::pyarray<double, xt::layout_type::row_major> &, xt::xstrided_view<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, std::array<unsigned long, 2>, xt::layout_type::dynamic>>>' requested here
  935 |         return semantic_base::operator=(e);
      |                               ^
/wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/include/fastscapelib/eroders/diffusion_adi.hpp:357:19: note: in instantiation of function template specialization 'xt::xview<xt::pyarray<double, xt::layout_type::row_major> &, xt::xall<unsigned long>, xt::xall<unsigned long>>::operator=<xt::xfunction<xt::detail::minus, const xt::pyarray<double, xt::layout_type::row_major> &, xt::xstrided_view<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, std::array<unsigned long, 2>, xt::layout_type::dynamic>>>' requested here
  357 |         erosion_v = elevation - xt::transpose(elevation_next);
      |                   ^
/wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/python/src/eroders.cpp:219:56: note: in instantiation of member function 'fastscapelib::diffusion_adi_eroder<fastscapelib::raster_grid_xt<fastscapelib::py_selector, fastscapelib::raster_connect::queen>, fastscapelib::py_selector>::erode' requested here
  219 |                              &py_diffusion_adi_eroder::erode,
      |                                                        ^
/usr/local/include/xtl/xsequence.hpp:107:14: note: candidate template ignored: substitution failure [with S = inner_strides_type]: type 'inner_strides_type' (aka 'int') cannot be used prior to '::' because it has no members
  107 |     inline S make_sequence(typename S::size_type size, typename S::value_type v)
      |              ^                      ~
/usr/local/include/xtl/xsequence.hpp:101:14: note: candidate function template not viable: requires single argument 'size', but 2 arguments were provided
  101 |     inline S make_sequence(typename S::size_type size)
      |              ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/xtl/xsequence.hpp:113:14: note: candidate function template not viable: requires single argument 'init', but 2 arguments were provided
  113 |     inline S make_sequence(std::initializer_list<typename S::value_type> init)
      |              ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/python/src/eroders.cpp:4:
In file included from /wrkdirs/usr/ports/misc/py-fastscapelib/work-py311/fastscapelib-0.2.2/include/fastscapelib/eroders/spl.hpp:15:
In file included from /usr/local/include/xtensor/xtensor.hpp:20:
/usr/local/include/xtensor/xcontainer.hpp:856:25: error: no matching function for call to 'make_sequence'
  856 |         m_backstrides = xtl::make_sequence<inner_backstrides_type>(base_type::dimension(), 0);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/xtl/xsequence.hpp:107:14: note: candidate template ignored: substitution failure [with S = inner_backstrides_type]: type 'inner_backstrides_type' (aka 'int') cannot be used prior to '::' because it has no members
  107 |     inline S make_sequence(typename S::size_type size, typename S::value_type v)
      |              ^                      ~
/usr/local/include/xtl/xsequence.hpp:101:14: note: candidate function template not viable: requires single argument 'size', but 2 arguments were provided
  101 |     inline S make_sequence(typename S::size_type size)
      |              ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~

log

Version: 0.2.2
FreeBSD 14.1

@benbovy
Copy link
Member

benbovy commented Nov 22, 2024

Thanks for the report. Similar errors have been reported upstream (xtensor-stack/xtensor#2804) so I don't think xtensor is compatible yet with clang 19.

@emmenlau
Copy link

See xtensor-stack/xtensor#2821 for work towards a potential fix. Help, reviews or testing is highly appreciated :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants