Open MSallermann opened 6 months ago
At the moment, we get a lot of compiler warnings from xtensor (at least on gcc). It would be good to fix that, so that nothing important gets lost.
See for example:
INFO: autodetecting backend as ninja INFO: calculating backend command to run: /home/moritz/micromamba/envs/flowyenv/bin/ninja -C /home/moritz/lavaflow/flowy/build ninja: Entering directory `/home/moritz/lavaflow/flowy/build' [4/24] Compiling C++ object libflowy.so.p/src_topography.cpp.o In file included from /usr/include/c++/13/algorithm:60, from /home/moritz/micromamba/envs/flowpyenv/include/xtensor-blas/xlinalg.hpp:13, from ../flowy/include/definitions.hpp:5, from ../flowy/include/topography.hpp:4, from ../src/topography.cpp:3: In static member function ‘static constexpr _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = const long unsigned int; _Up = long unsigned int; bool _IsMove = false]’, inlined from ‘constexpr _OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:506:30, inlined from ‘constexpr _OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = const long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:533:42, inlined from ‘constexpr _OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:540:31, inlined from ‘constexpr _OI std::copy(_II, _II, _OI) [with _II = const long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:633:7, inlined from ‘bool xt::xfunction<F, CT>::broadcast_shape(S&, bool) const [with S = std::array<long unsigned int, 1>; F = xt::math::sin_fun; CT = {const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&}]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xfunction.hpp:688:22, inlined from ‘bool xt::xfunction<F, CT>::broadcast_shape(S&, bool) const [with S = std::array<long unsigned int, 1>; F = xt::math::sin_fun; CT = {const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&}]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xfunction.hpp:684:17, inlined from ‘xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>, xt::math::sin_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>(xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>&, const xt::xfunction<xt::math::sin_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>&)::<lambda(auto:120)> [with auto:120 = xtl::identity]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xassign.hpp:608:60, inlined from ‘decltype(auto) xtl::mpl::static_if(std::false_type, const TF&, const FF&) [with TF = xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>, xt::math::sin_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>(xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>&, const xt::xfunction<xt::math::sin_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>&)::<lambda(auto:119)>; FF = xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>, xt::math::sin_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>(xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>&, const xt::xfunction<xt::math::sin_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>&)::<lambda(auto:120)>]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtl/xmeta_utils.hpp:597:22, inlined from ‘decltype(auto) xtl::mpl::static_if(const TF&, const FF&) [with bool cond = false; TF = xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>, xt::math::sin_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>(xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>&, const xt::xfunction<xt::math::sin_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>&)::<lambda(auto:119)>; FF = xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>, xt::math::sin_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>(xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>&, const xt::xfunction<xt::math::sin_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>&)::<lambda(auto:120)>]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtl/xmeta_utils.hpp:603:29, inlined from ‘static bool xt::xexpression_assigner<Tag>::resize(E1&, const xt::xfunction<F, CT ...>&) [with E1 = xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>; F = xt::math::sin_fun; CT = {const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&}; Tag = xt::xtensor_expression_tag]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xassign.hpp:588:102, inlined from ‘static void xt::xexpression_assigner<Tag>::assign_xexpression(E1&, const E2&) [with E1 = xt::xexpression<xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag> >; E2 = xt::xexpression<xt::xfunction<xt::math::sin_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >; Tag = xt::xtensor_expression_tag]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xassign.hpp:487:40, inlined from ‘xt::assign_xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>, xfunction<math::sin_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >(xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag> >&, const xexpression<xfunction<math::sin_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >&)::<lambda(auto:118)> [with auto:118 = xtl::identity]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xassign.hpp:226:62, inlined from ‘decltype(auto) xtl::mpl::static_if(std::false_type, const TF&, const FF&) [with TF = xt::assign_xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>, xfunction<math::sin_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >(xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag> >&, const xexpression<xfunction<math::sin_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >&)::<lambda(auto:117)>; FF = xt::assign_xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>, xfunction<math::sin_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >(xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag> >&, const xexpression<xfunction<math::sin_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >&)::<lambda(auto:118)>]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtl/xmeta_utils.hpp:597:22, inlined from ‘decltype(auto) xtl::mpl::static_if(const TF&, const FF&) [with bool cond = false; TF = xt::assign_xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>, xfunction<math::sin_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >(xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag> >&, const xexpression<xfunction<math::sin_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >&)::<lambda(auto:117)>; FF = xt::assign_xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>, xfunction<math::sin_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >(xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag> >&, const xexpression<xfunction<math::sin_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >&)::<lambda(auto:118)>]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtl/xmeta_utils.hpp:603:29, inlined from ‘void xt::assign_xexpression(xexpression<D>&, const xexpression<E2>&) [with E1 = xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>; E2 = xfunction<math::sin_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xassign.hpp:217:58, inlined from ‘xt::xcontainer_semantic<D>::derived_type& xt::xcontainer_semantic<D>::assign_xexpression(const xt::xexpression<E>&) [with E = xt::xfunction<xt::math::sin_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>; D = xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xsemantic.hpp:624:31, inlined from ‘xt::xsemantic_base<D>::derived_type& xt::xsemantic_base<D>::assign(const xt::xexpression<E>&) [with E = xt::xfunction<xt::math::sin_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>; D = xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xsemantic.hpp:490:55, inlined from ‘xt::xtensor_container<EC, N, L, Tag>::xtensor_container(const xt::xexpression<E>&) [with E = xt::xfunction<xt::math::sin_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>; EC = xt::uvector<double, std::allocator<double> >; long unsigned int N = 1; xt::layout_type L = xt::layout_type::row_major; Tag = xt::xtensor_expression_tag]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xtensor.hpp:572:30: /usr/include/c++/13/bits/stl_algobase.h:437:30: warning: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’ writing between 9 and 9223372036854775807 bytes into a region of size 8 overflows the destination [-Wstringop-overflow=] 437 | __builtin_memmove(__result, __first, sizeof(_Tp) * _Num); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xsemantic.hpp:16, from /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xstrided_view.hpp:25, from /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xgenerator.hpp:25, from /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xbuilder.hpp:31, from /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xmanipulation.hpp:19, from /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xmath.hpp:29, from /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xcontainer.hpp:25, from /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xarray.hpp:20, from /home/moritz/micromamba/envs/flowpyenv/include/xtensor-blas/xlinalg.hpp:18: /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xassign.hpp: In constructor ‘xt::xtensor_container<EC, N, L, Tag>::xtensor_container(const xt::xexpression<E>&) [with E = xt::xfunction<xt::math::sin_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>; EC = xt::uvector<double, std::allocator<double> >; long unsigned int N = 1; xt::layout_type L = xt::layout_type::row_major; Tag = xt::xtensor_expression_tag]’: /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xassign.hpp:607:28: note: destination object ‘shape’ of size 8 607 | index_type shape = uninitialized_shape<index_type>(size); | ^~~~~ In static member function ‘static constexpr _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = const long unsigned int; _Up = long unsigned int; bool _IsMove = false]’, inlined from ‘constexpr _OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:506:30, inlined from ‘constexpr _OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = const long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:533:42, inlined from ‘constexpr _OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:540:31, inlined from ‘constexpr _OI std::copy(_II, _II, _OI) [with _II = const long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:633:7, inlined from ‘bool xt::xfunction<F, CT>::broadcast_shape(S&, bool) const [with S = std::array<long unsigned int, 1>; F = xt::math::cos_fun; CT = {const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&}]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xfunction.hpp:688:22, inlined from ‘bool xt::xfunction<F, CT>::broadcast_shape(S&, bool) const [with S = std::array<long unsigned int, 1>; F = xt::math::cos_fun; CT = {const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&}]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xfunction.hpp:684:17, inlined from ‘xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>, xt::math::cos_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>(xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>&, const xt::xfunction<xt::math::cos_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>&)::<lambda(auto:120)> [with auto:120 = xtl::identity]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xassign.hpp:608:60, inlined from ‘decltype(auto) xtl::mpl::static_if(std::false_type, const TF&, const FF&) [with TF = xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>, xt::math::cos_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>(xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>&, const xt::xfunction<xt::math::cos_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>&)::<lambda(auto:119)>; FF = xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>, xt::math::cos_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>(xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>&, const xt::xfunction<xt::math::cos_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>&)::<lambda(auto:120)>]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtl/xmeta_utils.hpp:597:22, inlined from ‘decltype(auto) xtl::mpl::static_if(const TF&, const FF&) [with bool cond = false; TF = xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>, xt::math::cos_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>(xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>&, const xt::xfunction<xt::math::cos_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>&)::<lambda(auto:119)>; FF = xt::xexpression_assigner<xt::xtensor_expression_tag>::resize<xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>, xt::math::cos_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>(xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>&, const xt::xfunction<xt::math::cos_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>&)::<lambda(auto:120)>]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtl/xmeta_utils.hpp:603:29, inlined from ‘static bool xt::xexpression_assigner<Tag>::resize(E1&, const xt::xfunction<F, CT ...>&) [with E1 = xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>; F = xt::math::cos_fun; CT = {const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&}; Tag = xt::xtensor_expression_tag]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xassign.hpp:588:102, inlined from ‘static void xt::xexpression_assigner<Tag>::assign_xexpression(E1&, const E2&) [with E1 = xt::xexpression<xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag> >; E2 = xt::xexpression<xt::xfunction<xt::math::cos_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >; Tag = xt::xtensor_expression_tag]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xassign.hpp:487:40, inlined from ‘xt::assign_xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>, xfunction<math::cos_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >(xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag> >&, const xexpression<xfunction<math::cos_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >&)::<lambda(auto:118)> [with auto:118 = xtl::identity]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xassign.hpp:226:62, inlined from ‘decltype(auto) xtl::mpl::static_if(std::false_type, const TF&, const FF&) [with TF = xt::assign_xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>, xfunction<math::cos_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >(xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag> >&, const xexpression<xfunction<math::cos_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >&)::<lambda(auto:117)>; FF = xt::assign_xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>, xfunction<math::cos_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >(xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag> >&, const xexpression<xfunction<math::cos_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >&)::<lambda(auto:118)>]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtl/xmeta_utils.hpp:597:22, inlined from ‘decltype(auto) xtl::mpl::static_if(const TF&, const FF&) [with bool cond = false; TF = xt::assign_xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>, xfunction<math::cos_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >(xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag> >&, const xexpression<xfunction<math::cos_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >&)::<lambda(auto:117)>; FF = xt::assign_xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>, xfunction<math::cos_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >(xexpression<xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag> >&, const xexpression<xfunction<math::cos_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&> >&)::<lambda(auto:118)>]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtl/xmeta_utils.hpp:603:29, inlined from ‘void xt::assign_xexpression(xexpression<D>&, const xexpression<E2>&) [with E1 = xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>; E2 = xfunction<math::cos_fun, const xgenerator<detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xassign.hpp:217:58, inlined from ‘xt::xcontainer_semantic<D>::derived_type& xt::xcontainer_semantic<D>::assign_xexpression(const xt::xexpression<E>&) [with E = xt::xfunction<xt::math::cos_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>; D = xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xsemantic.hpp:624:31, inlined from ‘xt::xsemantic_base<D>::derived_type& xt::xsemantic_base<D>::assign(const xt::xexpression<E>&) [with E = xt::xfunction<xt::math::cos_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>; D = xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xsemantic.hpp:490:55, inlined from ‘xt::xtensor_container<EC, N, L, Tag>::xtensor_container(const xt::xexpression<E>&) [with E = xt::xfunction<xt::math::cos_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>; EC = xt::uvector<double, std::allocator<double> >; long unsigned int N = 1; xt::layout_type L = xt::layout_type::row_major; Tag = xt::xtensor_expression_tag]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xtensor.hpp:572:30: /usr/include/c++/13/bits/stl_algobase.h:437:30: warning: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’ writing between 9 and 9223372036854775807 bytes into a region of size 8 overflows the destination [-Wstringop-overflow=] 437 | __builtin_memmove(__result, __first, sizeof(_Tp) * _Num); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xassign.hpp: In constructor ‘xt::xtensor_container<EC, N, L, Tag>::xtensor_container(const xt::xexpression<E>&) [with E = xt::xfunction<xt::math::cos_fun, const xt::xgenerator<xt::detail::arange_generator<double, double, double>, double, std::array<long unsigned int, 1> >&>; EC = xt::uvector<double, std::allocator<double> >; long unsigned int N = 1; xt::layout_type L = xt::layout_type::row_major; Tag = xt::xtensor_expression_tag]’: /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xassign.hpp:607:28: note: destination object ‘shape’ of size 8 607 | index_type shape = uninitialized_shape<index_type>(size); | ^~~~~ [7/24] Compiling C++ object libflowy.so.p/src_netcdf_file.cpp.o In file included from /usr/include/c++/13/algorithm:60, from /home/moritz/micromamba/envs/flowpyenv/include/xtensor-blas/xlinalg.hpp:13, from ../flowy/include/definitions.hpp:5, from ../flowy/include/topography_file.hpp:4, from ../flowy/include/netcdf_file.hpp:6, from ../src/netcdf_file.cpp:3: In static member function ‘static constexpr _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = const long int; _Up = long int; bool _IsMove = false]’, inlined from ‘constexpr _OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const long int*; _OI = long int*]’ at /usr/include/c++/13/bits/stl_algobase.h:506:30, inlined from ‘constexpr _OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = const long int*; _OI = long int*]’ at /usr/include/c++/13/bits/stl_algobase.h:533:42, inlined from ‘constexpr _OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const long int*; _OI = long int*]’ at /usr/include/c++/13/bits/stl_algobase.h:540:31, inlined from ‘constexpr _OI std::copy(_II, _II, _OI) [with _II = const long int*; _OI = long int*]’ at /usr/include/c++/13/bits/stl_algobase.h:633:7, inlined from ‘auto xt::flip(E&&, std::size_t) [with E = xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>&]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xmanipulation.hpp:834:18, inlined from ‘auto xt::flip(E&&) [with E = xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>&]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xmanipulation.hpp:803:14, inlined from ‘virtual void Flowy::NetCDFFile::save(const std::filesystem::__cxx11::path&)’ at ../src/netcdf_file.cpp:314:34: /usr/include/c++/13/bits/stl_algobase.h:437:30: warning: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’ writing between 9 and 9223372036854775807 bytes into a region of size 8 overflows the destination [-Wstringop-overflow=] 437 | __builtin_memmove(__result, __first, sizeof(_Tp) * _Num); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xmath.hpp:29, from /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xcontainer.hpp:25, from /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xarray.hpp:20, from /home/moritz/micromamba/envs/flowpyenv/include/xtensor-blas/xlinalg.hpp:18: /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xmanipulation.hpp: In member function ‘virtual void Flowy::NetCDFFile::save(const std::filesystem::__cxx11::path&)’: /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xmanipulation.hpp:831:35: note: destination object ‘strides’ of size 8 831 | get_strides_t<shape_type> strides; | ^~~~~~~ In function ‘auto xt::flip(E&&, std::size_t) [with E = xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>&]’, inlined from ‘auto xt::flip(E&&) [with E = xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>&]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xmanipulation.hpp:803:14, inlined from ‘Flowy::NetCDFFile::NetCDFFile(const std::filesystem::__cxx11::path&, const std::optional<Flowy::TopographyCrop>&)’ at ../src/netcdf_file.cpp:186:22: /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xmanipulation.hpp:836:23: warning: ‘strides’ may be used uninitialized [-Wmaybe-uninitialized] 836 | strides[axis] *= -1; | ~~~~~~~~~~~~~~^~~~~ /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xmanipulation.hpp: In constructor ‘Flowy::NetCDFFile::NetCDFFile(const std::filesystem::__cxx11::path&, const std::optional<Flowy::TopographyCrop>&)’: /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xmanipulation.hpp:831:35: note: ‘strides’ declared here 831 | get_strides_t<shape_type> strides; | ^~~~~~~ In static member function ‘static constexpr _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = const long int; _Up = long int; bool _IsMove = false]’, inlined from ‘constexpr _OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const long int*; _OI = long int*]’ at /usr/include/c++/13/bits/stl_algobase.h:506:30, inlined from ‘constexpr _OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = const long int*; _OI = long int*]’ at /usr/include/c++/13/bits/stl_algobase.h:533:42, inlined from ‘constexpr _OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const long int*; _OI = long int*]’ at /usr/include/c++/13/bits/stl_algobase.h:540:31, inlined from ‘constexpr _OI std::copy(_II, _II, _OI) [with _II = const long int*; _OI = long int*]’ at /usr/include/c++/13/bits/stl_algobase.h:633:7, inlined from ‘auto xt::flip(E&&, std::size_t) [with E = xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>&]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xmanipulation.hpp:834:18, inlined from ‘auto xt::flip(E&&) [with E = xtensor_container<uvector<double, std::allocator<double> >, 1, xt::layout_type::row_major, xtensor_expression_tag>&]’ at /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xmanipulation.hpp:803:14, inlined from ‘Flowy::NetCDFFile::NetCDFFile(const std::filesystem::__cxx11::path&, const std::optional<Flowy::TopographyCrop>&)’ at ../src/netcdf_file.cpp:186:22: /usr/include/c++/13/bits/stl_algobase.h:437:30: warning: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’ writing between 9 and 9223372036854775807 bytes into a region of size 8 overflows the destination [-Wstringop-overflow=] 437 | __builtin_memmove(__result, __first, sizeof(_Tp) * _Num); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xmanipulation.hpp: In constructor ‘Flowy::NetCDFFile::NetCDFFile(const std::filesystem::__cxx11::path&, const std::optional<Flowy::TopographyCrop>&)’: /home/moritz/micromamba/envs/flowpyenv/include/xtensor/xmanipulation.hpp:831:35: note: destination object ‘strides’ of size 8 831 | get_strides_t<shape_type> strides; | ^~~~~~~
At the moment, we get a lot of compiler warnings from xtensor (at least on gcc). It would be good to fix that, so that nothing important gets lost.
See for example: