From aad1146a6ae93cf735be8a6edfa7b30857af5556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Sun, 23 Jun 2024 11:06:08 +0200 Subject: [PATCH] Refix openmp on mac --- .github/actions/deploy-macosx/action.yml | 3 ++- pytorch/cppbuild.sh | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/actions/deploy-macosx/action.yml b/.github/actions/deploy-macosx/action.yml index 3e8da39a906..cc3032ce1b7 100644 --- a/.github/actions/deploy-macosx/action.yml +++ b/.github/actions/deploy-macosx/action.yml @@ -26,7 +26,7 @@ runs: brew uninstall --force --ignore-dependencies gcc gcc@7 gcc@8 gcc@9 gcc@10 gcc@11 gcc@12 gcc@13 little-cms2 maven openblas r brew install boost ccache swig autoconf-archive automake cmake libomp libtool libusb ant nasm xz pkg-config sdl2 gpg1 bison flex perl ragel binutils gradle gmp isl libmpc mpfr geoip pcre ssdeep yajl - brew link --force libomp + brew link --force libomp -v # echo Installing an older less buggy version of CMake # curl -LO https://raw.githubusercontent.com/Homebrew/homebrew-core/30a3e5e02420a515f9bad02e3cfcde95316db529/Formula/cmake.rb @@ -111,6 +111,7 @@ runs: git --version clang --version /usr/local/bin/gcc-* --version || true + which cmake cmake --version gradle --version mvn -version diff --git a/pytorch/cppbuild.sh b/pytorch/cppbuild.sh index 9d2058219a6..33f858e043c 100755 --- a/pytorch/cppbuild.sh +++ b/pytorch/cppbuild.sh @@ -211,10 +211,10 @@ sedinplace 's/const std::string& interface)/const std::string\& interface_name)/ # and see if choosing experimental works. See Issue #1503. # On Linux, pytorch FindOpenMP.cmake picks llvm libomp over libgomp. See Issue #1504. # Keep it on MacOS since it appends the correct -Xpreprocessor -fopenmp -I/usr/local/include flags -if [[ ! $PLATFORM == macosx-* ]]; then +#if [[ ! $PLATFORM == macosx-* ]]; then rm cmake/Modules/FindOpenMP.cmake sedinplace 's/include(${CMAKE_CURRENT_LIST_DIR}\/Modules\/FindOpenMP.cmake)/find_package(OpenMP)/g' cmake/Dependencies.cmake -fi +#fi #USE_FBGEMM=0 USE_KINETO=0 USE_GLOO=0 USE_MKLDNN=0 \ "$PYTHON_BIN_PATH" setup.py build