FreeBSD Bugzilla – Attachment 202786 Details for
Bug 223678
devel/cmake: find_package(OpenMP) doesn't find the openmp package (when base clang compiler is used)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Diff from installed FindOpenMP
FindOpenMP.diff (text/plain), 3.93 KB, created by
Adriaan de Groot
on 2019-03-10 23:07:55 UTC
(
hide
)
Description:
Diff from installed FindOpenMP
Filename:
MIME Type:
Creator:
Adriaan de Groot
Created:
2019-03-10 23:07:55 UTC
Size:
3.93 KB
patch
obsolete
>--- /usr/local/share/cmake/Modules/FindOpenMP.cmake 2019-02-17 20:54:40.000000000 +0100 >+++ /tmp/FindOpenMP.cmake 2019-03-11 00:06:09.212644000 +0100 >@@ -81,6 +81,31 @@ > > set(OpenMP_pthread_LIBRARY -lpthread) > >+# If the compiler itself has support for OpenMP, then omp.h is hidden >+# away somewhere and it won't be found here; but if the support comes >+# from an external package, it needs to have the right -I and -L flags. >+find_file(_path_to_omp_h omp.h) >+if(NOT _path_to_omp_h) >+ find_file(_path_to_omp_h omp.h >+ HINTS $ENV{LOCALBASE}/include /usr/local/include) >+endif() >+if(_path_to_omp_h) >+ get_filename_component(OpenMP_INCLUDE_DIR ${_path_to_omp_h} DIRECTORY) >+else() >+ set(OpenMP_INCLUDE_DIR "omp_h-NOTFOUND") >+endif() >+ >+find_library(_path_to_omp_lib omp) >+if(NOT _path_to_omp_lib) >+ find_library(_path_to_omp_lib omp >+ PATHS $ENV{LOCALBASE}/lib /usr/local/lib) >+endif() >+if(_path_to_omp_lib) >+ get_filename_component(OpenMP_LIB_DIR ${_path_to_omp_lib} DIRECTORY) >+else() >+ set(OpenMP_LIB_DIR "omp_lib-NOTFOUND") >+endif() >+ > function(_OPENMP_FLAG_CANDIDATES LANG) > if(NOT OpenMP_${LANG}_FLAG) > unset(OpenMP_FLAG_CANDIDATES) >@@ -186,6 +211,15 @@ > if(OpenMP_VERBOSE_COMPILE_OPTIONS) > string(APPEND OPENMP_FLAGS_TEST " ${OpenMP_VERBOSE_COMPILE_OPTIONS}") > endif() >+ set(_extra_flag "") >+ if(OpenMP_INCLUDE_DIR) >+ string(APPEND _extra_flag " -I${OpenMP_INCLUDE_DIR}") >+ endif() >+ if(OpenMP_LIB_DIR) >+ string(APPEND _extra_flag " -L${OpenMP_LIB_DIR}") >+ endif() >+ set(_need_extra FALSE) >+ > string(REGEX REPLACE "[-/=+]" "" OPENMP_PLAIN_FLAG "${OPENMP_FLAG}") > try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG} ${CMAKE_BINARY_DIR} ${_OPENMP_TEST_SRC} > CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OPENMP_FLAGS_TEST}" >@@ -193,8 +227,23 @@ > OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT > ) > >+ # Might need that -I -L after all.. >+ if(NOT OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG}) >+ unset(OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG}) >+ try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG} ${CMAKE_BINARY_DIR} ${_OPENMP_TEST_SRC} >+ CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OPENMP_FLAGS_TEST} ${_extra_flag}" >+ LINK_LIBRARIES ${CMAKE_${LANG}_VERBOSE_FLAG} >+ OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT >+ ) >+ set(_need_extra TRUE) >+ endif() >+ > if(OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG}) >- set("${OPENMP_FLAG_VAR}" "${OPENMP_FLAG}" PARENT_SCOPE) >+ if(_need_extra) >+ set("${OPENMP_FLAG_VAR}" "${OPENMP_FLAG} ${_extra_flag}" PARENT_SCOPE) >+ else() >+ set("${OPENMP_FLAG_VAR}" "${OPENMP_FLAG}" PARENT_SCOPE) >+ endif() > > if(CMAKE_${LANG}_VERBOSE_FLAG) > unset(OpenMP_${LANG}_IMPLICIT_LIBRARIES) >@@ -492,9 +541,16 @@ > add_library(OpenMP::OpenMP_${LANG} INTERFACE IMPORTED) > endif() > if(OpenMP_${LANG}_FLAGS) >- separate_arguments(_OpenMP_${LANG}_OPTIONS NATIVE_COMMAND "${OpenMP_${LANG}_FLAGS}") >+ # All the options except -L.. >+ separate_arguments(_OpenMP_${LANG}_COMPILE_OPTIONS NATIVE_COMMAND "${OpenMP_${LANG}_FLAGS}") >+ list(FILTER _OpenMP_${LANG}_COMPILE_OPTIONS EXCLUDE REGEX "^-L/") >+ # All the options except -I.. >+ separate_arguments(_OpenMP_${LANG}_LINK_OPTIONS NATIVE_COMMAND "${OpenMP_${LANG}_FLAGS}") >+ list(FILTER _OpenMP_${LANG}_LINK_OPTIONS EXCLUDE REGEX "^-I/") > set_property(TARGET OpenMP::OpenMP_${LANG} PROPERTY >- INTERFACE_COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:${LANG}>:${_OpenMP_${LANG}_OPTIONS}>") >+ INTERFACE_COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:${LANG}>:${_OpenMP_${LANG}_COMPILE_OPTIONS}>") >+ set_property(TARGET OpenMP::OpenMP_${LANG} PROPERTY >+ INTERFACE_LINK_OPTIONS "$<$<COMPILE_LANGUAGE:${LANG}>:${_OpenMP_${LANG}_LINK_OPTIONS}>") > unset(_OpenMP_${LANG}_OPTIONS) > endif() > if(OpenMP_${LANG}_LIBRARIES)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 223678
:
202773
|
202774
|
202785
| 202786