xtensor-stack / xtensor

C++ tensors with broadcasting and lazy computing
BSD 3-Clause "New" or "Revised" License
3.33k stars 398 forks source link

Error upon compiling small .so program on g++8 #1037

Closed OneRaynyDay closed 6 years ago

OneRaynyDay commented 6 years ago

Simple reproducible example:

logreg.h:

#pragma once
#include <iostream>
#include <xtensor/xarray.hpp>
#include <xtensor/xio.hpp>
#include <xtensor/xview.hpp>
#include <xtensor/xexpression.hpp>
#include <xtensor/xnpy.hpp>
#include <xtensor/xsort.hpp>
#include <xtensor-blas/xlinalg.hpp>

xt::xarray<float> run(const xt::xarray<float>&);

logreg.cpp:

#include "logreg.h"

xt::xarray<float> run(const xt::xarray<double>& x){
    xt::xarray<float> y { {1, 2.5} };
    return y;
}

Running it with the following flags on apple clang with following configs:

(cling) ❯ g++ --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Gives us:

(cling) ❯ make
g++ -shared -fPIC -std=c++17 -Wall -I/Users/ray_zhang/anaconda3/envs/cling/include -o libxnor.so logreg.cpp
In file included from logreg.cpp:1:
In file included from ./logreg.h:3:
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xarray.hpp:19:
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xcontainer.hpp:23:
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xmath.hpp:26:
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xslice.hpp:109:50: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        XTENSOR_GLOBAL_CONSTEXPR rangemaker<> _r{0, 0, 0};
                                                 ^~~~~~~
                                                 {      }
In file included from logreg.cpp:1:
In file included from ./logreg.h:3:
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xarray.hpp:19:
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xcontainer.hpp:23:
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xmath.hpp:27:
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xstrided_view.hpp:26:
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xstrided_view_base.hpp:877:25: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                return{ 0, 0, 0 };
                        ^~~~~~~
                        {      }
In file included from logreg.cpp:1:
In file included from ./logreg.h:3:
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xarray.hpp:19:
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xcontainer.hpp:23:
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xmath.hpp:27:
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xstrided_view.hpp:966:72: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        return squeeze(std::forward<E>(e), std::array<std::size_t, 1>{ axis }, check_policy);
                                                                       ^~~~
                                                                       {   }
In file included from logreg.cpp:1:
In file included from ./logreg.h:3:
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xarray.hpp:19:
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xcontainer.hpp:23:
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xmath.hpp:1875:137: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        return sum(std::forward<E>(e) * reshape_view(std::forward<W>(weights), std::move(broadcast_shape)), std::array<std::size_t, 1>({ax})) / std::move(div);
                                                                                                                                        ^~
                                                                                                                                        { }
In file included from logreg.cpp:1:
In file included from ./logreg.h:9:
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:300:42: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        std::array<std::size_t, 1> vN = {N};
                                         ^
                                         {}
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:303:43: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        std::array<std::size_t, 2> shp = {N, N};
                                          ^~~~
                                          {   }
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:350:42: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        std::array<std::size_t, 1> vN = {N};
                                         ^
                                         {}
  1 CC=g++-8
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:353:41: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        std::array<std::size_t, 2> shp({N, N});
                                        ^~~~
                                        {   }
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:382:42: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        std::array<std::size_t, 1> vN = {N};
                                         ^
                                         {}
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:403:42: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        std::array<std::size_t, 1> vN = {N};
                                         ^
                                         {}
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:429:42: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        std::array<std::size_t, 1> vN = {N};
                                         ^
                                         {}
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:434:41: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        std::array<std::size_t, 2> shp({N, N});
                                        ^~~~
                                        {   }
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:457:42: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        std::array<std::size_t, 1> vN = {N};
                                         ^
                                         {}
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:461:41: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        std::array<std::size_t, 2> shp({N, N});
                                        ^~~~
                                        {   }
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:486:42: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        std::array<std::size_t, 1> vN = {N};
                                         ^
                                         {}
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:507:42: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        std::array<std::size_t, 1> vN = {N};
                                         ^
                                         {}
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:936:13: warning: unused variable 'res' [-Wunused-variable]
        int res = lapack::getrf(LU, piv);
            ^
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:1088:47: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        std::array<std::size_t, 2> tau_shp = {K, 1};
                                              ^~~~
                                              {   }
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:1443:53: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        std::array<std::size_t, 1> residuals_shp = {0};
                                                    ^
                                                    {}
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:1441:13: warning: unused variable 'info' [-Wunused-variable]
        int info = lapack::gelsd(dA, db, s, rank, rcond);
            ^
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:1443:36: warning: unused variable 'residuals_shp' [-Wunused-variable]
        std::array<std::size_t, 1> residuals_shp = {0};
                                   ^
