When I tried to ./configure in plumed with both openmpi and mpich I got same errors:-
checking mpi.h usability... no
checking mpi.h presence... yes
configure: WARNING: mpi.h: present but cannot be compiled
configure: WARNING: mpi.h: check for missing prerequisite headers?
configure: WARNING: mpi.h: see the Autoconf documentation
configure: WARNING: mpi.h: section "Present But Cannot Be Compiled"
configure: WARNING: mpi.h: proceeding with the compiler's result
checking for mpi.h... no
configure: WARNING: cannot enable __PLUMED_MPI