cmake / Modules / FindPackageHandleStandardArgs.cmake上的CMake错误:108(消息):找不到MPI_C(缺少:MPI_C_LIBRARIES)

时间:2017-12-30 20:21:42

标签: cmake

我有一个项目。当我想在CMAKE3.9.6中使用Visual Studio 2010配置它并在命令行中使用此命令支持英特尔Parallel Studio 2015

cmake -G "Visual Studio 10"

我收到此错误:

  CMake Error at     cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  Could NOT find MPI_C (missing: MPI_C_LIBRARIES)
Call Stack (most recent call first):
      cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
  cmake/Modules/FindMPI.cmake:615 (find_package_handle_standard_args)
  CMakeLists.txt:113 (FIND_PACKAGE)


Configuring incomplete, errors occurred!

所有输出均为:

The Fortran compiler identification is Intel 15.0.2.20150121
The C compiler identification is MSVC 16.0.30319.1
The CXX compiler identification is MSVC 16.0.30319.1
Check for working Fortran compiler: C:/Program Files (x86)/Intel/Composer XE 2015/bin/ia32/ifort.exe
Check for working Fortran compiler: C:/Program Files (x86)/Intel/Composer XE 2015/bin/ia32/ifort.exe  — works
Detecting Fortran compiler ABI info
Detecting Fortran compiler ABI info - done
Determine Intel Fortran Compiler Implicit Link Path
Determine Intel Fortran Compiler Implicit Link Path — done
Checking whether C:/Program Files (x86)/Intel/Composer XE 2015/bin/ia32/ifort.exe supports Fortran 90
Checking whether C:/Program Files (x86)/Intel/Composer XE 2015/bin/ia32/ifort.exe supports Fortran 90 — yes
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/cl.exe — works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/cl.exe — works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Deprecation Warning at CMakeLists.txt:47 (CMAKE_POLICY):
  The OLD behavior for policy CMP0022 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Error at cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  Could NOT find MPI_C (missing: MPI_C_LIBRARIES)
Call Stack (most recent call first):
  cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
  cmake/Modules/FindMPI.cmake:615 (find_package_handle_standard_args)
  CMakeLists.txt:113 (FIND_PACKAGE)


Configuring incomplete, errors occurred!
See also "F:/FreshElmerForCmake396/elmerfem/CMakeFiles/CMakeOutput.log".

Fortran编译器和Visual Studio可以工作,但我认为CMAKE中存在错误,因此无法找到一些内部文件或正确的PATH.I下载CMAKE的二进制MSI版本。我用cmake-gui错误是相同的。那我该怎么办?

1 个答案:

答案 0 :(得分:0)

当CMake的依赖查找机制无法自动找到依赖关系X(在你的情况下为MPI),并且你知道你有X可用时,正确的程序是告诉CMake在哪里找到X,或者如何找到它。使用CMake GUI或 [{"label":"Contact: Screech Powers-> Powers, Screech: 1980-02-05","value":"Powers, Screech","id":"4258"}] 设置适当的变量。

在您的情况下,documentation for the FindMPI module表示将ccmake设置为指向适当的MPI编译器包装器可能足以让依赖查找程序接管。