dune-uggrid won't compile with Clang 6.0 (Ubuntu 18.04)
Summary
dune-uggrid cannot be compiled with Clang 6.0 (or Apple Clang 9.1.0 on MacOS 10.13.4). Clang 6.0 is the default version for Ubuntu 18.04 LTS.
The error is localized to a portion of code in the parallel
directory, however, the it occurs for sequential and parallel builds.
Error message
error: implicit instantiation of undefined template 'std::__1::array<TYPE, VALUE>
Log without MPI:
Error message:
[ 91%] Building CXX object lib/CMakeFiles/ugL.dir/__/dune/uggrid/parallel/ddd/dddcontext.cc.o
In file included from /Users/lriedel/dune-utopia/dune-uggrid/dune/uggrid/parallel/ddd/dddcontext.cc:3:
/Users/lriedel/dune-utopia/dune-uggrid/dune/uggrid/parallel/ddd/dddcontext.hh:377:39: error: implicit instantiation of undefined template 'std::__1::array<DDD::TYPE_DESC, 32>'
std::array<TYPE_DESC, MAX_TYPEDESC> typeDefs_;
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/__tuple:223:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
^
In file included from /Users/lriedel/dune-utopia/dune-uggrid/dune/uggrid/parallel/ddd/dddcontext.cc:3:
/Users/lriedel/dune-utopia/dune-uggrid/dune/uggrid/parallel/ddd/dddcontext.hh:379:28: error: implicit instantiation of undefined template 'std::__1::array<int, 25>'
std::array<int, OPT_END> options_;
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/__tuple:223:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
^
2 errors generated.
Log with MPI:
Error message:
[ 0%] Building CXX object parallel/dddif/CMakeFiles/dddif2.dir/compat.cc.o
In file included from /Users/lriedel/dune-utopia/dune-uggrid/parallel/dddif/compat.cc:3:
In file included from /Users/lriedel/dune-utopia/dune-uggrid/parallel/dddif/parallel.h:37:
/Users/lriedel/dune-utopia/dune-uggrid/dune/uggrid/parallel/ddd/dddcontext.hh:377:39: error: implicit instantiation of undefined template 'std::__1::array<DDD::TYPE_DESC, 32>'
std::array<TYPE_DESC, MAX_TYPEDESC> typeDefs_;
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/__tuple:223:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
^
In file included from /Users/lriedel/dune-utopia/dune-uggrid/parallel/dddif/compat.cc:3:
In file included from /Users/lriedel/dune-utopia/dune-uggrid/parallel/dddif/parallel.h:37:
/Users/lriedel/dune-utopia/dune-uggrid/dune/uggrid/parallel/ddd/dddcontext.hh:379:28: error: implicit instantiation of undefined template 'std::__1::array<int, 25>'
std::array<int, OPT_END> options_;
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/__tuple:223:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
^
2 errors generated.
Ideas how to fix this
The compiler refers to an array
template definition in the __tuple
library. Maybe there's just an #include
missing?