In file included from logreg.cpp:1:
In file included from ./logreg.h:9:
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:29:
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlapack.hpp:482:15: warning: unused type alias 'xtype' [-Wunused-local-typedef]
        using xtype = xtensor<value_type, 2, layout_type::column_major>;
              ^
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlapack.hpp:540:15: warning: unused type alias 'xtype' [-Wunused-local-typedef]
        using xtype = xtensor<value_type, 2, layout_type::column_major>;
              ^
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlapack.hpp:596:15: warning: unused type alias 'xtype' [-Wunused-local-typedef]
        using xtype = xtensor<value_type, 2, layout_type::column_major>;
              ^
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlapack.hpp:652:15: warning: unused type alias 'xtype' [-Wunused-local-typedef]
        using xtype = xtensor<value_type, 2, layout_type::column_major>;
              ^
In file included from logreg.cpp:1:
In file included from ./logreg.h:9:
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:345:15: warning: unused type alias 'underlying_type' [-Wunused-local-typedef]
        using underlying_type = typename value_type::value_type;
              ^
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:1080:15: warning: unused type alias 'result_xtype' [-Wunused-local-typedef]
        using result_xtype = xtensor<value_type, 2>;
              ^
27 warnings generated.

However, running the SAME command with g++-8, with details:

(cling) ❯ g++-8 --version
g++-8 (Homebrew GCC 8.1.0) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
(cling) ❯ make
g++-8 -shared -fPIC -std=c++17 -Wall -I/Users/ray_zhang/anaconda3/envs/cling/include -o libxnor.so logreg.cpp
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:29,
                 from logreg.h:9,
                 from logreg.cpp:1:
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlapack.hpp: In function 'int xt::lapack::geev(E&, char, char, W&, W&, V&, V&)':
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlapack.hpp:482:72: warning: typedef 'using xtype = xt::xtensor<typename E::value_type, 2, (xt::layout_type)2>' locally defined but not used [-Wunused-local-typedefs]
         using xtype = xtensor<value_type, 2, layout_type::column_major>;
                                                                        ^
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlapack.hpp: In function 'int xt::lapack::syevd(E&, char, char, W&)':
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlapack.hpp:540:72: warning: typedef 'using xtype = xt::xtensor<typename E::value_type, 2, (xt::layout_type)2>' locally defined but not used [-Wunused-local-typedefs]
         using xtype = xtensor<value_type, 2, layout_type::column_major>;
                                                                        ^
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlapack.hpp: In function 'int xt::lapack::geev(E&, char, char, W&, V&, V&)':
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlapack.hpp:596:72: warning: typedef 'using xtype = xt::xtensor<typename E::value_type, 2, (xt::layout_type)2>' locally defined but not used [-Wunused-local-typedefs]
         using xtype = xtensor<value_type, 2, layout_type::column_major>;
                                                                        ^
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlapack.hpp: In function 'int xt::lapack::heevd(E&, char, char, W&)':
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlapack.hpp:652:72: warning: typedef 'using xtype = xt::xtensor<typename E::value_type, 2, (xt::layout_type)2>' locally defined but not used [-Wunused-local-typedefs]
         using xtype = xtensor<value_type, 2, layout_type::column_major>;
                                                                        ^
In file included from logreg.h:9,
                 from logreg.cpp:1:
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp: In function 'auto xt::linalg::eig(const xt::xexpression<E>&)':
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:345:64: warning: typedef 'using underlying_type = typename E::value_type::value_type' locally defined but not used [-Wunused-local-typedefs]
         using underlying_type = typename value_type::value_type;
                                                                ^
