'is_trivially_copyable' is not a member of 'std'

Issue #19 resolved
Dan Bonachea created an issue

Building on several systems, including pcp-d-*, with g++ 4.8.5 or clang 3.4.2 results in what appears to be a similar class of error message about a missing std::is_trivially_copyable.

Are these compilers just too old to support?

If so, that's rather unfortunate as several modern Linux distros (notably openSUSE and SLES) are still shipping 4.8.5 as /usr/bin/g++.

We should at least investigate what's going on here, and impose a minimum g++ version if that's warranted.

dirac g++ 4.8.5:

g++ -std=c++11 -D_GNU_SOURCE=1 -I/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85 -DUPCXX_BACKEND=gasnet1_seq -D_GNU_SOURCE=1 -DGASNET_SEQ -I/home/pcp1/bonachea/UPC/upcxx/.nobs/art/5b92fe9cd838b8d74bcb748feaaedeb30a9ca850/GASNet-2017.6.0 -I/home/pcp1/bonachea/UPC/upcxx/.nobs/art/5b92fe9cd838b8d74bcb748feaaedeb30a9ca850/GASNet-2017.6.0/smp-conduit -I/home/pcp1/bonachea/UPC/upcxx/.nobs/art/5b92fe9cd838b8d74bcb748feaaedeb30a9ca850/GASNet-2017.6.0/other -I/home/pcp1/bonachea/UPC/upcxx/.nobs/art/5b92fe9cd838b8d74bcb748feaaedeb30a9ca850/GASNet-2017.6.0/extended-ref -I/home/pcp1/bonachea/UPC/upcxx/.nobs/art/a836ae935e3e1f73f18d97aa3d2ab7000bd978a6 -O2 -Wall -O2 -Wno-unused -Wno-unused-parameter -Wno-address -c /home/pcp1/bonachea/UPC/upcxx/src/backend/gasnet1_seq/backend.cpp -o /home/pcp1/bonachea/UPC/upcxx/.nobs/art/8329665b4a5a93112c59dc5ec0b06ce5c812ffd9.backend.cpp.o

*** Something FAILED! ***
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
g++ -std=c++11 -D_GNU_SOURCE=1 -I/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85 -O2 -Wall -c /home/pcp1/bonachea/UPC/upcxx/src/packing.cpp -o /home/pcp1/bonachea/UPC/upcxx/.nobs/art/f88bf54ab3eabb3e3e57a5b956b2f121a5b5cd26.packing.cpp.o

