Skip to content

Commit 28416ae

Browse files
dbabokinrengolin
authored andcommitted
Handle OpenMP libraries in portable way (issue #959)
1 parent 0d504c7 commit 28416ae

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

cmake/modules/xsmm-dnn.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ target_include_directories(xsmm_dnn_mlp PRIVATE ${XSMM_DNN_INCLUDE_DIRS})
4646
target_link_libraries(xsmm_dnn_mlp PRIVATE xsmm)
4747
if (OPENMP_FOUND)
4848
target_compile_options(xsmm_dnn_mlp PRIVATE ${OpenMP_C_FLAGS})
49-
target_link_libraries(xsmm_dnn_mlp PRIVATE omp)
49+
target_link_libraries(xsmm_dnn_mlp PRIVATE OpenMP::OpenMP_C)
5050
endif()
5151
install(TARGETS xsmm_dnn_mlp RUNTIME DESTINATION bin)

tools/tpp-run/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ if(USE_OneDNN)
99
set(ONEDNN_LIBS_INCL "-ltpp_dnnl_runner_utils")
1010
endif()
1111

12-
if(USE_OpenMP)
13-
set(OPENMP_LIBS_INCL "-lomp")
14-
endif()
15-
1612
set(LIBS
1713
${dialect_libs}
1814
${conversion_libs}
@@ -81,7 +77,7 @@ target_link_options(tpp-run PRIVATE
8177
-lmlir_runner_utils
8278
-lmlir_async_runtime
8379
${TPP_GPU_LINK_FLAGS}
84-
${OPENMP_LIBS_INCL}
80+
$<$<BOOL:${USE_OpenMP}>:${OpenMP_C_LIBRARIES}>
8581
-Wl,--as-needed
8682
)
8783

0 commit comments

Comments
 (0)