如何用CMake构建VTK进行并行计算?

时间:2016-02-19 09:28:34

标签: parallel-processing cmake codeblocks vtk

我想用CMake构建VTK用于并行计算,环境是Win10(x64),Codeblocks-12.11,VTK-7.0.0和CMake-3.5.0。当我选择VTK_Group_MPIModule_vtkParallelMPI时,CMake错误如下。那么如何使用CMake构建VTK并行计算呢?提前谢谢!

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_C_LIBRARIES (ADVANCED)
    linked by target "vtkParallelMPI" in directory C:/VTK/source/VTK-7.0.0/Parallel/MPI
    linked by target "vtkIOMPIImage" in directory C:/VTK/source/VTK-7.0.0/IO/MPIImage
    linked by target "vtkIOMPIParallel" in directory C:/VTK/source/VTK-7.0.0/IO/MPIParallel
    linked by target "vtkIOParallelNetCDF" in directory C:/VTK/source/VTK-7.0.0/IO/ParallelNetCDF
MPI_HEADER_PATH
   used as include directory in directory C:/VTK/source/VTK-7.0.0/Parallel/MPI
   used as include directory in directory C:/VTK/source/VTK-7.0.0/Parallel/MPI
   used as include directory in directory C:/VTK/source/VTK-7.0.0/Parallel/MPI
   used as include directory in directory C:/VTK/source/VTK-7.0.0/Parallel/MPI
   used as include directory in directory C:/VTK/source/VTK-7.0.0/Parallel/MPI
   used as include directory in directory C:/VTK/source/VTK-7.0.0/Parallel/MPI
   used as include directory in directory C:/VTK/source/VTK-7.0.0/Parallel/MPI
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIImage
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIImage
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIImage
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIImage
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIImage
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIImage
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIImage
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIParallel
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIParallel
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIParallel
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIParallel
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIParallel
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIParallel
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/MPIParallel
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/ParallelNetCDF
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/ParallelNetCDF
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/ParallelNetCDF
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/ParallelNetCDF
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/ParallelNetCDF
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/ParallelNetCDF
   used as include directory in directory C:/VTK/source/VTK-7.0.0/IO/ParallelNetCDF

2 个答案:

答案 0 :(得分:0)

我必须承认我自己还没有尝试过构建VTK,但我知道很多CMake看到它找不到MPI库,因为没有设置变量MPI_C_LIBRARIES和MPI_HEADER_PATH。

你是如何配置CMake的?

如果您使用的是CMake GUI - 我建议您这样做 - 您应该打开分组高级选项。

现在,Find_MPI CMake脚本使用注册表来查找MPI库 - 因此您可以通过设置dist/环境变量来帮助它。

请参阅Find_MPI Source code

但是,如果所有这些都是黑魔法,那么只要你打开了高级和分组模式,就可以在CMake中为缺失的变量输入正确的值。

答案 1 :(得分:0)

将MPI二进制文件目录添加到路径中。

PATH=$PATH:${YOU_MPI_DIRECTORY}/bin

MPI编译器(mpicc,mpicxx,mpif90等)是应该解决这些依赖性的包装器。