From 591fff664e7ea4068acdcac5d4dd21cd428d2931 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 13 Jul 2023 19:57:14 -0700 Subject: [PATCH] Only check the gcc version ceiling when it is on linux (#991) (#993) Signed-off-by: Peter Zhu (cherry picked from commit 08014080f62f06c2662e8353cd778d0d369c81d7) Co-authored-by: Peter Zhu --- scripts/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index a7f8e356a..930f0b602 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -110,7 +110,7 @@ fi GCC_VERSION=`gcc --version | head -n 1 | cut -d ' ' -f3` GCC_REQUIRED_VERSION=4.9.0 COMPARE_VERSION=`echo $GCC_REQUIRED_VERSION $GCC_VERSION | tr ' ' '\n' | sort -V | uniq | head -n 1` -if [ ! "$COMPARE_VERSION" = "$GCC_REQUIRED_VERSION" ]; then +if [ "$COMPARE_VERSION" != "$GCC_REQUIRED_VERSION" ]; then echo "gcc version on this env is older than $GCC_REQUIRED_VERSION, exit 1" exit 1 fi @@ -119,7 +119,7 @@ fi # https://github.com/opensearch-project/k-NN/issues/975 GCC_REQUIRED_VERSION_CEILING=8.0.0 COMPARE_VERSION_CEILING=`echo $GCC_REQUIRED_VERSION_CEILING $GCC_VERSION | tr ' ' '\n' | sort -V | uniq | tail -n 1` -if [ ! "$COMPARE_VERSION_CEILING" = "$GCC_REQUIRED_VERSION_CEILING" ]; then +if [ "$COMPARE_VERSION_CEILING" != "$GCC_REQUIRED_VERSION_CEILING" ] && (echo "$OSTYPE" | grep -i linux); then echo "gcc version on this env is newer than $GCC_REQUIRED_VERSION_CEILING, exit 1" exit 1 fi