Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
D
dune-common
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 69
    • Issues 69
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 45
    • Merge Requests 45
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Core Modules
  • dune-common
  • Issues
  • #211

Closed
Open
Opened May 25, 2020 by Simon Praetorius@simon.praetoriusOwner

MPI with C bindings and the MPI_FOUND variable

In the current dune-common cmake configuration there is a macro DuneMPI to find the package MPI and to provide a function to set flags.

There is a comment in the header: "The DUNE way to compile MPI applications is to use the CXX compiler with MPI flags usually used for C. CXX bindings are deactivated to prevent ABI problems.". Is this necessary any more? What is the actual problem with just linking against the MPI cxx target?

Why not just writing:

find_package(MPI)
if (TARGET MPI::MPI_CXX)
  target_link_libraries(dune-common PUBLIC MPI::MPI_CXX)
endif ()

Maybe there was a change in the meaning of MPI_CXX in cmake. The CXX version of MPI does not mean the MPI C++ API (removed in MPI-3), but refers to the MPI C API being usable from C++. So, why do we use MPI_C currently in dune-common, then?

This is discussed in https://gitlab.dune-project.org/simon.praetorius/dune-cmake/issues/1 and a related question regarding the cmake and compile flags for MPI is discussed in !804

Proposal

  • Switch to the MPI::MPI_CXX target
  • use MPI_FOUND as a test that MPI is correctly found and working for all enabled languages in cmake (note, if we just enable CXX, only the MPI_CXX target will be search for) or for all searched components
  • Maybe explicitly search only for the CXX component to improve configuration time.
Edited May 25, 2020 by Simon Praetorius
Assignee
Assign to
New CMake Build-System
Milestone
New CMake Build-System
Assign milestone
Time tracking
None
Due date
None
Reference: core/dune-common#211