【发布时间】:2012-03-12 09:59:35
【问题描述】:
我使用的是 lion 和 xcode 4.2。我使用 macports 安装了 openmpi。全部安装成功。
我找不到,但是可以找到一个指南来告诉我如何/包含哪些库来编译示例(见下文)
#include <mpi.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
int numprocs;
int myid;
MPI_Status stat;
/* all MPI programs start with MPI_Init */
MPI_Init(&argc,&argv);
/* Comm_size tells us how many processes there are */
MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
/* Comm_rank finds the rank of the process */
MPI_Comm_rank(MPI_COMM_WORLD,&myid);
/* Print out a message */
printf("Hello world, from process %d of %d\n", myid, numprocs);
/* MPI Programs end with MPI Finalize; this is a weak synchronization point */
MPI_Finalize();
return 0;
}
Xcode 报告缺少 mpi.h。
【问题讨论】:
标签: xcode macos osx-lion parallel-processing openmpi