Opened 20 months ago

Last modified 20 months ago

#180 new defect

Compilation fails : gcc12 on Mac OS X

Reported by: omamce Owned by: ymipsl
Priority: minor Component: XIOS
Version: 2.5 Keywords:
Cc:

Description

Revision: 2397

Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp: In function 'double sphereRemap::computePolygoneArea(Elt&, const Coord&)':
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:41:45: error: invalid use of incomplete type 'struct std::array<double, 2>'
   41 |     vect_points.push_back( array<double, 2>() );
      |                                             ^
In file included from /opt/local/include/gcc12/c++/bits/unique_ptr.h:36,
                 from /opt/local/include/gcc12/c++/memory:76,
                 from /Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:6,
                 from /Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:5:
/opt/local/include/gcc12/c++/tuple:1595:45: note: declaration of 'struct std::array<double, 2>'
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:42:19: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::array<double, 2> >, std::array<double, 2> >::value_type' {aka 'std::array<double, 2>'} and 'int')
   42 |     vect_points[n][0] = a_gno[n].x;
      |                   ^
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:43:19: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::array<double, 2> >, std::array<double, 2> >::value_type' {aka 'std::array<double, 2>'} and 'int')
   43 |     vect_points[n][1] = a_gno[n].y;
      |                   ^
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:53:54: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::array<double, 2> >, std::array<double, 2> >::value_type' {aka 'std::array<double, 2>'} and 'int')
   53 |       Coord x0 = Ox * polyline[0][indices_a_gno[3*i]][0] + Oy* polyline[0][indices_a_gno[3*i]][1] + Oz ;
      |                                                      ^
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:53:95: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::array<double, 2> >, std::array<double, 2> >::value_type' {aka 'std::array<double, 2>'} and 'int')
   53 |       Coord x0 = Ox * polyline[0][indices_a_gno[3*i]][0] + Oy* polyline[0][indices_a_gno[3*i]][1] + Oz ;
      |                                                                                               ^
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:54:56: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::array<double, 2> >, std::array<double, 2> >::value_type' {aka 'std::array<double, 2>'} and 'int')
   54 |       Coord x1 = Ox * polyline[0][indices_a_gno[3*i+1]][0] + Oy* polyline[0][indices_a_gno[3*i+1]][1] + Oz ;
      |                                                        ^
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:54:99: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::array<double, 2> >, std::array<double, 2> >::value_type' {aka 'std::array<double, 2>'} and 'int')
   54 |       Coord x1 = Ox * polyline[0][indices_a_gno[3*i+1]][0] + Oy* polyline[0][indices_a_gno[3*i+1]][1] + Oz ;
      |                                                                                                   ^
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:55:56: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::array<double, 2> >, std::array<double, 2> >::value_type' {aka 'std::array<double, 2>'} and 'int')
   55 |       Coord x2 = Ox * polyline[0][indices_a_gno[3*i+2]][0] + Oy* polyline[0][indices_a_gno[3*i+2]][1] + Oz ;
      |                                                        ^
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:55:99: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::array<double, 2> >, std::array<double, 2> >::value_type' {aka 'std::array<double, 2>'} and 'int')
   55 |       Coord x2 = Ox * polyline[0][indices_a_gno[3*i+2]][0] + Oy* polyline[0][indices_a_gno[3*i+2]][1] + Oz ;
      |                                                                                                   ^
In file included from /opt/local/include/gcc12/c++/vector:64,
                 from /Users/marti/Unix/TOOLS/XIOS/extern/remap/src/intersection_ym.hpp:4,
                 from /Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:4:
