已安装OpenMPI,但仍找不到MPI_C和MPI_CXX

时间:2019-07-06 15:43:31

标签: ubuntu makefile cmake openmpi

我在Ubuntu服务器上。

我通过从以下位置下载tar文件安装了OpenMPI:https://www.open-mpi.org/software/ompi/v4.0/

然后

./configure --prefix=$HOME
make
make install

但是我仍然收到以下错误:

-- MPI not found
CMake Error at flashlight/distributed/CMakeLists.txt:67 (message):
  MPI_C and MPI_CXX not found; required to build flashlight distributed
Call Stack (most recent call first):
  CMakeLists.txt:240 (include)

我尝试过:

export MPI_C=$HOME

但我仍然收到错误消息。

如何解决问题?

给出错误的CMAKELists.txt文件是:

# MPI
find_package(MPI QUIET)

if (MPI_C_FOUND AND MPI_CXX_FOUND)
  message(STATUS "MPI_CXX found")
  message(STATUS "MPI_CXX compile flags: " ${MPI_CXX_COMPILE_FLAGS})
  message(STATUS "MPI_CXX include path: " ${MPI_CXX_INCLUDE_PATH})
  message(STATUS "MPI_CXX LINK flags path: " ${MPI_CXX_LINK_FLAGS})
  message(STATUS "MPI_CXX libraries: " ${MPI_CXX_LIBRARIES})

  message(STATUS "MPI_C found")
  message(STATUS "MPI_C compile flags: " ${MPI_C_COMPILE_FLAGS})
  message(STATUS "MPI_C include path: " ${MPI_C_INCLUDE_PATH})
  message(STATUS "MPI_C LINK flags path: " ${MPI_C_LINK_FLAGS})
  message(STATUS "MPI_C libraries: " ${MPI_C_LIBRARIES})
else()
  message(STATUS "MPI not found")
  if (FL_BUILD_DISTRIBUTED)
    message(FATAL_ERROR "MPI_C and MPI_CXX not found; required to build flashlight di$
  endif()
endif()

0 个答案:

没有答案