<p>In <a href="https://github.com/mlpack/mlpack/pull/700#discussion_r69314164">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>Hm, so, with what you have changed here, a user must specify <code>HAS_OPENMP</code> for OpenMP to be used. With the previous code, CMake would determine whether or not OpenMP support was available, and if so, OpenMP would be enabled. I think maybe it is better to use automatic detection here instead of asking the user to specify <code>-D HAS_OPENMP</code>; what do you think?</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#r69314164">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFCUOQLCEGRoRvnL4J6mNleb-L30aks5qRS5XgaJpZM4I5KSz">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFAH8BA5100xe9pYK-GYqDW-eTVLpks5qRS5XgaJpZM4I5KSz.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#r69314164"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>