【学习cmake-cookbook/chapter-03/recipe-06/cxx-example】

1、源代码:

        cmake-cookbook/chapter-03/recipe-06/cxx-example at master · qijitao/cmake-cookbook · GitHub

2、什么是MPI

它是Message Passing Inferface的缩写,它是并行编程的基础。详细教程参见:MPI 教程介绍 · MPI Tutorial

MPI教程作者的书籍: Beginning MPI (An Introduction in C) ,Amazon.com

3、缺少MPI,如何安装?

-- Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_HEADER_DIR MPI_CXX_WORKS) 
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find MPI (missing: MPI_CXX_FOUND)

一开始使用apt install mpi时,安装是错误的,导致仍然没有解决问题:      【学习cmake-cookbook/chapter-03/recipe-06/cxx-example】_第1张图片

 后来在如下网站中发现,应该使用apt install mpi-default-dev指令:

        https://matsci.org/t/add-open-mpi-to-use-latboltz-package/43894/4

        【学习cmake-cookbook/chapter-03/recipe-06/cxx-example】_第2张图片

 再次编译就过了:

【学习cmake-cookbook/chapter-03/recipe-06/cxx-example】_第3张图片

4、apt install mpi-default-dev和apt install mpi有什么区别?

        根绝网友的解释,Ubuntu已经有MPI的预编译安装包,名字就叫做 mpi-default-bin 或mpi-default-dev,而不叫mpi,也就是说使用mpi的名字安装MPI是错误的。【学习cmake-cookbook/chapter-03/recipe-06/cxx-example】_第4张图片来源:Add Open MPI to Use LATBOLTZ package - #2 by akohlmey - LAMMPS Installation - Materials Science Community Discourse     

 

 

你可能感兴趣的:(编译和调试,camke,MPI)