From 0a3504c30a005c53e4f0cb6c8fa608482b90f0e9 Mon Sep 17 00:00:00 2001 From: Koen Schmeets Date: Wed, 18 Aug 2021 12:19:02 +0200 Subject: [PATCH] CI, NFC: Update libomp installation approach on macOS in the GitHub action (#1094) --- .github/scripts/build-macos.sh | 4 ++-- .github/scripts/install-macos.sh | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/scripts/build-macos.sh b/.github/scripts/build-macos.sh index fae7e27f..3394a8af 100755 --- a/.github/scripts/build-macos.sh +++ b/.github/scripts/build-macos.sh @@ -14,13 +14,13 @@ CMAKE_GENERATOR="Unix Makefiles" CMAKE_PREFIX_PATH="" if [ "$2" = "arm64" ]; then OSX_ARCHITECTURE="arm64" - CMAKE_PREFIX_PATH="/tmp/libomp-arm64/libomp/11.0.1" + CMAKE_PREFIX_PATH=$(find /tmp/libomp-arm64/libomp -depth 1) git apply cmake/libpng-macos-arm64.patch || echo "Could not apply patch, probably already patched..." mkdir build-arm64 || true cd build-arm64 elif [ "$2" = "x86_64" ]; then OSX_ARCHITECTURE="x86_64" - CMAKE_PREFIX_PATH="/tmp/libomp-x86_64/libomp/11.0.1" + CMAKE_PREFIX_PATH=$(find /tmp/libomp-x86_64/libomp -depth 1) mkdir build || true cd build else diff --git a/.github/scripts/install-macos.sh b/.github/scripts/install-macos.sh index c6ec104d..be4b13ac 100755 --- a/.github/scripts/install-macos.sh +++ b/.github/scripts/install-macos.sh @@ -1,10 +1,12 @@ #!/bin/sh -xe if [ "$1" = "ci" ]; then - curl -L https://bintray.com/homebrew/bottles/download_file?file_path=libomp-11.0.1.arm64_big_sur.bottle.tar.gz --output /tmp/libomp-arm64.tar.gz + armloc=$(brew fetch --bottle-tag=arm64_big_sur libomp | grep -i downloaded | grep tar.gz | cut -f2 -d:) + x64loc=$(brew fetch --bottle-tag=big_sur libomp | grep -i downloaded | grep tar.gz | cut -f2 -d:) + cp $armloc /tmp/libomp-arm64.tar.gz mkdir /tmp/libomp-arm64 || true tar -xzvf /tmp/libomp-arm64.tar.gz -C /tmp/libomp-arm64 - curl -L https://bintray.com/homebrew/bottles/download_file?file_path=libomp-11.0.1.big_sur.bottle.tar.gz --output /tmp/libomp-x86_64.tar.gz + cp $x64loc /tmp/libomp-x86_64.tar.gz mkdir /tmp/libomp-x86_64 || true tar -xzvf /tmp/libomp-x86_64.tar.gz -C /tmp/libomp-x86_64 else