Skip to content

Commit ab4c889

Browse files
authored
Merge pull request #235602 from Homebrew/pytorch-updates
pytorch: avoid embedding a copy of libomp
2 parents 9d95e0b + 3d44525 commit ab4c889

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Formula/p/pytorch.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,15 @@ def install
104104
# Avoid building AVX512 code
105105
inreplace "cmake/Modules/FindAVX.cmake", /^CHECK_SSE\(CXX "AVX512"/, "#\\0"
106106

107+
# Avoid bundling libomp
108+
inreplace "setup.py", /^(\s*)self\._embed_libomp\(\)$/, "\\1pass"
109+
107110
ENV["ATEN_NO_TEST"] = "ON"
108111
ENV["BLAS"] = "OpenBLAS"
109112
ENV["BUILD_CUSTOM_PROTOBUF"] = "OFF"
110113
ENV["BUILD_PYTHON"] = "ON"
111114
ENV["BUILD_TEST"] = "OFF"
115+
ENV["OpenBLAS_HOME"] = Formula["openblas"].opt_prefix
112116
ENV["PYTHON_EXECUTABLE"] = which(python3)
113117
ENV["PYTORCH_BUILD_VERSION"] = version.to_s
114118
ENV["PYTORCH_BUILD_NUMBER"] = "1"

0 commit comments

Comments
 (0)