In file included from /home/pcp1/bonachea/UPC/upcxx/src/packing.cpp:1:0:
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:352:41: error: 'is_trivially_copyable' is not a member of 'std'
            bool is_trivially_copyable = std::is_trivially_copyable<T>::value>
                                         ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:352:69: error: expected primary-expression before '>' token
            bool is_trivially_copyable = std::is_trivially_copyable<T>::value>
                                                                     ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:352:70: error: 'value' in namespace '::' does not name a type
            bool is_trivially_copyable = std::is_trivially_copyable<T>::value>
                                                                      ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:356:10: error: 'packing_opaque' is not a class template
   struct packing_opaque<T, /*is_empty=*/true, is_trivially_copyable>:
          ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:360:78: error: wrong number of template arguments (3, should be 2)
   struct packing_opaque<T, /*is_empty=*/false, /*is_trivially_copyable=*/true>:
                                                                              ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:356:68: error: provided for 'template<class T, bool is_trivially_copyable> struct upcxx::packing_opaque'
   struct packing_opaque<T, /*is_empty=*/true, is_trivially_copyable>:
                                                                    ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:365:79: error: wrong number of template arguments (3, should be 2)
   struct packing_opaque<T, /*is_empty=*/false, /*is_trivially_copyable=*/false>:
                                                                               ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:356:68: error: provided for 'template<class T, bool is_trivially_copyable> struct upcxx::packing_opaque'
   struct packing_opaque<T, /*is_empty=*/true, is_trivially_copyable>:
                                                                    ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp: In member function 'void upcxx::packing_ubound_reflector::opaque(const T&)':
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:389:23: error: wrong number of template arguments (1, should be 2)
       packing_opaque<T>::size_ubound(ub, mbr);
                       ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:356:68: error: provided for 'template<class T, bool is_trivially_copyable> struct upcxx::packing_opaque'
   struct packing_opaque<T, /*is_empty=*/true, is_trivially_copyable>:
                                                                    ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:389:37: error: invalid type in declaration before '(' token
       packing_opaque<T>::size_ubound(ub, mbr);
                                     ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:389:45: error: expression list treated as compound expression in initializer [-fpermissive]
       packing_opaque<T>::size_ubound(ub, mbr);
                                             ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp: In member function 'void upcxx::packing_pack_reflector::opaque(const T&)':
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:403:23: error: wrong number of template arguments (1, should be 2)
       packing_opaque<T>::pack(w, mbr);
                       ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:356:68: error: provided for 'template<class T, bool is_trivially_copyable> struct upcxx::packing_opaque'
   struct packing_opaque<T, /*is_empty=*/true, is_trivially_copyable>:
                                                                    ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:403:30: error: invalid type in declaration before '(' token
       packing_opaque<T>::pack(w, mbr);
                              ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:403:37: error: expression list treated as compound expression in initializer [-fpermissive]
       packing_opaque<T>::pack(w, mbr);
                                     ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp: In member function 'void upcxx::packing_unpack_reflector<true>::opaque(T&)':
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:421:29: error: wrong number of template arguments (1, should be 2)
       mbr = packing_opaque<T>::unpack(r);
                             ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:356:68: error: provided for 'template<class T, bool is_trivially_copyable> struct upcxx::packing_opaque'
   struct packing_opaque<T, /*is_empty=*/true, is_trivially_copyable>:
                                                                    ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp: In member function 'void upcxx::packing_unpack_reflector<false>::opaque(T&)':
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:434:37: error: wrong number of template arguments (1, should be 2)
       ::new(&mbr) T(packing_opaque<T>::unpack(r));
                                     ^
/home/pcp1/bonachea/UPC/upcxx/.nobs/art/2bb43ea65c73ec769207c6c4c924a8c8a9898a85/upcxx/packing.hpp:356:68: error: provided for 'template<class T, bool is_trivially_copyable> struct upcxx::packing_opaque'
   struct packing_opaque<T, /*is_empty=*/true, is_trivially_copyable>:
                                                                    ^

dirac clang 3.4.2:

