configure error: MPI_EXTRA_LIBRARY, MPI_LIBRARY NOTFOUND

Issue #86 new
Nico Schlömer created an issue

I've tried to build MOAB for the first time in a while and configuration failed with

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
MPI_EXTRA_LIBRARY
    linked by target "MOAB" in directory /home/nschloe/software/moab/source-upstream/src
MPI_LIBRARY
    linked by target "MOAB" in directory /home/nschloe/software/moab/source-upstream/src

This comes from the lines

  # CMake FindMPI script is sorely lacking:                                                                                             
  if ( MPI_LIBRARY AND MPI_INCLUDE_PATH )                                                                                               
    set( MPI_FOUND ON )                                                                                                                 
  endif ( MPI_LIBRARY AND MPI_INCLUDE_PATH )

in the main CMakeLists.txt. In my case MPI_LIBRARY is NOTFOUND, resulting in the above error.

It is my understanding that MPI_FOUND is set by FindMPI itself, and indeed it is TRUE in my case. There is no explicit MPI_LIBRARY since this is all handled by the mpic++ compiler wrapper.

This is on a standard OpenMPI installation on Ubuntu 18.10.

Comments (4)

  1. Vijay M

    We do run tests on Ubuntu 12/14/16 but not on 18.1 AFAIK. We probably should with a docker container upgrade. But we have so far not seen the issue that you have raised here with regard to MPI library configuration.

    I understand from the above snippet why the configuration fails. If I remember, we added that to handle some issues with older OpenMPI versions. I'm unsure if we still need it anymore. But perhaps, we can be a bit more intelligent in the check. I'll take a look.

  2. Log in to comment