/opt/local/include/gcc12/c++/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = std::array<double, 2>; _Alloc = std::allocator<std::array<double, 2> >]':
/opt/local/include/gcc12/c++/bits/stl_vector.h:526:7:   required from here
/opt/local/include/gcc12/c++/bits/stl_vector.h:367:49: error: invalid use of incomplete type 'struct std::array<double, 2>'
  367 |                       _M_impl._M_end_of_storage - _M_impl._M_start);
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/opt/local/include/gcc12/c++/tuple:1595:45: note: declaration of 'struct std::array<double, 2>'
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
/opt/local/include/gcc12/c++/bits/stl_vector.h: In instantiation of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::array<double, 2>; _Alloc = std::allocator<std::array<double, 2> >; reference = std::array<double, 2>&; size_type = long unsigned int]':
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:42:18:   required from here
/opt/local/include/gcc12/c++/bits/stl_vector.h:1124:41: error: invalid use of incomplete type 'struct std::array<double, 2>'
 1124 |         return *(this->_M_impl._M_start + __n);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/opt/local/include/gcc12/c++/tuple:1595:45: note: declaration of 'struct std::array<double, 2>'
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
/opt/local/include/gcc12/c++/bits/stl_vector.h: In instantiation of 'void std::vector<_Tp, _Alloc>::_M_erase_at_end(pointer) [with _Tp = std::array<double, 2>; _Alloc = std::allocator<std::array<double, 2> >; pointer = std::array<double, 2>*]':
/opt/local/include/gcc12/c++/bits/stl_vector.h:1601:9:   required from 'void std::vector<_Tp, _Alloc>::clear() [with _Tp = std::array<double, 2>; _Alloc = std::allocator<std::array<double, 2> >]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:59:20:   required from here
/opt/local/include/gcc12/c++/bits/stl_vector.h:1930:53: error: invalid use of incomplete type 'struct std::array<double, 2>'
 1930 |         if (size_type __n = this->_M_impl._M_finish - __pos)
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/opt/local/include/gcc12/c++/tuple:1595:45: note: declaration of 'struct std::array<double, 2>'
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
In file included from /opt/local/include/gcc12/c++/bits/stl_pair.h:60,
                 from /opt/local/include/gcc12/c++/bits/stl_algobase.h:64,
                 from /opt/local/include/gcc12/c++/list:60,
                 from /Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:1:
/opt/local/include/gcc12/c++/type_traits: In instantiation of 'struct std::is_destructible<std::array<double, 2> >':
/opt/local/include/gcc12/c++/bits/stl_construct.h:188:51:   required from 'void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = array<double, 2>*]'
/opt/local/include/gcc12/c++/bits/alloc_traits.h:850:15:   required from 'void std::_Destroy(_ForwardIterator, _ForwardIterator, allocator<_T2>&) [with _ForwardIterator = array<double, 2>*; _Tp = array<double, 2>]'
/opt/local/include/gcc12/c++/bits/stl_vector.h:730:15:   required from 'std::vector<_Tp, _Alloc>::~vector() [with _Tp = std::array<double, 2>; _Alloc = std::allocator<std::array<double, 2> >]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:16:17:   required from here
/opt/local/include/gcc12/c++/type_traits:910:52: error: static assertion failed: template argument must be a complete class or an unbounded array
  910 |       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/gcc12/c++/type_traits:910:52: note: 'std::__is_complete_or_unbounded<__type_identity<array<double, 2> > >((std::__type_identity<std::array<double, 2> >(), std::__type_identity<std::array<double, 2> >()))' evaluates to false
In file included from /opt/local/include/gcc12/c++/bits/alloc_traits.h:33,
                 from /opt/local/include/gcc12/c++/ext/alloc_traits.h:34,
                 from /opt/local/include/gcc12/c++/bits/stl_list.h:61,
                 from /opt/local/include/gcc12/c++/list:63:
