diff options
Diffstat (limited to 'cmake/FindMKL.cmake')
-rw-r--r-- | cmake/FindMKL.cmake | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/cmake/FindMKL.cmake b/cmake/FindMKL.cmake index 4e8a99ee..be5e0106 100644 --- a/cmake/FindMKL.cmake +++ b/cmake/FindMKL.cmake @@ -89,10 +89,17 @@ find_library(MKL_CORE_LIBRARY NO_DEFAULT_PATH) set(MKL_INCLUDE_DIRS ${MKL_INCLUDE_DIR}) -# Added -Wl block to avoid circular dependencies. -# https://stackoverflow.com/questions/5651869/what-are-the-start-group-and-end-group-command-line-options -# https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor -set(MKL_LIBRARIES -Wl,--start-group ${MKL_INTERFACE_LIBRARY} ${MKL_SEQUENTIAL_LAYER_LIBRARY} ${MKL_CORE_LIBRARY} -Wl,--end-group) +set(MKL_LIBRARIES ${MKL_INTERFACE_LIBRARY} ${MKL_SEQUENTIAL_LAYER_LIBRARY} ${MKL_CORE_LIBRARY}) + +if(NOT WIN32 AND NOT APPLE) + # Added -Wl block to avoid circular dependencies. + # https://stackoverflow.com/questions/5651869/what-are-the-start-group-and-end-group-command-line-options + # https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor + set(MKL_LIBRARIES -Wl,--start-group ${MKL_LIBRARIES} -Wl,--end-group) +elseif(APPLE) + # MacOS does not support --start-group and --end-group + set(MKL_LIBRARIES -Wl,${MKL_LIBRARIES} -Wl,) +endif() # message("1 ${MKL_INCLUDE_DIR}") # message("2 ${MKL_INTERFACE_LIBRARY}") @@ -130,4 +137,4 @@ endif() INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(MKL DEFAULT_MSG MKL_LIBRARIES MKL_INCLUDE_DIRS MKL_INTERFACE_LIBRARY MKL_SEQUENTIAL_LAYER_LIBRARY MKL_CORE_LIBRARY) -MARK_AS_ADVANCED(MKL_INCLUDE_DIRS MKL_LIBRARIES MKL_INTERFACE_LIBRARY MKL_SEQUENTIAL_LAYER_LIBRARY MKL_CORE_LIBRARY)
\ No newline at end of file +MARK_AS_ADVANCED(MKL_INCLUDE_DIRS MKL_LIBRARIES MKL_INTERFACE_LIBRARY MKL_SEQUENTIAL_LAYER_LIBRARY MKL_CORE_LIBRARY) |