CMake FindMPI CMAKE_PREFIX_PATH
We discovered a long-standing
bug
in CMake find_package(MPI)
location hint via
CMAKE_PREFIX_PATH variable or environment variable
CMAKE_PREFIX_PATH.
For an unknown number of releases, CMake FindMPI ignores CMAKE_PREFIX_PATH, which normally takes a high priority in the search order.
To workaround this issue, use variable MPI_ROOT
to tell FindMPI where to look for MPI.