Skip to content

Commit

Permalink
Only check the gcc version ceiling when it is on linux (#991) (#993)
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <[email protected]>
(cherry picked from commit 0801408)

Co-authored-by: Peter Zhu <[email protected]>
  • Loading branch information
1 parent ecec290 commit 591fff6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 591fff6

Please sign in to comment.