mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
call find_package(OpenMP) only when USE_OPENMP=ON (#30223)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/30223 I ran into find_package(OpenMP) failure in some linux environment when USE_OPENMP=OFF. Figured this workaround to unblock - not sure how hard to find & fix the root cause of find_package() failure. Test: - works in my case; - will check CI; Test Plan: Imported from OSS Differential Revision: D18640309 Pulled By: ljk53 fbshipit-source-id: b5b30623f5da4edbe59574a8b35286b74c3225d3
This commit is contained in:
committed by
Facebook Github Bot
parent
7d3afc4186
commit
d934cf484b
@ -821,7 +821,9 @@ if (NOT NO_API)
|
||||
endif()
|
||||
|
||||
|
||||
find_package(OpenMP QUIET)
|
||||
if(USE_OPENMP)
|
||||
find_package(OpenMP QUIET)
|
||||
endif()
|
||||
if(USE_OPENMP AND OPENMP_FOUND)
|
||||
message(STATUS "pytorch is compiling with OpenMP. \n"
|
||||
"OpenMP CXX_FLAGS: ${OpenMP_CXX_FLAGS}. \n"
|
||||
|
Reference in New Issue
Block a user