Compilation error in v9.5.1

43 views
Skip to first unread message

Tomáš Levý

unread,
Jul 21, 2023, 5:26:35 PM7/21/23
to deal.II User Group
Dear all,

I'm trying to compile the 9.5.1 version without MPI on Ubuntu 20.04 but I'm getting the following error:

/home/tom/p/dealii/source/lac/petsc_communication_pattern.cc: In member function ‘void dealii::PETScWrappers::CommunicationPattern::export_to_ghosted_array_start(const dealii::ArrayView<const ElementType>&, const dealii::ArrayView<ElementType>&) const’:
/home/tom/p/dealii/source/lac/petsc_communication_pattern.cc:264:37: error: ‘mpi_type_id_for_type’ is not a member of ‘dealii::Utilities::MPI’
  264 |     auto datatype = Utilities::MPI::mpi_type_id_for_type<Number>;
      |                                     ^~~~~~~~~~~~~~~~~~~~
/home/tom/p/dealii/source/lac/petsc_communication_pattern.cc:264:64: error: expected primary-expression before ‘>’ token
  264 |     auto datatype = Utilities::MPI::mpi_type_id_for_type<Number>;
      |                                                                ^
/home/tom/p/dealii/source/lac/petsc_communication_pattern.cc:264:65: error: expected primary-expression before ‘;’ token
  264 |     auto datatype = Utilities::MPI::mpi_type_id_for_type<Number>;
      |                                                                 ^
/home/tom/p/dealii/source/lac/petsc_communication_pattern.cc: In member function ‘void dealii::PETScWrappers::CommunicationPattern::export_to_ghosted_array_finish(const dealii::ArrayView<const ElementType>&, const dealii::ArrayView<ElementType>&) const’:
/home/tom/p/dealii/source/lac/petsc_communication_pattern.cc:280:37: error: ‘mpi_type_id_for_type’ is not a member of ‘dealii::Utilities::MPI’
  280 |     auto datatype = Utilities::MPI::mpi_type_id_for_type<Number>;
      |                                     ^~~~~~~~~~~~~~~~~~~~
/home/tom/p/dealii/source/lac/petsc_communication_pattern.cc:280:64: error: expected primary-expression before ‘>’ token
  280 |     auto datatype = Utilities::MPI::mpi_type_id_for_type<Number>;
      |                                                                ^
/home/tom/p/dealii/source/lac/petsc_communication_pattern.cc:280:65: error: expected primary-expression before ‘;’ token
  280 |     auto datatype = Utilities::MPI::mpi_type_id_for_type<Number>;


and so on. 

mpi_type_id_for_type is defined in source/base/mpi.cc, but inside #ifdef ... #endif:

#ifdef DEAL_II_WITH_MPI
    // Provide definitions of template variables for all valid instantiations.
    template const MPI_Datatype mpi_type_id_for_type<bool>;
    template const MPI_Datatype mpi_type_id_for_type<char>;
    template const MPI_Datatype mpi_type_id_for_type<signed char>;
    template const MPI_Datatype mpi_type_id_for_type<short>;
    template const MPI_Datatype mpi_type_id_for_type<int>;
    template const MPI_Datatype mpi_type_id_for_type<long int>;
    template const MPI_Datatype mpi_type_id_for_type<unsigned char>;
    template const MPI_Datatype mpi_type_id_for_type<unsigned short>;
    template const MPI_Datatype mpi_type_id_for_type<unsigned long int>;
    template const MPI_Datatype mpi_type_id_for_type<unsigned long long int>;
    template const MPI_Datatype mpi_type_id_for_type<float>;
    template const MPI_Datatype mpi_type_id_for_type<double>;
    template const MPI_Datatype mpi_type_id_for_type<long double>;
    template const MPI_Datatype mpi_type_id_for_type<std::complex<float>>;
    template const MPI_Datatype mpi_type_id_for_type<std::complex<double>>;
#endif


which should't be defined without MPI if I'm correct so the compilation error is about right.

Version 9.4.x compiles without problem.

Any advice please? Thanks

Tom

Wolfgang Bangerth

unread,
Jul 21, 2023, 9:49:11 PM7/21/23
to dea...@googlegroups.com
On 7/21/23 15:26, Tomáš Levý wrote:
>
> Any advice please?

Tomas:
that's awkward -- I guess nobody tests deal.II with PETSc but without MPI :-(

Can you try if it compiles for you if you simply comment out the entire
content of the export_to_ghosted_array_start() and
export_to_ghosted_array_finish() functions? Or are there other functions that
then still don't compile?

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/


Wolfgang Bangerth

unread,
Jul 22, 2023, 2:12:39 PM7/22/23
to dea...@googlegroups.com

Tomas:
can you try whether the changes here are sufficient for you to compile this file?
https://github.com/dealii/dealii/pull/15781

Best
Wolfgang
Message has been deleted

Tomáš Levý

unread,
Jul 23, 2023, 10:23:12 AM7/23/23
to deal.II User Group
Dear Wolfgang,

yes, with the updated file it compiles without a problem. Thank you very much for the quick workaround!

Best,
Tomas

Dne sobota 22. července 2023 v 20:12:39 UTC+2 uživatel Wolfgang Bangerth napsal:

Wolfgang Bangerth

unread,
Jul 23, 2023, 11:01:23 PM7/23/23
to dea...@googlegroups.com
On 7/23/23 08:22, Tomáš Levý wrote:
>
>
> yes, wit the updated file is compiles without a problem. Thank you very much
> for the quick workaround!

Great, thanks for checking!
Reply all
Reply to author
Forward
0 new messages