Issues with superbuild with 5.9


I’m trying to build ParaView 5.9 with the superbuild with a pretty standard build (OSMesa, Python, MPI and not much else right now) and I’m getting the following error when it gets to building ParaView:

 Could not use git to determine source version, using version 5.9.0
 Could not use git to determine source version, using version
 Could NOT find MPI_C (missing: MPI_C_WORKS)
 Could NOT find MPI (missing: MPI_C_FOUND C)
     Reason given by package: MPI component 'Fortran' was requested, but language Fortran is not enabled.

 CMake Error at VTK/CMake/vtkModule.cmake:4228 (message):
   Could not find the MPI external dependency.
 Call Stack (most recent call first):
   VTK/CMake/vtkModule.cmake:4784 (vtk_module_find_package)
   VTK/Utilities/MPI/CMakeLists.txt:1 (vtk_module_third_party_external)

 Configuring incomplete, errors occurred!

I’ve tried multiple system MPIs as well as having superbuild do the MPI build. Each time it hits this CMake find MPI issue. Any ideas what’s causing this or how to get around it? The machine is an SGI ICE X. I’ve attached both of my CMakeCache.txt files (SB and the generated PV) in case that helps.


PV-CMakeCache.txt (160.9 KB) SB-CMakeCache.txt (47.6 KB)

What version of CMake are you using? It seems that whatever FindMPI is being used doesn’t recognize that we don’t want the Fortran components.

I tried with 3.19.4 and 3.16.5. I thought that ParaView/VTK used it’s own FindMPI.cmake code though so that it wouldn’t matter which version of CMake I was using when trying to find MPI. Maybe that doesn’t matter though.

We use a backported version of FindMPI (in this case, 3.17’s). So with an older CMake, VTK interposes its FindMPI otherwise it uses upstream’s.

Does a plain find_package(MPI) work in a standalone project?

cmake_minimum_required(VERSION 3.12)
project(test C CXX
  # Fortran # Try with and without this line.

find_package(MPI COMPONENTS C) # Try this variant too.

I recommend setting the CMAKE_PREFIX_PATH envvar to $superbuild_build_dir/install to use the MPI built by the superbuild.

Hey Andy: This comment may, or may not, be relevant to your build issue. I ran into the same Could NOT find MPI_C, MPI errors while doing the standard build (non-superbuild) on v5.9.0-RC2. The workaround was to specify both MPI_C_Compiler and MPI_CXX_complier in the cmake command, which is patched below. It works on macOS with cmake version 3.18.5 (via port).

`` cmake
-D CMAKE_C_COMPILER:FILEPATH=/opt/local/bin/gcc
-D CMAKE_Fortran_COMPILER:FILEPATH=/opt/local/bin/gfortran
-D MPI_C_COMPILER:FILEPATH=/opt/local/bin/mpicc
-D MPI_CXX_COMPILER:FILEPATH=/opt/local/bin/mpicxx

Yeah, the following builds in all combinations (with and without Fortran commented out in project() and both variants of find_package):

cmake_minimum_required(VERSION 2.4)

project(test C CXX
   Fortran # Try with and without this line.

#find_package(MPI COMPONENTS C) # Try this variant too.

add_executable(h.x helloworld.cxx)

target_link_libraries(h.x MPI::MPI_C)

To be complete, the code was:

#include <stdio.h>
#include <mpi.h>

int main(int argc, char** argv) {
  // Print off a hello world message                                                                                                                                                                               
  printf("Hello world from processor %s, rank %d out of %d processors\n",
         0, 1);

  MPI_Init(&argc, &argv);


  return 0;

So there was a fix to FindMPI recently. The Fortran bit is a red herring. The problem is that MPI isn’t being found. Is the MPI module that ParaView was built against loaded when configuring the project doing find_package(ParaView)?

I think the issue may have been due to a bad installation of MPI. When I switched to a different MPI install on the HPC machine things seemed to work better. Thanks for checking back on this Ben.