Skip to content

External plugin fails to build when MPI is enabled

This issue is related to paraview#19118 (closed).

When MPI is built by the superbuild, MPI_C_COMPILER and MPI_CXX_COMPILER are set to <buildfolder>/install/bin/mpic{,xx}. However, when an external plugin is built, he does not see these variables. The comment here suggests that the find_package(ParaView) should lead to the same MPI being found, but not in the case of the superbuild (as it is an newly build MPI). Should the superbuild set the MPI_*_COMPILER for external plugins / projects ?

@ben.boeckel if you have an idea on this.

Investigation:

In my installed version of ParaView, the C component is required in the file: lib/cmake/paraview-5.10/vtk/VTK-vtk-module-find-package.cmake

line 444:

  find_package(MPI
    
    
    
    ${_vtk_module_find_package_quiet}
    ${_vtk_module_find_package_required}
    COMPONENTS          C
    OPTIONAL_COMPONENTS )
  if (NOT MPI_FOUND AND _vtk_module_find_package_fail_if_not_found)
    if (NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
      message(STATUS
        "Could not find the ${CMAKE_FIND_PACKAGE_NAME} package due to a "
        "missing dependency: MPI")
    endif ()
    set("${CMAKE_FIND_PACKAGE_NAME}_mpi_FOUND" 0)
    list(APPEND "${CMAKE_FIND_PACKAGE_NAME}_mpi_NOT_FOUND_MESSAGE"
      "Failed to find the MPI package.")
  endif ()
endif ()

Removing the COMPONENTS C here make the configure succeed. (Putting C in the OPTIONAL_COMPONENTS still fail though)

Note: unkonw paraviw cmake option: wrapped_mpi

Edited by Charles Gueunet