when I compile my script with only
#include <mpi.h>
it tells me that there is no such file or directory. But when i include the path to mpi.h as
#include "/usr/include/mpi/mpi.h"
(the path is correct) it returns:
In file included from /usr/include/mpi/mpi.h:2087:0,
from lbm.cc:7:
/usr/include/mpi/openmpi/ompi/mpi/cxx/mpicxx.h:35:17: fatal error: mpi.h: No such file or directory
#include "mpi.h"
^
compilation terminated.
Anyone know how to fix this?
mpicc main.c -o mainormpiCC main.cpp -o main. Is it your case ? Regarding the second message : you may have two implementations of the MPI standards on your computer. You may try to know more by typingwhich mpicc,which mpirun,mpirun --versionormodule avail. The implementation (openmpi or mpich2 or...) of compiler command must be the same as the command to execute the programmpirun -np 2 main.