/opt/local/include/gcc12/c++/bits/stl_construct.h: In instantiation of 'void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = array<double, 2>*]':
/opt/local/include/gcc12/c++/bits/alloc_traits.h:850:15:   required from 'void std::_Destroy(_ForwardIterator, _ForwardIterator, allocator<_T2>&) [with _ForwardIterator = array<double, 2>*; _Tp = array<double, 2>]'
/opt/local/include/gcc12/c++/bits/stl_vector.h:730:15:   required from 'std::vector<_Tp, _Alloc>::~vector() [with _Tp = std::array<double, 2>; _Alloc = std::allocator<std::array<double, 2> >]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:16:17:   required from here
/opt/local/include/gcc12/c++/bits/stl_construct.h:188:51: error: static assertion failed: value type is destructible
  188 |       static_assert(is_destructible<_Value_type>::value,
      |                                                   ^~~~~
/opt/local/include/gcc12/c++/bits/stl_construct.h:188:51: note: 'std::integral_constant<bool, false>::value' evaluates to false
/opt/local/include/gcc12/c++/bits/stl_construct.h:195:25: error: invalid use of incomplete type 'std::iterator_traits<std::array<double, 2>*>::value_type' {aka 'struct std::array<double, 2>'}
  195 |       std::_Destroy_aux<__has_trivial_destructor(_Value_type)>::
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/gcc12/c++/tuple:1595:45: note: declaration of 'std::iterator_traits<std::array<double, 2>*>::value_type' {aka 'struct std::array<double, 2>'}
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
/opt/local/include/gcc12/c++/bits/stl_vector.h: In instantiation of 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = std::array<double, 2>; _Alloc = std::allocator<std::array<double, 2> >; size_type = long unsigned int]':
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:146:53:   required from 'void mapbox::detail::Earcut<N>::operator()(const Polygon&) [with Polygon = std::vector<std::vector<std::array<double, 2> > >; N = unsigned int]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:773:11:   required from 'std::vector<N> mapbox::earcut(const Polygon&) [with N = unsigned int; Polygon = std::vector<std::vector<std::array<double, 2> > >]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:48:46:   required from here
/opt/local/include/gcc12/c++/bits/stl_vector.h:988:50: error: invalid use of incomplete type 'struct std::array<double, 2>'
  988 |       { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/gcc12/c++/tuple:1595:45: note: declaration of 'struct std::array<double, 2>'
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp: In instantiation of 'struct mapbox::util::nth<0, std::array<double, 2> >':
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:199:52:   required from 'mapbox::detail::Earcut<N>::Node* mapbox::detail::Earcut<N>::linkedList(const Ring&, bool) [with Ring = std::vector<std::array<double, 2> >; N = unsigned int]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:154:33:   required from 'void mapbox::detail::Earcut<N>::operator()(const Polygon&) [with Polygon = std::vector<std::vector<std::array<double, 2> > >; N = unsigned int]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:773:11:   required from 'std::vector<N> mapbox::earcut(const Polygon&) [with N = unsigned int; Polygon = std::vector<std::vector<std::array<double, 2> > >]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:48:46:   required from here
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:19:3: error: invalid use of incomplete type 'struct std::tuple_element<0, std::array<double, 2> >'
   19 |   get(const T& t) { return std::get<I>(t); };
      |   ^~~
In file included from /opt/local/include/gcc12/c++/bits/stl_pair.h:62:
/opt/local/include/gcc12/c++/bits/utility.h:80:12: note: declaration of 'struct std::tuple_element<0, std::array<double, 2> >'
   80 |     struct tuple_element;
      |            ^~~~~~~~~~~~~
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp: In instantiation of 'mapbox::detail::Earcut<N>::Node* mapbox::detail::Earcut<N>::linkedList(const Ring&, bool) [with Ring = std::vector<std::array<double, 2> >; N = unsigned int]':
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:154:33:   required from 'void mapbox::detail::Earcut<N>::operator()(const Polygon&) [with Polygon = std::vector<std::vector<std::array<double, 2> > >; N = unsigned int]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:773:11:   required from 'std::vector<N> mapbox::earcut(const Polygon&) [with N = unsigned int; Polygon = std::vector<std::vector<std::array<double, 2> > >]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:48:46:   required from here
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:199:52: error: 'get' is not a member of 'mapbox::util::nth<0, std::array<double, 2> >'
  199 |         const double p20 = util::nth<0, Point>::get(p2);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:200:52: error: 'get' is not a member of 'mapbox::util::nth<0, std::array<double, 2> >'
  200 |         const double p10 = util::nth<0, Point>::get(p1);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp: In instantiation of 'struct mapbox::util::nth<1, std::array<double, 2> >':
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:201:52:   required from 'mapbox::detail::Earcut<N>::Node* mapbox::detail::Earcut<N>::linkedList(const Ring&, bool) [with Ring = std::vector<std::array<double, 2> >; N = unsigned int]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:154:33:   required from 'void mapbox::detail::Earcut<N>::operator()(const Polygon&) [with Polygon = std::vector<std::vector<std::array<double, 2> > >; N = unsigned int]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:773:11:   required from 'std::vector<N> mapbox::earcut(const Polygon&) [with N = unsigned int; Polygon = std::vector<std::vector<std::array<double, 2> > >]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:48:46:   required from here
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:19:3: error: invalid use of incomplete type 'struct std::tuple_element<1, std::array<double, 2> >'
   19 |   get(const T& t) { return std::get<I>(t); };
      |   ^~~
/opt/local/include/gcc12/c++/bits/utility.h:80:12: note: declaration of 'struct std::tuple_element<1, std::array<double, 2> >'
   80 |     struct tuple_element;
      |            ^~~~~~~~~~~~~
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp: In instantiation of 'mapbox::detail::Earcut<N>::Node* mapbox::detail::Earcut<N>::linkedList(const Ring&, bool) [with Ring = std::vector<std::array<double, 2> >; N = unsigned int]':
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:154:33:   required from 'void mapbox::detail::Earcut<N>::operator()(const Polygon&) [with Polygon = std::vector<std::vector<std::array<double, 2> > >; N = unsigned int]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:773:11:   required from 'std::vector<N> mapbox::earcut(const Polygon&) [with N = unsigned int; Polygon = std::vector<std::vector<std::array<double, 2> > >]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:48:46:   required from here
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:201:52: error: 'get' is not a member of 'mapbox::util::nth<1, std::array<double, 2> >'
  201 |         const double p11 = util::nth<1, Point>::get(p1);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:202:52: error: 'get' is not a member of 'mapbox::util::nth<1, std::array<double, 2> >'
  202 |         const double p21 = util::nth<1, Point>::get(p2);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/opt/local/include/gcc12/c++/bits/stl_vector.h: In instantiation of 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = std::array<double, 2>; _Alloc = std::allocator<std::array<double, 2> >; const_reference = const std::array<double, 2>&; size_type = long unsigned int]':
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:197:32:   required from 'mapbox::detail::Earcut<N>::Node* mapbox::detail::Earcut<N>::linkedList(const Ring&, bool) [with Ring = std::vector<std::array<double, 2> >; N = unsigned int]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:154:33:   required from 'void mapbox::detail::Earcut<N>::operator()(const Polygon&) [with Polygon = std::vector<std::vector<std::array<double, 2> > >; N = unsigned int]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/earcut.hpp:773:11:   required from 'std::vector<N> mapbox::earcut(const Polygon&) [with N = unsigned int; Polygon = std::vector<std::vector<std::array<double, 2> > >]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:48:46:   required from here
/opt/local/include/gcc12/c++/bits/stl_vector.h:1143:41: error: invalid use of incomplete type 'struct std::array<double, 2>'
 1143 |         return *(this->_M_impl._M_start + __n);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/opt/local/include/gcc12/c++/tuple:1595:45: note: declaration of 'struct std::array<double, 2>'
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
/opt/local/include/gcc12/c++/bits/stl_vector.h: In instantiation of 'void std::_Vector_base<_Tp, _Alloc>::_M_create_storage(std::size_t) [with _Tp = std::array<double, 2>; _Alloc = std::allocator<std::array<double, 2> >; std::size_t = long unsigned int]':
/opt/local/include/gcc12/c++/bits/stl_vector.h:332:9:   required from 'std::_Vector_base<_Tp, _Alloc>::_Vector_base(std::size_t, const allocator_type&) [with _Tp = std::array<double, 2>; _Alloc = std::allocator<std::array<double, 2> >; std::size_t = long unsigned int; allocator_type = std::allocator<std::array<double, 2> >]'
/opt/local/include/gcc12/c++/bits/stl_vector.h:598:61:   required from 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::array<double, 2>; _Alloc = std::allocator<std::array<double, 2> >]'
/opt/local/include/gcc12/c++/bits/new_allocator.h:175:4:   required from 'void std::__new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::vector<std::array<double, 2> >; _Args = {const std::vector<std::array<double, 2>, std::allocator<std::array<double, 2> > >&}; _Tp = std::vector<std::array<double, 2> >]'
/opt/local/include/gcc12/c++/bits/alloc_traits.h:516:17:   required from 'static void std::allocator_traits<std::allocator<_Tp1> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = std::vector<std::array<double, 2> >; _Args = {const std::vector<std::array<double, 2>, std::allocator<std::array<double, 2> > >&}; _Tp = std::vector<std::array<double, 2> >; allocator_type = std::allocator<std::vector<std::array<double, 2> > >]'
/opt/local/include/gcc12/c++/bits/stl_vector.h:1281:30:   required from 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::vector<std::array<double, 2> >; _Alloc = std::allocator<std::vector<std::array<double, 2> > >; value_type = std::vector<std::array<double, 2> >]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:47:21:   required from here
/opt/local/include/gcc12/c++/bits/stl_vector.h:397:66: error: invalid use of incomplete type 'struct std::array<double, 2>'
  397 |         this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
      |                                           ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/opt/local/include/gcc12/c++/tuple:1595:45: note: declaration of 'struct std::array<double, 2>'
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
In file included from /opt/local/include/gcc12/c++/vector:63:
/opt/local/include/gcc12/c++/bits/stl_uninitialized.h: In instantiation of '_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const array<double, 2>*, vector<array<double, 2> > >; _ForwardIterator = array<double, 2>*]':
/opt/local/include/gcc12/c++/bits/stl_uninitialized.h:372:37:   required from '_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, allocator<_Tp>&) [with _InputIterator = __gnu_cxx::__normal_iterator<const array<double, 2>*, vector<array<double, 2> > >; _ForwardIterator = array<double, 2>*; _Tp = array<double, 2>]'
/opt/local/include/gcc12/c++/bits/stl_vector.h:601:31:   required from 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::array<double, 2>; _Alloc = std::allocator<std::array<double, 2> >]'
/opt/local/include/gcc12/c++/bits/new_allocator.h:175:4:   required from 'void std::__new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::vector<std::array<double, 2> >; _Args = {const std::vector<std::array<double, 2>, std::allocator<std::array<double, 2> > >&}; _Tp = std::vector<std::array<double, 2> >]'
/opt/local/include/gcc12/c++/bits/alloc_traits.h:516:17:   required from 'static void std::allocator_traits<std::allocator<_Tp1> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = std::vector<std::array<double, 2> >; _Args = {const std::vector<std::array<double, 2>, std::allocator<std::array<double, 2> > >&}; _Tp = std::vector<std::array<double, 2> >; allocator_type = std::allocator<std::vector<std::array<double, 2> > >]'
/opt/local/include/gcc12/c++/bits/stl_vector.h:1281:30:   required from 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::vector<std::array<double, 2> >; _Alloc = std::allocator<std::vector<std::array<double, 2> > >; value_type = std::vector<std::array<double, 2> >]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:47:21:   required from here
/opt/local/include/gcc12/c++/bits/stl_uninitialized.h:174:34: error: invalid use of incomplete type '_ValueType1' {aka 'struct std::array<double, 2>'}
  174 |       const bool __can_memmove = __is_trivial(_ValueType1);
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/gcc12/c++/tuple:1595:45: note: declaration of '_ValueType1' {aka 'struct std::array<double, 2>'}
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
/opt/local/include/gcc12/c++/bits/stl_uninitialized.h:182:11: error: invalid use of incomplete type '_ValueType2' {aka 'struct std::array<double, 2>'}
  182 |         = _GLIBCXX_USE_ASSIGN_FOR_INIT(_ValueType2, _From);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/gcc12/c++/tuple:1595:45: note: declaration of '_ValueType2' {aka 'struct std::array<double, 2>'}
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
mpicc -o mpi_routing.o -DUSING_NETCDF_PAR -I/Users/marti/Unix/TOOLS/XIOS/inc -w -D__XIOS_EXCEPTION -std=c++11 -g -O2 -ggdb -I/opt/local/include   -I/Users/marti/Unix/TOOLS/XIOS/extern/boost -I/Users/marti/Unix/TOOLS/XIOS/extern/blitz -I/Users/marti/Unix/TOOLS/XIOS/extern/src_netcdf -I/Users/marti/Unix/TOOLS/XIOS/extern/boost/include -I/Users/marti/Unix/TOOLS/XIOS/extern/rapidxml/include -I/Users/marti/Unix/TOOLS/XIOS/extern/blitz/include -c /Users/marti/Unix/TOOLS/XIOS/extern/remap/src/mpi_routing.cpp
In file included from /opt/local/include/gcc12/c++/x86_64-apple-darwin21/bits/c++allocator.h:33,
                 from /opt/local/include/gcc12/c++/bits/allocator.h:46,
                 from /opt/local/include/gcc12/c++/list:61:
