Search code examples
linuxgccmpiopenmpiopensuse

Error trying to compile simple "hello world" with OpenMPI on OpenSUSE


I am learning MPA using OpenMPI on my classes, but I cannot seem to make it work on my laptop using OpenSUSE.

I got OpenMPI from https://software.opensuse.org/package/openmpi and when trying to compile using:

mpicc hello.c -o hello

I get the following error msg saying that it cannot find mpi.h:

hello.c:3:17: fatal error: mpi.h: No such file or directory
 #include "mpi.h"
                 ^
compilation terminated

Is there something that I am missing? If so, what exactly do I need to do to make this work out?


Solution

  • You also need to install openmpi-devel package:

    zypper install openmpi-devel