OpenFOAM with MPICH fatal error: mpi.h: No such file or directory

1.1k views Asked by At

I am trying to build OpenFOAM from source with MPICH-3.3.2 but got

g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3  -DNoRepository -ftemplate-depth-100  -I -IlnInclude -I. -I/home/pranto/OpenFOAM-dev/src/OpenFOAM/lnInclude -I/home/pranto/OpenFOAM-dev/src/OSspecific/POSIX/lnInclude   -fPIC -c PstreamGlobals.C -o /home/pranto/OpenFOAM-dev/platforms/linux64GccDPInt32OptSYSTEMMPI/src/Pstream/mpi/PstreamGlobals.o
UPstream.C:30:17: fatal error: mpi.h: No such file or directory
compilation terminated.
/home/pranto/OpenFOAM-dev/wmake/rules/General/transform:25: recipe for target '/home/pranto/OpenFOAM-dev/platforms/linux64GccDPInt32OptSYSTEMMPI/src/Pstream/mpi/UPstream.o' failed
make[4]: *** [/home/pranto/OpenFOAM-dev/platforms/linux64GccDPInt32OptSYSTEMMPI/src/Pstream/mpi/UPstream.o] Error 1
make[4]: *** Waiting for unfinished jobs....
In file included from PstreamGlobals.C:26:0:

PstreamGlobals.H:41:17: fatal error: mpi.h: No such file or directory

compilation terminated.
In file included from UIPread.C:30:0:

PstreamGlobals.H:41:17: fatal error: mpi.h: No such file or directory
compilation terminated.

Although I set export WM_MPLIB=SYSTEMMPI in etc/bashrc. But with the OpenMPI everything is ok.

What are the additional settings I have to consider to build OpenFOAM with MPICH-3.3.2?

1

There are 1 answers

0
ztdep On

In the "openfoma/etc" directory, there is a setting file for mpi where you can change the version and the location of the mpich you used. Hope this will help you. By the way, it is not necessary to set the bashrc file.