title: Clang openMP support on Apple M1?
body: <p>I've been trying to build a library that uses openMP using clang but I get this error:</p>
  <pre><code>In file included from cafxlibrary.cpp:2:
  In file included from /opt/homebrew/Cellar/eigen/3.3.9/include/eigen3/Eigen/Dense:1:
  /opt/homebrew/Cellar/eigen/3.3.9/include/eigen3/Eigen/Core:266:10: fatal error: 'omp.h' file not found
  #include &lt;omp.h&gt;
           ^~~~~~~
  1 error generated.
  </code></pre>
  <p>Even though I have omp.h in <code>/opt/homebrew/Cellar/libomp/11.0.1/include/</code>. I've tried setting up the environment variable <code>CPLUS_INCLUDE_PATH</code> to point to <code>/opt/homebrew/Cellar/libomp/11.0.1/include/</code> but I get this error instead:</p>
  <pre><code>ld: library not found for -lomp
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  <p>The command I'm using is:</p>
  <pre><code>clang++ -dynamiclib -DNDEBUG -I/opt/homebrew/Cellar/eigen/3.3.9/include/eigen3/ -Xpreprocessor -fopenmp -o libcafx.dylib cafxlibrary.cpp -lomp -std=c++11
  </code></pre>
  <p>I've also tried without <code>-lomp</code>. I also have installed <code>llvm</code> and <code>libomp</code> using homebrew but the problem persists. I've also tried placing <code>omp.h</code> directly in <code>/opt/homebrew/Cellar/eigen/3.3.9/include/eigen3/Eigen/src/Core</code>. Any help is appreciated.</p>