--- a/include/med.h.in	2018-07-06 10:55:49.247164591 +0200
+++ a/include/med.h.in.new	2018-07-06 10:55:29.559164666 +0200
@@ -19,6 +19,11 @@
 #ifndef MED_H
 #define MED_H
 
+@MED_DEFINE_MED_HAVE_MPI@
+#ifdef MED_HAVE_MPI
+#include <mpi.h>
+#endif
+
 #include <hdf5.h>
 #ifdef HAVE_STDINT_H
 #include <stdint.h>   // Use the C99 official header
@@ -66,8 +71,6 @@
 #define _MED_VERSION(x,y,z) STR(x) "." STR(y) "." STR(z)
 #define MED_VERSION_STR _MED_VERSION(MED_NUM_MAJEUR,MED_NUM_MINEUR,MED_NUM_RELEASE)
 
-@MED_DEFINE_MED_HAVE_MPI@
-
 #define MED_NULL       (void *) NULL
 #define MED_MAX_PARA        20
 
