<p>In <a href="https://github.com/mlpack/mlpack/pull/700#discussion_r69315758">CMakeLists.txt</a>:</p>
<pre style='color:#555'>&gt; +# This way we can skip calls to functions defined in omp.h with code like:
&gt; +# if(HAS_OPENMP) {omp related stuff}
&gt; +if (HAS_OPENMP)
&gt; +  add_definitions(-DHAS_OPENMP)
&gt; +  find_package(OpenMP)
&gt; +  if (OPENMP_FOUND)
&gt; +    set(HAS_OPENMP &quot;1&quot;)
&gt; +    set(CMAKE_C_FLAGS &quot;${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}&quot;)
&gt; +    set(CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}&quot;)
&gt; +  else ()
&gt; +    set(HAS_OPENMP &quot;0&quot;)
&gt; +    set(CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas&quot;)
&gt; +  endif ()
&gt; +else ()
&gt; +    set(CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas&quot;)
&gt; +endif()
</pre>
<p>I added HAS_OPENMP for two reasons:</p>

<ul>
<li>debugging without using a different compiler. This way I can know that a test passes both with openMP on and off.</li>
<li>so a user can maually "forbid" mlpack from using any openMP code, even if openMP is found on their system. I don't know why anybody would want this.</li>
</ul>

<p>The flag is on by default, so it shouldn't bother users that don't want to mess with it.</p>

<p>It can definately be changed, I just had so much trouble making the build pass in AppVeyor that I went all out.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/700/files/3af80c339a7a846bb3bdf305131c87eaa939fc01#r69315758">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFFCd0GiFjV5j84XoI5dZXSbe0JOyks5qRTDBgaJpZM4I5KSz">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFCudvQMW2WJ5Wb7mydfjHFRMo8vMks5qRTDBgaJpZM4I5KSz.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/pull/700/files/3af80c339a7a846bb3bdf305131c87eaa939fc01#r69315758"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>