foonathan/memory

Unable to determine node size of C++ container

razr opened this issue · 4 comments

razr commented

While cross-compiling I get this error. It worked in 0.7-1

~/github/foonathan/memory/build$ cmake .. -DCMAKE_TOOLCHAIN_FILE=~Downloads/wrsdk/vxsdk/sysroot/mk/toolchain.cmake
-- The C compiler identification is Clang 15.0.0
-- The CXX compiler identification is Clang 15.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: ~/Downloads/wrsdk/vxsdk/host/x86_64-linux/bin/wr-cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: ~/Downloads/wrsdk/vxsdk/host/x86_64-linux/bin/wr-c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAVE_CXX_ATOMIC_NOFLAG
-- Performing Test HAVE_CXX_ATOMIC_NOFLAG - Success
-- Getting container node sizes
CMake Error at cmake/get_container_node_sizes.cmake:117 (message):
  Unable to determine node size of C++ container
  SHARED_PTR_STATELESS_CONTAINER holding type char - no error text matching
  node_size_of<##, ##, true> in compiler output |Change Dir:
 ~/github/foonathan/memory/build/src/CMakeFiles/CMakeTmp



  Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_63029/fast &&
  /usr/bin/gmake -f CMakeFiles/cmTC_63029.dir/build.make
  CMakeFiles/cmTC_63029.dir/build

  gmake[1]: Entering directory
  '~/github/foonathan/memory/build/src/CMakeFiles/CMakeTmp'

  Building CXX object CMakeFiles/cmTC_63029.dir/get_node_size.cpp.o

  ~/Downloads/wrsdk/vxsdk/host/x86_64-linux/bin/wr-c++
  --sysroot=~/Downloads/wrsdk/vxsdk/host/x86_64-linux/bin/../../../sysroot
  -DSHARED_PTR_STATELESS_CONTAINER=1 -DTEST_TYPE=char -std=gnu++11 -MD -MT
  CMakeFiles/cmTC_63029.dir/get_node_size.cpp.o -MF
  CMakeFiles/cmTC_63029.dir/get_node_size.cpp.o.d -o
  CMakeFiles/cmTC_63029.dir/get_node_size.cpp.o -c
  ~/github/foonathan/memory/cmake/get_node_size.cpp

  In file included from
  ~/github/foonathan/memory/cmake/get_node_size.cpp:2:

  In file included from
  ~/Downloads/wrsdk/vxsdk/host/x86_64-linux/bin/../../../sysroot/usr/h/public/tuple:4:



  ~/Downloads/wrsdk/vxsdk/host/x86_64-linux/bin/../../../sysroot/usr/h/public/type_traits:1089:3:
  error: incomplete type
  'std::_Wrap_alloc<debug_allocator<std::_Ref_count_obj_alloc<char,
  debug_allocator<char, empty_state, false>>, empty_state, false, char>>'
  used in type trait expression

                  _IS_EMPTY(_Ty)
                  ^


  ~/Downloads/wrsdk/vxsdk/host/x86_64-linux/bin/../../../sysroot/usr/h/public/type_traits:119:14:
  note: expanded from macro '_IS_EMPTY'

          : _Cat_base<__is_empty(_Ty)>
                      ^


  ~/Downloads/wrsdk/vxsdk/host/x86_64-linux/bin/../../../sysroot/usr/h/public/xiter:341:9:
  note: in instantiation of template class
  'std::is_empty<std::_Wrap_alloc<debug_allocator<std::_Ref_count_obj_alloc<char,
  debug_allocator<char, empty_state, false>>, empty_state, false, char>>>'
  requested here

          bool = is_empty<_Ty1>::value>
                 ^


  ~/Downloads/wrsdk/vxsdk/host/x86_64-linux/bin/../../../sysroot/usr/h/public/memory:1024:2:
  note: in instantiation of default argument for
  '_Compressed_pair<std::_Wrap_alloc<debug_allocator<std::_Ref_count_obj_alloc<char,
  debug_allocator<char, empty_state, false>>, empty_state, false, char>>,
  std::aligned_storage<1, 1>::type>' required here

          _Compressed_pair<_Myalty, _Mystoragety> _Mypair;
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  ~/github/foonathan/memory/cmake/get_node_size.cpp:55:4: note:
  in instantiation of template class 'std::_Ref_count_obj_alloc<char,
  debug_allocator<char, empty_state, false>>' requested here

                          sizeof(T) - (SubtractTSize ? sizeof(InitialType) : 0),
                          ^


  ~/Downloads/wrsdk/vxsdk/host/x86_64-linux/bin/../../../sysroot/usr/h/public/xmemory0:885:12:
  note: in instantiation of template class
  'debug_allocator<std::_Ref_count_obj_alloc<char, debug_allocator<char,
  empty_state, false>>, empty_state, false, char>' requested here

                  : public _Alloc
                           ^


  ~/Downloads/wrsdk/vxsdk/host/x86_64-linux/bin/../../../sysroot/usr/h/public/memory:1049:51:
  note: in instantiation of template class
  'std::_Wrap_alloc<debug_allocator<std::_Ref_count_obj_alloc<char,
  debug_allocator<char, empty_state, false>>, empty_state, false, char>>'
  requested here

          typename _Alref0::template rebind<_Refoa>::other _Alref(_Al_arg);
                                                           ^

  ~/github/foonathan/memory/cmake/get_node_size.cpp:185:21:
  note: in instantiation of function template specialization
  'std::allocate_shared<char, debug_allocator<char, empty_state, false>>'
  requested here

      auto ptr = std::allocate_shared<T>(debug_allocator<T, empty_state, false>());
                      ^

  ~/github/foonathan/memory/cmake/get_node_size.cpp:220:11:
  note: in instantiation of function template specialization
  'test_container<char>' requested here

  int foo = test_container<TEST_TYPE>();

            ^


  ~/Downloads/wrsdk/vxsdk/host/x86_64-linux/bin/../../../sysroot/usr/h/public/xmemory0:884:9:
  note: definition of
  'std::_Wrap_alloc<debug_allocator<std::_Ref_count_obj_alloc<char,
  debug_allocator<char, empty_state, false>>, empty_state, false, char>>' is
  not complete until the closing '}'

          struct _Wrap_alloc
                 ^

  1 error generated.

  gmake[1]: *** [CMakeFiles/cmTC_63029.dir/build.make:79:
  CMakeFiles/cmTC_63029.dir/get_node_size.cpp.o] Error 1

  gmake[1]: Leaving directory
  '~/github/foonathan/memory/build/src/CMakeFiles/CMakeTmp'

  gmake: *** [Makefile:127: cmTC_63029/fast] Error 2



  |
Call Stack (most recent call first):
  cmake/get_container_node_sizes.cmake:149 (get_node_sizes_of)
  src/CMakeLists.txt:80 (get_container_node_sizes)


-- Configuring incomplete, errors occurred!
See also "~/github/foonathan/memory/build/CMakeFiles/CMakeOutput.log".

We switched to a new method of node size detection since then, and apparently your SDK cannot compile cmake/get_node_size.cpp. I don't have access to it, so I can't help you with that.

razr commented

It looks to me that you have broken the cross-compilation for your project which I fixed a while back, see #78

We're no longer running anything, we're just compiling and inspecting the error message, so the emulator shouldn't be necessary, right?

razr commented

maybe it is a VxWorks-specific error, I don't know. I'm good for now with 0.7-1 :) Will try to fix it later.