In file included from logreg.h:9,
                 from logreg.cpp:1:
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp: In function 'auto xt::linalg::qr(const xt::xexpression<E>&, xt::linalg::qrmode)':
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor-blas/xlinalg.hpp:1080:52: warning: typedef 'using result_xtype = xt::xtensor<typename T::value_type, 2>' locally defined but not used [-Wunused-local-typedefs]
         using result_xtype = xtensor<value_type, 2>;
                                                    ^
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xstorage.hpp:22,
                 from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xbuffer_adaptor.hpp:20,
                 from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xarray.hpp:18,
                 from logreg.h:3,
                 from logreg.cpp:1:
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xutils.hpp: In instantiation of 'struct xt::get_strides_type<xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true> >':
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xutils.hpp:1094:61:   required by substitution of 'template<class C> using get_strides_t = typename xt::get_strides_type::type [with C = xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>]'
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xarray.hpp:34:55:   required from 'struct xt::xcontainer_inner_types<xt::xarray_container<xt::uvector<float, std::allocator<float> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag> >'
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xcontainer.hpp:33:86:   required from 'struct xt::xcontainer_iterable_types<xt::xarray_container<xt::uvector<float, std::allocator<float> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag> >'
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xarray.hpp:44:12:   required from 'struct xt::xiterable_inner_types<xt::xarray_container<xt::uvector<float, std::allocator<float> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag> >'
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xiterable.hpp:44:75:   required from 'class xt::xconst_iterable<xt::xarray_container<xt::uvector<float, std::allocator<float> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag> >'
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xiterable.hpp:170:11:   required from 'class xt::xiterable<xt::xarray_container<xt::uvector<float, std::allocator<float> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag> >'
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xcontainer.hpp:72:11:   required from 'class xt::xcontainer<xt::xarray_container<xt::uvector<float, std::allocator<float> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag> >'
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xcontainer.hpp:384:11:   required from 'class xt::xstrided_container<xt::xarray_container<xt::uvector<float, std::allocator<float> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag> >'
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xarray.hpp:63:11:   required from 'class xt::xarray_container<xt::uvector<float, std::allocator<float> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>'
logreg.cpp:3:50:   required from here
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xutils.hpp:1081:72: error: ambiguous template instantiation for 'struct xt::rebind_container<long int, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true> >'
         using type = typename rebind_container<std::ptrdiff_t, S>::type;
                                                                        ^
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xutils.hpp:1073:12: note: candidates are: 'template<class X, template<class, long unsigned int <anonymous> > class C, class T, long unsigned int N> struct xt::rebind_container<X, C<T, N> > [with X = long int; C = xt::svector; T = long unsigned int; long unsigned int N = 4]'
     struct rebind_container<X, C<T, N>>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xbuffer_adaptor.hpp:20,
                 from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xarray.hpp:18,
                 from logreg.h:3,
                 from logreg.cpp:1:
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xstorage.hpp:1231:12: note:                 'template<class X, class T, long unsigned int N, class A> struct xt::rebind_container<X, xt::svector<T, N, A> > [with X = long int; T = long unsigned int; long unsigned int N = 4; A = std::allocator<long unsigned int>]'
     struct rebind_container<X, svector<T, N, A>>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xstorage.hpp:22,
                 from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xbuffer_adaptor.hpp:20,
                 from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xarray.hpp:18,
                 from logreg.h:3,
                 from logreg.cpp:1:
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xutils.hpp:1081:72: error: invalid use of incomplete type 'struct xt::rebind_container<long int, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true> >'
         using type = typename rebind_container<std::ptrdiff_t, S>::type;
                                                                        ^
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xutils.hpp:1063:12: note: declaration of 'struct xt::rebind_container<long int, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true> >'
     struct rebind_container;
            ^~~~~~~~~~~~~~~~
