Skip to content

xtensor readme example doesn't work with xeus-cpp-lite #2823

Open

Description

@anutosh491

How to replicate

  1. Build xeus-cpp-lite through recommended steps here (https://github.com/compiler-research/xeus-cpp?tab=readme-ov-file#installation-within-a-mamba-environment-wasm-build-instructions)
  2. Install xtensor in your PREFIX, using micromamba install xtensor -c https://repo.mamba.pm/emscripten-forge before the build.

Image

I am guessing this some problem using xtensor with xsimd ?
So we might want to investigate the recipe for xtensor on emscripten-forge

Something that works

  1. Simple inclusion of headers
  2. Maybe working around the above error

Image

Activity

  1. anutosh491 commented on Jan 27, 2025

    @anutosh491
    ContributorAuthor

    Pasting the full error here

    In file included from <<< inputs >>>:1:
    In file included from input_line_2:2:
    In file included from /include/xtensor/xarray.hpp:19:
    In file included from /include/xtensor/xbuffer_adaptor.hpp:21:
    In file included from /include/xtensor/xstorage.hpp:23:
    In file included from /include/xtensor/xtensor_simd.hpp:17:
    /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;
          |                               ^
    /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;
          |     ^
    /include/xtensor/xstrided_view.hpp:91:36: note: in instantiation of template type alias 'get_strides_t' requested here
       91 |         using inner_strides_type = get_strides_t<inner_shape_type>;
          |                                    ^
    /include/xtensor/xiterable.hpp:43:43: note: in instantiation of template class 'xt::xiterable_inner_types<xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>>' requested here
       43 |         using inner_shape_type = typename iterable_types::inner_shape_type;
          |                                           ^
    /include/xtensor/xiterable.hpp:151:30: note: in instantiation of template class 'xt::xconst_iterable<xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>>' requested here
      151 |     class xiterable : public xconst_iterable<D>
          |                              ^
    /include/xtensor/xstrided_view.hpp:131:18: note: in instantiation of template class 'xt::xiterable<xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>>' requested here
      131 |           public select_iterable_base_t<L, std::decay_t<CT>::static_layout, xstrided_view<CT, S, L, FST>>,
          |                  ^
    /include/xtensor/xstrided_view.hpp:801:16: note: in instantiation of template class 'xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>' requested here
      801 |         return view_type(
          |                ^
    /include/xtensor/xio.hpp:271:31: note: in instantiation of function template specialization 'xt::strided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &>' requested here
      271 |             const auto view = strided_view(e, slices);
          |                               ^
    /include/xtensor/xio.hpp:810:17: note: in instantiation of function template specialization 'xt::detail::recurser_run<xt::detail::printer<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>, xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      810 |         detail::recurser_run(p, d, sv, lim);
          |                 ^
    /include/xtensor/xio.hpp:823:16: note: in instantiation of function template specialization 'xt::pretty_print<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      823 |         return pretty_print(e, out);
          |                ^
    input_line_9:1:5: note: in instantiation of function template specialization 'xt::operator<<<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
        1 | oss << res;
          |     ^
    /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>>
          |            ^
    /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 <<< inputs >>>:1:
    In file included from input_line_2:2:
    In file included from /include/xtensor/xarray.hpp:20:
    In file included from /include/xtensor/xcontainer.hpp:25:
    In file included from /include/xtensor/xmath.hpp:29:
    In file included from /include/xtensor/xmanipulation.hpp:19:
    In file included from /include/xtensor/xbuilder.hpp:31:
    In file included from /include/xtensor/xgenerator.hpp:25:
    In file included from /include/xtensor/xstrided_view.hpp:27:
    /include/xtensor/xstrided_view_base.hpp:191:38: error: type 'xt::xstrided_view_base<xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>>::strides_type' (aka 'int') cannot be used prior to '::' because it has no members
      191 |         using offset_type = typename strides_type::value_type;
          |                                      ^
    /include/xtensor/xstrided_view.hpp:132:19: note: in instantiation of template class 'xt::xstrided_view_base<xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>>' requested here
      132 |           private xstrided_view_base<xstrided_view<CT, S, L, FST>>,
          |                   ^
    /include/xtensor/xstrided_view.hpp:801:16: note: in instantiation of template class 'xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>' requested here
      801 |         return view_type(
          |                ^
    /include/xtensor/xio.hpp:271:31: note: in instantiation of function template specialization 'xt::strided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &>' requested here
      271 |             const auto view = strided_view(e, slices);
          |                               ^
    /include/xtensor/xio.hpp:810:17: note: in instantiation of function template specialization 'xt::detail::recurser_run<xt::detail::printer<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>, xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      810 |         detail::recurser_run(p, d, sv, lim);
          |                 ^
    /include/xtensor/xio.hpp:823:16: note: in instantiation of function template specialization 'xt::pretty_print<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      823 |         return pretty_print(e, out);
          |                ^
    input_line_9:1:5: note: in instantiation of function template specialization 'xt::operator<<<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
        1 | oss << res;
          |     ^
    In file included from <<< inputs >>>:1:
    In file included from input_line_2:2:
    In file included from /include/xtensor/xarray.hpp:20:
    In file included from /include/xtensor/xcontainer.hpp:25:
    In file included from /include/xtensor/xmath.hpp:29:
    In file included from /include/xtensor/xmanipulation.hpp:19:
    In file included from /include/xtensor/xbuilder.hpp:31:
    In file included from /include/xtensor/xgenerator.hpp:25:
    /include/xtensor/xstrided_view.hpp:300:26: error: 'set_offset' is a protected member of 'xt::xstrided_view_base<xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>>'
      300 |         using base_type::set_offset;
          |                          ^
    /include/xtensor/xstrided_view.hpp:801:16: note: in instantiation of template class 'xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>' requested here
      801 |         return view_type(
          |                ^
    /include/xtensor/xio.hpp:271:31: note: in instantiation of function template specialization 'xt::strided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &>' requested here
      271 |             const auto view = strided_view(e, slices);
          |                               ^
    /include/xtensor/xio.hpp:810:17: note: in instantiation of function template specialization 'xt::detail::recurser_run<xt::detail::printer<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>, xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      810 |         detail::recurser_run(p, d, sv, lim);
          |                 ^
    /include/xtensor/xio.hpp:823:16: note: in instantiation of function template specialization 'xt::pretty_print<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      823 |         return pretty_print(e, out);
          |                ^
    input_line_9:1:5: note: in instantiation of function template specialization 'xt::operator<<<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
        1 | oss << res;
          |     ^
    /include/xtensor/xstrided_view_base.hpp:202:14: note: declared protected here
      202 |         void set_offset(size_type offset);
          |              ^
    /include/xtensor/xstrided_view_base.hpp:932:41: error: no matching member function for call to 'fill_args'
      932 |                     else if (base_type::fill_args(slices, i, idx, old_shape[i_ax], old_strides[i_ax], new_shape, new_strides))
          |                              ~~~~~~~~~~~^~~~~~~~~
    /include/xtensor/xstrided_view.hpp:793:14: note: in instantiation of function template specialization 'xt::detail::strided_view_args<xt::detail::no_adj_strides_policy>::fill_args<std::array<unsigned long, 1>, xt::svector<long>, std::vector<mpark::variant<long, xt::xrange_adaptor<xt::placeholders::xtuph, long, long>, xt::xrange_adaptor<long, xt::placeholders::xtuph>, xt::xrange_adaptor<long, long, xt::placeholders::xtuph>, xt::xrange_adaptor<long, xt::placeholders::xtuph, xt::placeholders::xtuph>, xt::xrange_adaptor<xt::placeholders::xtuph, long>, xt::xrange_adaptor<xt::placeholders::xtuph, xt::placeholders::xtuph, long>, xt::xrange_adaptor<long>, xt::xrange_adaptor<xt::placeholders::xtuph>, xt::xrange<long>, xt::xstepped_range<long>, xt::xall_tag, xt::xellipsis_tag, xt::xnewaxis_tag>>>' requested here
      793 |         args.fill_args(
          |              ^
    /include/xtensor/xio.hpp:810:17: note: in instantiation of function template specialization 'xt::detail::recurser_run<xt::detail::printer<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>, xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      810 |         detail::recurser_run(p, d, sv, lim);
          |                 ^
    /include/xtensor/xio.hpp:823:16: note: in instantiation of function template specialization 'xt::pretty_print<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      823 |         return pretty_print(e, out);
          |                ^
    input_line_9:1:5: note: in instantiation of function template specialization 'xt::operator<<<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
        1 | oss << res;
          |     ^
    [/](http://127.0.0.1:8081/lab/index.html)include/xtensor[/](http://127.0.0.1:8081/lab/index.html)xstrided_view.hpp:749:18: note: candidate function [with ST = long, S = xt::svector<unsigned long>] not viable: no known conversion from 'strides_type' (aka 'svector<long, 4>') to 'get_strides_t<svector<unsigned long, 4, allocator<unsigned long>, true>> &' (aka 'int &') for 7th argument
      749 |             bool fill_args(
          |                  ^
      750 |                 const xstrided_slice_vector& [/](http://127.0.0.1:8081/lab/index.html)*slices*[/](http://127.0.0.1:8081/lab/index.html),
      751 |                 std::size_t [/](http://127.0.0.1:8081/lab/index.html)*sl_idx*[/](http://127.0.0.1:8081/lab/index.html),
      752 |                 std::size_t [/](http://127.0.0.1:8081/lab/index.html)*i*/,
      753 |                 std::size_t [/](http://127.0.0.1:8081/lab/index.html)*old_shape*/,
      754 |                 const ST& [/](http://127.0.0.1:8081/lab/index.html)*old_stride*[/](http://127.0.0.1:8081/lab/index.html),
      755 |                 S& [/](http://127.0.0.1:8081/lab/index.html)*shape*[/](http://127.0.0.1:8081/lab/index.html),
      756 |                 get_strides_t<S>& [/](http://127.0.0.1:8081/lab/index.html)*strides*[/](http://127.0.0.1:8081/lab/index.html)
          |                 ~~~~~~~~~~~~~~~~~
    In file included from <<< inputs >>>:1:
    In file included from input_line_2:3:
    /include/xtensor/xio.hpp:203:31: error: no matching function for call to 'strided_view'
      203 |             const auto view = xt::strided_view(e, slices);
          |                               ^~~~~~~~~~~~~~~~
    /include/xtensor/xio.hpp:813:9: note: in instantiation of function template specialization 'xt::detail::xoutput<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>, xt::detail::printer<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>>' requested here
      813 |         xoutput(out, d, sv, p, 1, p.width(), lim, static_cast<std::size_t>(po.line_width));
          |         ^
    /include/xtensor/xio.hpp:823:16: note: in instantiation of function template specialization 'xt::pretty_print<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      823 |         return pretty_print(e, out);
          |                ^
    input_line_9:1:5: note: in instantiation of function template specialization 'xt::operator<<<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
        1 | oss << res;
          |     ^
    /include/xtensor/xstrided_view.hpp:790:17: note: candidate template ignored: substitution failure [with E = const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &]
      790 |     inline auto strided_view(E&& e, const xstrided_slice_vector& slices)
          |                 ^
    /include/xtensor/xstrided_view.hpp:728:17: note: candidate function template not viable: requires at least 3 arguments, but 2 were provided
      728 |     inline auto strided_view(E&& e, S&& shape, X&& strides, std::size_t offset, layout_type layout) noexcept
          |                 ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Failed to parse via ::process:Parsing failed.
    Error: Compilation error! In file included from <<< inputs >>>:1:
    In file included from input_line_2:2:
    In file included from /include/xtensor/xarray.hpp:19:
    In file included from /include/xtensor/xbuffer_adaptor.hpp:21:
    In file included from /include/xtensor/xstorage.hpp:23:
    In file included from /include/xtensor/xtensor_simd.hpp:17:
    /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;
          |                               ^
    /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;
          |     ^
    /include/xtensor/xstrided_view.hpp:91:36: note: in instantiation of template type alias 'get_strides_t' requested here
       91 |         using inner_strides_type = get_strides_t<inner_shape_type>;
          |                                    ^
    /include/xtensor/xiterable.hpp:43:43: note: in instantiation of template class 'xt::xiterable_inner_types<xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>>' requested here
       43 |         using inner_shape_type = typename iterable_types::inner_shape_type;
          |                                           ^
    /include/xtensor/xiterable.hpp:151:30: note: in instantiation of template class 'xt::xconst_iterable<xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>>' requested here
      151 |     class xiterable : public xconst_iterable<D>
          |                              ^
    /include/xtensor/xstrided_view.hpp:131:18: note: in instantiation of template class 'xt::xiterable<xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>>' requested here
      131 |           public select_iterable_base_t<L, std::decay_t<CT>::static_layout, xstrided_view<CT, S, L, FST>>,
          |                  ^
    /include/xtensor/xstrided_view.hpp:801:16: note: in instantiation of template class 'xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>' requested here
      801 |         return view_type(
          |                ^
    /include/xtensor/xio.hpp:271:31: note: in instantiation of function template specialization 'xt::strided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &>' requested here
      271 |             const auto view = strided_view(e, slices);
          |                               ^
    /include/xtensor/xio.hpp:810:17: note: in instantiation of function template specialization 'xt::detail::recurser_run<xt::detail::printer<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>, xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      810 |         detail::recurser_run(p, d, sv, lim);
          |                 ^
    /include/xtensor/xio.hpp:823:16: note: in instantiation of function template specialization 'xt::pretty_print<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      823 |         return pretty_print(e, out);
          |                ^
    input_line_9:1:5: note: in instantiation of function template specialization 'xt::operator<<<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
        1 | oss << res;
          |     ^
    /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>>
          |            ^
    /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 <<< inputs >>>:1:
    In file included from input_line_2:2:
    In file included from /include/xtensor/xarray.hpp:20:
    In file included from /include/xtensor/xcontainer.hpp:25:
    In file included from /include/xtensor/xmath.hpp:29:
    In file included from /include/xtensor/xmanipulation.hpp:19:
    In file included from /include/xtensor/xbuilder.hpp:31:
    In file included from /include/xtensor/xgenerator.hpp:25:
    In file included from /include/xtensor/xstrided_view.hpp:27:
    /include/xtensor/xstrided_view_base.hpp:191:38: error: type 'xt::xstrided_view_base<xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>>::strides_type' (aka 'int') cannot be used prior to '::' because it has no members
      191 |         using offset_type = typename strides_type::value_type;
          |                                      ^
    /include/xtensor/xstrided_view.hpp:132:19: note: in instantiation of template class 'xt::xstrided_view_base<xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>>' requested here
      132 |           private xstrided_view_base<xstrided_view<CT, S, L, FST>>,
          |                   ^
    /include/xtensor/xstrided_view.hpp:801:16: note: in instantiation of template class 'xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>' requested here
      801 |         return view_type(
          |                ^
    /include/xtensor/xio.hpp:271:31: note: in instantiation of function template specialization 'xt::strided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &>' requested here
      271 |             const auto view = strided_view(e, slices);
          |                               ^
    /include/xtensor/xio.hpp:810:17: note: in instantiation of function template specialization 'xt::detail::recurser_run<xt::detail::printer<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>, xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      810 |         detail::recurser_run(p, d, sv, lim);
          |                 ^
    /include/xtensor/xio.hpp:823:16: note: in instantiation of function template specialization 'xt::pretty_print<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      823 |         return pretty_print(e, out);
          |                ^
    input_line_9:1:5: note: in instantiation of function template specialization 'xt::operator<<<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
        1 | oss << res;
          |     ^
    In file included from <<< inputs >>>:1:
    In file included from input_line_2:2:
    In file included from /include/xtensor/xarray.hpp:20:
    In file included from /include/xtensor/xcontainer.hpp:25:
    In file included from /include/xtensor/xmath.hpp:29:
    In file included from /include/xtensor/xmanipulation.hpp:19:
    In file included from /include/xtensor/xbuilder.hpp:31:
    In file included from /include/xtensor/xgenerator.hpp:25:
    /include/xtensor/xstrided_view.hpp:300:26: error: 'set_offset' is a protected member of 'xt::xstrided_view_base<xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>>'
      300 |         using base_type::set_offset;
          |                          ^
    /include/xtensor/xstrided_view.hpp:801:16: note: in instantiation of template class 'xt::xstrided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &, xt::svector<unsigned long>>' requested here
      801 |         return view_type(
          |                ^
    /include/xtensor/xio.hpp:271:31: note: in instantiation of function template specialization 'xt::strided_view<const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &>' requested here
      271 |             const auto view = strided_view(e, slices);
          |                               ^
    /include/xtensor/xio.hpp:810:17: note: in instantiation of function template specialization 'xt::detail::recurser_run<xt::detail::printer<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>, xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      810 |         detail::recurser_run(p, d, sv, lim);
          |                 ^
    /include/xtensor/xio.hpp:823:16: note: in instantiation of function template specialization 'xt::pretty_print<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      823 |         return pretty_print(e, out);
          |                ^
    input_line_9:1:5: note: in instantiation of function template specialization 'xt::operator<<<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
        1 | oss << res;
          |     ^
    /include/xtensor/xstrided_view_base.hpp:202:14: note: declared protected here
      202 |         void set_offset(size_type offset);
          |              ^
    /include/xtensor/xstrided_view_base.hpp:932:41: error: no matching member function for call to 'fill_args'
      932 |                     else if (base_type::fill_args(slices, i, idx, old_shape[i_ax], old_strides[i_ax], new_shape, new_strides))
          |                              ~~~~~~~~~~~^~~~~~~~~
    /include/xtensor/xstrided_view.hpp:793:14: note: in instantiation of function template specialization 'xt::detail::strided_view_args<xt::detail::no_adj_strides_policy>::fill_args<std::array<unsigned long, 1>, xt::svector<long>, std::vector<mpark::variant<long, xt::xrange_adaptor<xt::placeholders::xtuph, long, long>, xt::xrange_adaptor<long, xt::placeholders::xtuph>, xt::xrange_adaptor<long, long, xt::placeholders::xtuph>, xt::xrange_adaptor<long, xt::placeholders::xtuph, xt::placeholders::xtuph>, xt::xrange_adaptor<xt::placeholders::xtuph, long>, xt::xrange_adaptor<xt::placeholders::xtuph, xt::placeholders::xtuph, long>, xt::xrange_adaptor<long>, xt::xrange_adaptor<xt::placeholders::xtuph>, xt::xrange<long>, xt::xstepped_range<long>, xt::xall_tag, xt::xellipsis_tag, xt::xnewaxis_tag>>>' requested here
      793 |         args.fill_args(
          |              ^
    /include/xtensor/xio.hpp:810:17: note: in instantiation of function template specialization 'xt::detail::recurser_run<xt::detail::printer<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>, xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      810 |         detail::recurser_run(p, d, sv, lim);
          |                 ^
    [/](http://127.0.0.1:8081/lab/index.html)include/xtensor[/](http://127.0.0.1:8081/lab/index.html)xio.hpp:823:16: note: in instantiation of function template specialization 'xt::pretty_print<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      823 |         return pretty_print(e, out);
          |                ^
    input_line_9:1:5: note: in instantiation of function template specialization 'xt::operator<<<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
        1 | oss << res;
          |     ^
    [/](http://127.0.0.1:8081/lab/index.html)include/xtensor[/](http://127.0.0.1:8081/lab/index.html)xstrided_view.hpp:749:18: note: candidate function [with ST = long, S = xt::svector<unsigned long>] not viable: no known conversion from 'strides_type' (aka 'svector<long, 4>') to 'get_strides_t<svector<unsigned long, 4, allocator<unsigned long>, true>> &' (aka 'int &') for 7th argument
      749 |             bool fill_args(
          |                  ^
      750 |                 const xstrided_slice_vector& [/](http://127.0.0.1:8081/lab/index.html)*slices*[/](http://127.0.0.1:8081/lab/index.html),
      751 |                 std::size_t [/](http://127.0.0.1:8081/lab/index.html)*sl_idx*/,
      752 |                 std::size_t [/](http://127.0.0.1:8081/lab/index.html)*i*/,
      753 |                 std::size_t [/](http://127.0.0.1:8081/lab/index.html)*old_shape*/,
      754 |                 const ST& [/](http://127.0.0.1:8081/lab/index.html)*old_stride*[/](http://127.0.0.1:8081/lab/index.html),
      755 |                 S& [/](http://127.0.0.1:8081/lab/index.html)*shape*/,
      756 |                 get_strides_t<S>& [/](http://127.0.0.1:8081/lab/index.html)*strides*[/](http://127.0.0.1:8081/lab/index.html)
          |                 ~~~~~~~~~~~~~~~~~
    In file included from <<< inputs >>>:1:
    In file included from input_line_2:3:
    /include/xtensor/xio.hpp:203:31: error: no matching function for call to 'strided_view'
      203 |             const auto view = xt::strided_view(e, slices);
          |                               ^~~~~~~~~~~~~~~~
    /include/xtensor/xio.hpp:813:9: note: in instantiation of function template specialization 'xt::detail::xoutput<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>, xt::detail::printer<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>>' requested here
      813 |         xoutput(out, d, sv, p, 1, p.width(), lim, static_cast<std::size_t>(po.line_width));
          |         ^
    /include/xtensor/xio.hpp:823:16: note: in instantiation of function template specialization 'xt::pretty_print<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
      823 |         return pretty_print(e, out);
          |                ^
    input_line_9:1:5: note: in instantiation of function template specialization 'xt::operator<<<xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &>>' requested here
        1 | oss << res;
          |     ^
    /include/xtensor/xstrided_view.hpp:790:17: note: candidate template ignored: substitution failure [with E = const xt::xfunction<xt::detail::plus, xt::xview<xt::xtensor_container<xt::uvector<double>, 2, xt::layout_type::row_major> &, int>, const xt::xtensor_container<xt::uvector<double>, 1, xt::layout_type::row_major> &> &]
      790 |     inline auto strided_view(E&& e, const xstrided_slice_vector& slices)
          |                 ^
    /include/xtensor/xstrided_view.hpp:728:17: note: candidate function template not viable: requires at least 3 arguments, but 2 were provided
      728 |     inline auto strided_view(E&& e, S&& shape, X&& strides, std::size_t offset, layout_type layout) noexcept
          |                 ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Failed to parse via ::process:Parsing failed.
    
  2. ThisIsFineTM commented on Apr 8, 2025

    @ThisIsFineTM
    Contributor

    I got this same error in a different context.

    version 0.25.0:
    When I compiled with Clang 19.1, I got this error. I did not get this error when compiling with GCC 14.2. I am not sure as to why.

    version 0.26.0:
    The error went away. If you build xtensor from source it may work around your issue, but note that 0.26.0 changed the directory structure, so that would need to be taken into account for anything depending on xtensor.

  3. anutosh491 commented on Apr 11, 2025

    @anutosh491
    ContributorAuthor

    Yes this error should now be fixed after the latest release. I can get xtensor working completely in the browser and can be put to use in a REPL format

    Image

  4. anutosh491 commented on Apr 11, 2025

    @anutosh491
    ContributorAuthor

    Thanks for trying this out @ThisIsFineTM

    Also @JohanMabille before I go ahead an close this issue. I think with the latest release, we should be able to provide a link in the readme for our users to try out xtensor with xeus-cpp-lite.

    But rather than this being done from my account, what would be better I think is that

    1. Through the xtensor stack org account I'd assume if we could fork this https://github.com/jupyterlite/xeus-lite-demo
      and edit the env to include xeus-cpp and xtensor there
    2. That should probably generate the static link under xtensor-stack/some-name (can name it xtensor-deployment or soemthing I guess)
    3. Then we can share that link in our readme !

    Also before all of this we need to merge emscripten-forge/recipes#2247

  5. JohanMabille commented on Apr 11, 2025

    @JohanMabille
    Member

    Ok, let's keep this one open for now, I'll try to do that next week.

    @ThisIsFineTM Thanks for trying it/ Let me know if you need a fix for xtensor 0.25, we can create a branch for it.

  6. ThisIsFineTM commented on Apr 12, 2025

    @ThisIsFineTM
    Contributor

    Will do. Right now I'm just looking at upgrading to the next release and shelving clang builds for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions