Put back linker flag for OpenMP to prevent build break on ppc64le (#14569)

Summary:
See #14539
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14569

Differential Revision: D13282161

Pulled By: ezyang

fbshipit-source-id: 13a1131b26fa300b037f66d1919b97d14033f9e5
This commit is contained in:
Freddie Mendoza 2018-11-30 14:04:45 -08:00 committed by Facebook Github Bot
parent 5c1692840e
commit a84e873bb1

View File

@ -334,6 +334,7 @@ if(OPENMP_FOUND)
message(STATUS "Compiling with OpenMP")
endif()
target_compile_options(torch INTERFACE ${OpenMP_CXX_FLAGS})
target_link_libraries(torch -fopenmp)
#cmake only check for separate OpenMP library on AppleClang 7+
#https://github.com/Kitware/CMake/blob/42212f7539040139ecec092547b7d58ef12a4d72/Modules/FindOpenMP.cmake#L252
if (CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")