/usr/local/pkg/openmpi-2.0.0/clang-3.4.2/bin/mpicxx -std=c++11 -D_GNU_SOURCE=1 -I/home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/.nobs/art/d6fdf541e82fcd8e261cd97cc72f6dea414512e2 -DUPCXX_BACKEND=gasnet1_seq -D_GNU_SOURCE=1 -DGASNET_SEQ -I/home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/gasnet/include -I/home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/gasnet/include/ibv-conduit -O0 -g -Wall -g -Wall -Wpointer-arith -Wnested-externs -Wwrite-strings -Wmissing-format-attribute -Wno-unused -Wno-unused-parameter -Wno-address -c /home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/test/hello_upcxx.cpp -o /home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/.nobs/art/48f2eb2442a019af41406f8f9d062c9f0039b925.hello_upcxx.cpp.o?[0m

In file included from /home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/test/hello_upcxx.cpp:1:
In file included from /home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/.nobs/art/d6fdf541e82fcd8e261cd97cc72f6dea414512e2/upcxx/backend.hpp:8:
In file included from /home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/.nobs/art/d6fdf541e82fcd8e261cd97cc72f6dea414512e2/upcxx/future.hpp:7:
In file included from /home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/.nobs/art/d6fdf541e82fcd8e261cd97cc72f6dea414512e2/upcxx/future/apply.hpp:5:
/home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/.nobs/art/d6fdf541e82fcd8e261cd97cc72f6dea414512e2/upcxx/future/make_future.hpp:37:34: error: no member named 'is_trivially_copyable' in namespace 'std'
        upcxx::trait_forall::value,
                            ~~~~~^
/home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/.nobs/art/d6fdf541e82fcd8e261cd97cc72f6dea414512e2/upcxx/future/make_future.hpp:37:64: error: no type named 'value' in the global namespace
        upcxx::trait_forall::value,
                                                             ~~^
/home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/.nobs/art/d6fdf541e82fcd8e261cd97cc72f6dea414512e2/upcxx/future/make_future.hpp:39:9: error: expected class name
      > {
        ^
In file included from /home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/test/hello_upcxx.cpp:1:
In file included from /home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/.nobs/art/d6fdf541e82fcd8e261cd97cc72f6dea414512e2/upcxx/backend.hpp:8:
In file included from /home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/.nobs/art/d6fdf541e82fcd8e261cd97cc72f6dea414512e2/upcxx/future.hpp:7:
/home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/.nobs/art/d6fdf541e82fcd8e261cd97cc72f6dea414512e2/upcxx/future/apply.hpp:18:22: error: no matching function for call to 'make_future'
    typedef decltype(upcxx::make_future<>()) return_type;
                     ^~~~~~~~~~~~~~~~~~~~
/home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/.nobs/art/d6fdf541e82fcd8e261cd97cc72f6dea414512e2/upcxx/future/make_future.hpp:44:8: note: candidate template ignored: substitution failure [with T = <>]: type 'detail::make_future<>' does not provide a call operator
  auto make_future(T ...values)
       ^
In file included from /home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/test/hello_upcxx.cpp:1:
In file included from /home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/.nobs/art/d6fdf541e82fcd8e261cd97cc72f6dea414512e2/upcxx/backend.hpp:8:
In file included from /home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/.nobs/art/d6fdf541e82fcd8e261cd97cc72f6dea414512e2/upcxx/future.hpp:7:
/home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/.nobs/art/d6fdf541e82fcd8e261cd97cc72f6dea414512e2/upcxx/future/apply.hpp:23:14: error: no matching function for call to 'make_future'
      return upcxx::make_future<>();
             ^~~~~~~~~~~~~~~~~~~~
/home/upcnightly/EX-dirac-ibv-clang/runtime/bld/dbg/upcxx/.nobs/art/d6fdf541e82fcd8e261cd97cc72f6dea414512e2/upcxx/future/make_future.hpp:44:8: note: candidate template ignored: substitution failure [with T = <>]: type 'detail::make_future<>' does not provide a call operator
  auto make_future(T ...values)
       ^

ppc-le Linux g++ 4.8.5:

/usr/bin/g++ -std=c++11 -D_GNU_SOURCE=1 -I/home/phargrov/upcnightly/EX-ppc64el-smp-gcc-pshm/runtime/bld/dbg/upcxx/.nobs/art/6601cb2bfd9ba5207a8c588222ac19e515df5631 -DUPCXX_BACKEND=gasnet1_seq -D_GNU_SOURCE=1 -DGASNET_SEQ -I/home/phargrov/upcnightly/EX-ppc64el-smp-gcc-pshm/runtime/bld/dbg/upcxx/gasnet/include -I/home/phargrov/upcnightly/EX-ppc64el-smp-gcc-pshm/runtime/bld/dbg/upcxx/gasnet/include/smp-conduit -O0 -g -Wall -g3 -Wall -Wpointer-arith -Wwrite-strings -Wmissing-format-attribute -Wno-unused -Wno-unused-parameter -Wno-address -c /home/phargrov/upcnightly/EX-ppc64el-smp-gcc-pshm/runtime/bld/dbg/upcxx/test/hello_upcxx.cpp -o /home/phargrov/upcnightly/EX-ppc64el-smp-gcc-pshm/runtime/bld/dbg/upcxx/.nobs/art/ac165cad0e0132a83fbc34dbc66c7072568873c6.hello_upcxx.cpp.o?[0m

In file included from /home/phargrov/upcnightly/EX-ppc64el-smp-gcc-pshm/runtime/bld/dbg/upcxx/.nobs/art/6601cb2bfd9ba5207a8c588222ac19e515df5631/upcxx/future/apply.hpp:5:0,
                 from /home/phargrov/upcnightly/EX-ppc64el-smp-gcc-pshm/runtime/bld/dbg/upcxx/.nobs/art/6601cb2bfd9ba5207a8c588222ac19e515df5631/upcxx/future.hpp:7,
                 from /home/phargrov/upcnightly/EX-ppc64el-smp-gcc-pshm/runtime/bld/dbg/upcxx/.nobs/art/6601cb2bfd9ba5207a8c588222ac19e515df5631/upcxx/backend.hpp:8,
                 from /home/phargrov/upcnightly/EX-ppc64el-smp-gcc-pshm/runtime/bld/dbg/upcxx/test/hello_upcxx.cpp:1:
/home/phargrov/upcnightly/EX-ppc64el-smp-gcc-pshm/runtime/bld/dbg/upcxx/.nobs/art/6601cb2bfd9ba5207a8c588222ac19e515df5631/upcxx/future/make_future.hpp:37:29: error: 'is_trivially_copyable' is not a member of 'std'
         upcxx::trait_forall::value,
                             ^
/home/phargrov/upcnightly/EX-ppc64el-smp-gcc-pshm/runtime/bld/dbg/upcxx/.nobs/art/6601cb2bfd9ba5207a8c588222ac19e515df5631/upcxx/future/make_future.hpp:37:29: error: 'is_trivially_copyable' is not a member of 'std'
/home/phargrov/upcnightly/EX-ppc64el-smp-gcc-pshm/runtime/bld/dbg/upcxx/.nobs/art/6601cb2bfd9ba5207a8c588222ac19e515df5631/upcxx/future/make_future.hpp:37:61: error: template argument 1 is invalid
         upcxx::trait_forall::value,
                                                             ^
/home/phargrov/upcnightly/EX-ppc64el-smp-gcc-pshm/runtime/bld/dbg/upcxx/.nobs/art/6601cb2bfd9ba5207a8c588222ac19e515df5631/upcxx/future/make_future.hpp:39:7: error: template argument 1 is invalid
       > {
       ^
In file included from /home/phargrov/upcnightly/EX-ppc64el-smp-gcc-pshm/runtime/bld/dbg/upcxx/.nobs/art/6601cb2bfd9ba5207a8c588222ac19e515df5631/upcxx/future.hpp:7:0,
                 from /home/phargrov/upcnightly/EX-ppc64el-smp-gcc-pshm/runtime/bld/dbg/upcxx/.nobs/art/6601cb2bfd9ba5207a8c588222ac19e515df5631/upcxx/backend.hpp:8,
                 from /home/phargrov/upcnightly/EX-ppc64el-smp-gcc-pshm/runtime/bld/dbg/upcxx/test/hello_upcxx.cpp:1:
/home/phargrov/upcnightly/EX-ppc64el-smp-gcc-pshm/runtime/bld/dbg/upcxx/.nobs/art/6601cb2bfd9ba5207a8c588222ac19e515df5631/upcxx/future/apply.hpp:18:43: error: no matching function for call to 'make_future()'
     typedef decltype(upcxx::make_future<>()) return_type;
                                           ^

Comments (6)

  1. Former user Account Deleted

    I'm fairly sure 4.8 is the problem. This happened to me on older Ubuntu's until I got 4.9.

  2. Amir Kamil

    This was not implemented in GCC until version 5.1.0 (libstdc++ version 6.0.21). Clang should have full support as of version 3.3 and its associated libc++. However, as far as I can tell, libc++ is only fully supported on MacOS, so other platforms are likely using libstdc++ with Clang, in which case they need GCC 5.1.0 as well.

  3. Paul Hargrove

    I am setting Component = Documentation since we've determined that the reported error reflects a requirement on the minimum compiler/STL version rather than an issue in the code.

    Currently BUILD.md in develop contains the following which appears to be incorrect with respect to GCC (and incomplete w.r.t. clang and icc).

      - C++11 compiler: (gcc >= 4.9) or (clang >= ???) or (icc >= ???)
    

    I am not sure where else we may also want/need to document these prerequisites.

  4. Paul Hargrove

    @akamil wrote:

    Clang should have full support as of version 3.3 and its associated libc++. However, as far as I can tell, libc++ is only fully supported on MacOS, so other platforms are likely using libstdc++ with Clang, in which case they need GCC 5.1.0 as well.

    I am currently pursuing this question on Linux in issue #31.

  5. Dan Bonachea reporter

    This error was caused by using a C++ standard library that we have decided is too old to support. The minimum required compiler versions are now documented in README.md and enforced by the install script.

  6. Log in to comment