In file included from /Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xarray.hpp:19,
                 from logreg.h:3,
                 from logreg.cpp:1:
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xcontainer.hpp: In instantiation of 'xt::xstrided_container<D>::xstrided_container() [with D = xt::xarray_container<xt::uvector<float, std::allocator<float> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>]':
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xarray.hpp:338:21:   required from 'xt::xarray_container<EC, L, SC, Tag>::xarray_container(xt::nested_initializer_list_t<typename xt::xstrided_container<xt::xarray_container<EC, L, SC, Tag> >::value_type, 2>) [with EC = xt::uvector<float, std::allocator<float> >; xt::layout_type L = (xt::layout_type)1; SC = xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>; Tag = xt::xtensor_expression_tag; xt::nested_initializer_list_t<typename xt::xstrided_container<xt::xarray_container<EC, L, SC, Tag> >::value_type, 2> = std::initializer_list<std::initializer_list<float> >]'
logreg.cpp:4:36:   required from here
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xcontainer.hpp:1252:9: error: using invalid field 'xt::xstrided_container<D>::m_strides'
         m_strides = xtl::make_sequence<inner_strides_type>(base_type::dimension(), 0);
         ^~~~~~~~~
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xcontainer.hpp:1253:9: error: using invalid field 'xt::xstrided_container<D>::m_backstrides'
         m_backstrides = xtl::make_sequence<inner_backstrides_type>(base_type::dimension(), 0);
         ^~~~~~~~~~~~~
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xcontainer.hpp: In instantiation of 'void xt::xstrided_container<D>::resize(S&&, bool) [with S = xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>; D = xt::xarray_container<xt::uvector<float, std::allocator<float> >, (xt::layout_type)1, xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>, xt::xtensor_expression_tag>]':
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xarray.hpp:340:26:   required from 'xt::xarray_container<EC, L, SC, Tag>::xarray_container(xt::nested_initializer_list_t<typename xt::xstrided_container<xt::xarray_container<EC, L, SC, Tag> >::value_type, 2>) [with EC = xt::uvector<float, std::allocator<float> >; xt::layout_type L = (xt::layout_type)1; SC = xt::svector<long unsigned int, 4, std::allocator<long unsigned int>, true>; Tag = xt::xtensor_expression_tag; xt::nested_initializer_list_t<typename xt::xstrided_container<xt::xarray_container<EC, L, SC, Tag> >::value_type, 2> = std::initializer_list<std::initializer_list<float> >]'
logreg.cpp:4:36:   required from here
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xcontainer.hpp:1343:30: error: using invalid field 'xt::xstrided_container<D>::m_strides'
             resize_container(m_strides, m_shape.size());
                              ^~~~~~~~~
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xcontainer.hpp:1344:30: error: using invalid field 'xt::xstrided_container<D>::m_backstrides'
             resize_container(m_backstrides, m_shape.size());
                              ^~~~~~~~~~~~~
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xcontainer.hpp:1345:70: error: using invalid field 'xt::xstrided_container<D>::m_strides'
             size_type data_size = compute_strides(m_shape, m_layout, m_strides, m_backstrides);
                                                                      ^~~~~~~~~
/Users/ray_zhang/anaconda3/envs/cling/include/xtensor/xcontainer.hpp:1345:81: error: using invalid field 'xt::xstrided_container<D>::m_backstrides'
             size_type data_size = compute_strides(m_shape, m_layout, m_strides, m_backstrides);
                                                                                 ^~~~~~~~~~~~~
make: *** [libxnor.so] Error 1

Using the new version of xtensor:

(cling) ❯ conda list | grep xtensor
xtensor                   0.17.0               h2d50403_0    conda-forge
xtensor-blas              0.12.0          blas_openblash2d50403_0  [blas_openblas]  conda-forge
wolfv commented 6 years ago

ok one idea to fix this would be to add the 4th template argument to svector which is a bool Init so that the template specialization would look like:

template <class X, class T, std::size_t N, class A, bool B>
struct rebind_container<X, svector<T, N, A, B>>

Not sure if that would help though. Otherwise we need to disable the overload using enable_if I guess?

JohanMabille commented 6 years ago

@wolfv Your solution should fix the issue, otherwise we can fill a bug report to gcc (although I'm not sure that gcc-8 is right here).

wolfv commented 6 years ago

Homebrew lists 8.2 as stable, let's see if that fixes the issue: https://formulae.brew.sh/formula/gcc

wolfv commented 6 years ago

Homebrew lists GCC 8.2 as stable version:

wolfv commented 6 years ago

The C++ 17 fixes for GCC 8 have been merged into master.