/opt/local/include/gcc12/c++/bits/new_allocator.h: In instantiation of '_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = std::array<double, 2>; size_type = long unsigned int]':
/opt/local/include/gcc12/c++/bits/alloc_traits.h:464:28:   required from 'static _Tp* std::allocator_traits<std::allocator<_Tp1> >::allocate(allocator_type&, size_type) [with _Tp = std::array<double, 2>; pointer = std::array<double, 2>*; allocator_type = std::allocator<std::array<double, 2> >; size_type = long unsigned int]'
/opt/local/include/gcc12/c++/bits/stl_vector.h:378:33:   required from 'std::_Vector_base<_Tp, _Alloc>::pointer std::_Vector_base<_Tp, _Alloc>::_M_allocate(std::size_t) [with _Tp = std::array<double, 2>; _Alloc = std::allocator<std::array<double, 2> >; pointer = std::array<double, 2>*; std::size_t = long unsigned int]'
/opt/local/include/gcc12/c++/bits/stl_vector.h:395:33:   required from 'void std::_Vector_base<_Tp, _Alloc>::_M_create_storage(std::size_t) [with _Tp = std::array<double, 2>; _Alloc = std::allocator<std::array<double, 2> >; std::size_t = long unsigned int]'
/opt/local/include/gcc12/c++/bits/stl_vector.h:332:9:   required from 'std::_Vector_base<_Tp, _Alloc>::_Vector_base(std::size_t, const allocator_type&) [with _Tp = std::array<double, 2>; _Alloc = std::allocator<std::array<double, 2> >; std::size_t = long unsigned int; allocator_type = std::allocator<std::array<double, 2> >]'
/opt/local/include/gcc12/c++/bits/stl_vector.h:598:61:   required from 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::array<double, 2>; _Alloc = std::allocator<std::array<double, 2> >]'
/opt/local/include/gcc12/c++/bits/new_allocator.h:175:4:   required from 'void std::__new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::vector<std::array<double, 2> >; _Args = {const std::vector<std::array<double, 2>, std::allocator<std::array<double, 2> > >&}; _Tp = std::vector<std::array<double, 2> >]'
/opt/local/include/gcc12/c++/bits/alloc_traits.h:516:17:   required from 'static void std::allocator_traits<std::allocator<_Tp1> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = std::vector<std::array<double, 2> >; _Args = {const std::vector<std::array<double, 2>, std::allocator<std::array<double, 2> > >&}; _Tp = std::vector<std::array<double, 2> >; allocator_type = std::allocator<std::vector<std::array<double, 2> > >]'
/opt/local/include/gcc12/c++/bits/stl_vector.h:1281:30:   required from 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::vector<std::array<double, 2> >; _Alloc = std::allocator<std::vector<std::array<double, 2> > >; value_type = std::vector<std::array<double, 2> >]'
/Users/marti/Unix/TOOLS/XIOS/extern/remap/src/meshutil.cpp:47:21:   required from here
/opt/local/include/gcc12/c++/bits/new_allocator.h:117:23: error: invalid application of 'sizeof' to incomplete type 'std::array<double, 2>'
  117 |         static_assert(sizeof(_Tp) != 0, "cannot allocate incomplete types");
      |                       ^~~~~~~~~~~
/opt/local/include/gcc12/c++/bits/new_allocator.h:124:42: error: invalid application of 'sizeof' to incomplete type 'std::array<double, 2>'
  124 |             if (__n > (std::size_t(-1) / sizeof(_Tp)))
      |                                          ^~~~~~~~~~~
/opt/local/include/gcc12/c++/bits/new_allocator.h:137:62: error: invalid application of 'sizeof' to incomplete type 'std::array<double, 2>'
  137 |         return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
      |                                         

Change History (2)

comment:1 Changed 20 months ago by jderouillat

XIOS 2.5 compiles correctly without specific option with gcc 12 (12.2.0 @ TGCC).
But it seems that you are not using the 2.5 version where meshutil.cpp does not contain vect_points and where earcut.hpp does not exist.

I reproduced your error on the trunk of XIOS 2. Going to C++ 11 using -std=gnu++11 fixed the compilation.

comment:2 Changed 20 months ago by jderouillat

For XIOS 2, need to add #include <array> in extern/remap/src/meshutil.cpp.
Commited in 2398.

Note: See TracTickets for help on using tickets.