在 CMake 中添加 MPI 支持 发表于 2020-11-30 更新于 2024-08-22 分类于 C++ 文章标准 暂无 1234567891011cmake_minimum_required(VERSION 3.17)project(MPITest)find_package(MPI REQUIRED)include_directories(${MPI_INCLUDE_PATH})set(CMAKE_CXX_STANDARD 20)set(CMAKE_CXX_COMPILER mpicxx)set(CMAKE_C_COMPILER mpicc)add_executable(${PROJECT_NAME} main.cpp)