Skip to content

Commit

Permalink
OpenMP fix for mac?
Browse files Browse the repository at this point in the history
  • Loading branch information
kpu committed Oct 1, 2020
1 parent b63a09c commit f214294
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lm/interpolate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ if(ENABLE_INTERPOLATE)
tune_weights.cc
universal_vocab.cc)

add_library(kenlm_interpolate ${KENLM_INTERPOLATE_SOURCE})
target_link_libraries(kenlm_interpolate PUBLIC kenlm Eigen3::Eigen)

find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
else()
message(STATUS "OpenMP support would be nice for parallelizing matrix operations.")
if (OPENMP_CXX_FOUND)
target_link_libraries(kenlm_interpolate PUBLIC OpenMP::OpenMP_CXX)
endif()

add_library(kenlm_interpolate ${KENLM_INTERPOLATE_SOURCE})
target_link_libraries(kenlm_interpolate PUBLIC kenlm Eigen3::Eigen)

set(KENLM_INTERPOLATE_EXES
interpolate
Expand Down

0 comments on commit f214294

Please sign in to comment.