configure error: MPI_EXTRA_LIBRARY, MPI_LIBRARY NOTFOUND
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)
-
-
Looks like this may depend on the CMake version. Which version are you using ? We still support CMake 2.8.x family but newer versions (3.x) have changed the behavior somewhat [1]. I will look into upgrading the minimum supported version to 3.0 on our next release.
-
reporter I'm on 3.12.1 (Ubuntu 18.10).
-
These issues should be addressed in the latest set of CMake PRs.
- Log in to comment
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.