# Issues with superbuild with 5.9

**URL:** https://discourse.paraview.org/t/issues-with-superbuild-with-5-9/6363
**Category:** ParaView Support
**Created:** [February 1, 2021, 8:28pm UTC](https://discourse.paraview.org/t/issues-with-superbuild-with-5-9/6363 "2021-02-01T20:28:34Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Andy\_Bauer](https://discourse.paraview.org/user_avatar/discourse.paraview.org/andy_bauer/32/5442_2.png) [@Andy\_Bauer](https://discourse.paraview.org/u/Andy_Bauer)
#### Post date: [February 1, 2021, 8:28pm UTC](https://discourse.paraview.org/t/issues-with-superbuild-with-5-9/6363/1 "2021-02-01T20:28:34Z")

</div>

Hi,

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:

```auto
 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.

Thanks,  
Andy

[PV-CMakeCache.txt](https://discourse.paraview.org/uploads/short-url/74uoS0QKFmD9jiZ8TPWsnYJmYUI.txt) (160.9 KB) [SB-CMakeCache.txt](https://discourse.paraview.org/uploads/short-url/2hTSLvPoUMx3eNAnFwp6NVQyJk6.txt) (47.6 KB)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [February 1, 2021, 10:17pm UTC](https://discourse.paraview.org/t/issues-with-superbuild-with-5-9/6363/2 "2021-02-01T22:17:29Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Andy\_Bauer](https://discourse.paraview.org/user_avatar/discourse.paraview.org/andy_bauer/32/5442_2.png) [@Andy\_Bauer](https://discourse.paraview.org/u/Andy_Bauer)
#### Post date: [February 1, 2021, 10:35pm UTC](https://discourse.paraview.org/t/issues-with-superbuild-with-5-9/6363/3 "2021-02-01T22:35:05Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [February 1, 2021, 11:54pm UTC](https://discourse.paraview.org/t/issues-with-superbuild-with-5-9/6363/4 "2021-02-01T23:54:41Z")

</div>

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?

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

find_package(MPI)
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.

---

<div class="post-metadata">

### Author: ![ka5855](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ka5855/32/166_2.png) [@ka5855](https://discourse.paraview.org/u/ka5855)
#### Post date: [February 2, 2021, 1:00pm UTC](https://discourse.paraview.org/t/issues-with-superbuild-with-5-9/6363/5 "2021-02-02T13:00:57Z")

</div>

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 BUILD\_TESTING:BOOL=OFF   
-D CMAKE\_BUILD\_TYPE:STRING=“Release”   
-D CMAKE\_C\_COMPILER:FILEPATH=/opt/local/bin/gcc   
-D CMAKE\_CXX\_COMPILER:FILEPATH=/opt/local/bin/c++   
-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   
-D PARAVIEW\_BUILD\_EDITION:STRING=“CANONICAL”   
-D PARAVIEW\_BUILD\_SHARED\_LIBS=ON   
-D PARAVIEW\_ENABLE\_FFMPEG:BOOL=ON   
-D PARAVIEW\_USE\_FORTRAN:BOOL=ON   
-D PARAVIEW\_USE\_PYTHON:BOOL=ON   
-D PARAVIEW\_USE\_MPI:BOOL=ON   
-D PARAVIEW\_USE\_QT:BOOL=OFF   
-D PARAVIEW\_USE\_VTKM:BOOL=OFF   
-D VTK\_OPENGL\_HAS\_OSMESA:BOOL=OFF   
-D VTK\_PYTHON\_OPTIONAL\_LINK:BOOL=OFF   
-D VTK\_USE\_64BIT\_IDS:BOOL=ON   
-D VTK\_USE\_X:BOOL=OFF   
-D CMAKE\_INSTALL\_PREFIX:PATH=…/PV-5.9.0-RC2   
…/ParaView-v5.9.0-RC2

---

<div class="post-metadata">

### Author: ![Andy\_Bauer](https://discourse.paraview.org/user_avatar/discourse.paraview.org/andy_bauer/32/5442_2.png) [@Andy\_Bauer](https://discourse.paraview.org/u/Andy_Bauer)
#### Post date: [February 2, 2021, 1:24pm UTC](https://discourse.paraview.org/t/issues-with-superbuild-with-5-9/6363/6 "2021-02-02T13:24:12Z")

</div>

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

```auto
cmake_minimum_required(VERSION 2.4)

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

find_package(MPI)
#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:

```auto
#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);

  MPI_Finalize();

  return 0;
}

```

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [February 12, 2021, 6:01pm UTC](https://discourse.paraview.org/t/issues-with-superbuild-with-5-9/6363/7 "2021-02-12T18:01:52Z")

</div>

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)`?

---

<div class="post-metadata">

### Author: ![Andy\_Bauer](https://discourse.paraview.org/user_avatar/discourse.paraview.org/andy_bauer/32/5442_2.png) [@Andy\_Bauer](https://discourse.paraview.org/u/Andy_Bauer)
#### Post date: [February 12, 2021, 6:40pm UTC](https://discourse.paraview.org/t/issues-with-superbuild-with-5-9/6363/8 "2021-02-12T18:40:21Z")

</div>

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.
