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