[英]Error while compiling hello world program in mpi in C on openSUSE
程序:
#include <stdio.h>
#include <mpi.h>
int main (argc, argv)
int argc;
char *argv[];
{
int rank, size;
MPI_Init (&argc, &argv); /* starts MPI */
MPI_Comm_rank (MPI_COMM_WORLD, &rank); /* get current process id */
MPI_Comm_size (MPI_COMM_WORLD, &size); /* get number of processes */
printf( "Hello world from process %d of %d\n", rank, size );
MPI_Finalize();
return 0;
}
错误:
/usr/lib/gcc/i586-suse-linux/4.4/../../../../i586-suse-linux/bin/ld: cannot find -lopen-rte
collect2: ld returned 1 exit status
编译命令: mpicc hello.c -o ./hello
。 我正在尝试建立一个openSUSE节点集群。 因此,我正在测试mpich2程序是否在每个节点上运行。
libopen-rte.so是指OpenMPI,而不是MPICH2。 使用mpi-selector工具检查默认的MPI实现。 我个人更喜欢OpenMPI。
看起来您同时安装了两个MPI库。 尽管这是可行的,但是如果您不太仔细的话,通常很难进行配置和使用。 我建议卸载Open MPI或MPICH。 那应该解决您的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.