title: How to include mpi.h in CLion on Windows machine
body: <p>It says cannot find <code>mpi.h</code> and after I run the code following error is shown:</p>
  
  <p><code>fatal error: mpi.h: No such file or directory</code>.</p>
  
  <p>I am using <code>TDM-GCC</code> (<code>MinGW</code> enviroment).</p>
  
  <p>So far I downloaded and installed <a href="https://msdn.microsoft.com/en-us/library/bb524831.aspx" rel="nofollow noreferrer">MS-MPI</a>.</p>
  
  <p>Now I am trying to figure out <strong>how to include</strong> <code>mpi.h</code> <strong>successfully in</strong> <code>CLion</code>.</p>
  
  <p>Here is the code snippet (actually not relevant ATM): </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;mpi.h&gt; // THIS IS THE PROBLEM
  
  int main(int argc, char *argv[]) {
    const int tag = 42;           /* Message tag */
    int   id, ntasks, source_id, err, i;
    MPI_Status status;
    char msg[80];                /* Message array */
  
  // irrelevant code
  // irrelevant code
  }
  </code></pre>
  
  <p>Here is my <code>CMakeLists.txt</code> file (just default):</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.6)
  project(mpi_test_clion)
  
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
  
  set(SOURCE_FILES mpi_hello.cpp)
  add_executable(mpi_test_clion ${SOURCE_FILES})
  </code></pre>