Error when compiling without PETSC support

Issue #673 resolved
Benjamin Dam Kehlet created an issue

When building Dolfin without PETSC support I get:

#!

[  1%] Building CXX object dolfin/CMakeFiles/dolfin.dir/la/STLMatrix.cpp.o
In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0,
                 from /usr/include/c++/5/bits/allocator.h:46,
                 from /usr/include/c++/5/string:41,
                 from /usr/include/c++/5/random:40,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from /home/benjamik/dev/fenics-dev/master/dolfin/dolfin/la/STLMatrix.cpp:24:
/usr/include/c++/5/ext/new_allocator.h: In instantiation of void __gnu_cxx::new_allocator< <template-parameter-1-1> >::construct(_Up*, _Args&& ...) [with _Up = dolfin::EigenVector; _Args = {ompi_communicator_t*&}; _Tp = dolfin::EigenVector]:
/usr/include/c++/5/bits/alloc_traits.h:530:4:   required from static void std::allocator_traits<std::allocator<_Tp> >::construct(std::allocator_traits<std::allocator<_Tp> >::allocator_type&, _Up*, _Args&& ...) [with _Up = dolfin::EigenVector; _Args = {ompi_communicator_t*&}; _Tp = dolfin::EigenVector; std::allocator_traits<std::allocator<_Tp> >::allocator_type = std::allocator<dolfin::EigenVector>]
/usr/include/c++/5/bits/shared_ptr_base.h:522:39:   required from std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {ompi_communicator_t*&}; _Tp = dolfin::EigenVector; _Alloc = std::allocator<dolfin::EigenVector>; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u]
/usr/include/c++/5/bits/shared_ptr_base.h:617:4:   required from std::__shared_count<_Lp>::__shared_count(std::_Sp_make_shared_tag, _Tp*, const _Alloc&, _Args&& ...) [with _Tp = dolfin::EigenVector; _Alloc = std::allocator<dolfin::EigenVector>; _Args = {ompi_communicator_t*&}; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u]
/usr/include/c++/5/bits/shared_ptr_base.h:1097:35:   required from std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<dolfin::EigenVector>; _Args = {ompi_communicator_t*&}; _Tp = dolfin::EigenVector; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u]
/usr/include/c++/5/bits/shared_ptr.h:319:64:   required from std::shared_ptr<_Tp>::shared_ptr(std::_Sp_make_shared_tag, const _Alloc&, _Args&& ...) [with _Alloc = std::allocator<dolfin::EigenVector>; _Args = {ompi_communicator_t*&}; _Tp = dolfin::EigenVector]
/usr/include/c++/5/bits/shared_ptr.h:620:39:   required from std::shared_ptr<_Tp1> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = dolfin::EigenVector; _Alloc = std::allocator<dolfin::EigenVector>; _Args = {ompi_communicator_t*&}]
/usr/include/c++/5/bits/shared_ptr.h:635:39:   required from std::shared_ptr<_Tp1> std::make_shared(_Args&& ...) [with _Tp = dolfin::EigenVector; _Args = {ompi_communicator_t*&}]
/home/benjamik/dev/fenics-dev/master/dolfin/dolfin/la/STLFactory.h:51:46:   required from here
/usr/include/c++/5/ext/new_allocator.h:120:4: error: invalid conversion from ompi_communicator_t* to std::size_t {aka long unsigned int} [-fpermissive]
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }

apparently because STLVector then becomes a typedef to EigenVector which doesn't have a constructor that take an MPI_COMM as its only argument.

Comments (2)

  1. Log in to comment