title: How to include omp.h in OS X?
body: <p>I'm new in C and have some problems compiling my code in OS X.</p>
  
  <p>I code Java a lot both in Eclipse and use terminal to compile my code. However now I'm learning openMP and have troubles with it.</p>
  
  <p>First I downloaded Xcode to write openMP code but it didn't recognize <code>&lt;omp.h&gt;</code>. Then I installed <code>g++</code>. When I type <code>g++ -v</code> into terminal I get this:</p>
  
  <pre><code>Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
  Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
  Target: x86_64-apple-darwin13.3.0
  Thread model: posix
  </code></pre>
  
  <p>But when I use <code>g++ Mesh.cpp -fopenmp</code> I still get</p>
  
  <pre><code>Mesh.cpp:4:10: fatal error: 'omp.h' file not found
  #include &lt;omp.h&gt;
           ^
  1 error generated.
  </code></pre>
  
  <p>Then I tried to install PTP into my Eclipse and got the same problem.
  I thought there was no <code>omp.h</code> in my MacBook so I searched for it and found several <code>omp.h</code> under folders under <code>gcc-4.9.1/build/</code>.</p>
  
  <p>Here comes the problem. Based on the Java experience the only reason why I have the file but cannot use it is that the Class Path is wrong. However, I have no idea how to change this configuration in g++, or in Xcode, or in Eclipse. But since I can include files like <code>&lt;stdio.h&gt;</code> and compile it with all the IDEs, how can't I do the same with <code>&lt;omp.h&gt;</code>?</p>
  
  <p>Another thing I noticed is that the gcc folder version is <code>4.9.1</code>, but when I type <code>gcc -v</code> into terminal I get the same with typing in <code>g++ -v</code></p>
  
  <pre><code>Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
  Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
  Target: x86_64-apple-darwin13.3.0
  Thread model: posix
  </code></pre>
  
  <p>Shouldn't the version information says something about <code>4.9.1</code>? Just like what <code>java -version</code> shows</p>
  
  <pre><code>java version "1.8.0_11"
  Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
  Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)
  </code></pre>
  
  <p>Thanks for reading. Any help is appreciated.</p>