From 10a6f0ad3d91764ab280e032409dc95fa149c025 Mon Sep 17 00:00:00 2001 From: Naveen Tatikonda Date: Sat, 25 Jan 2025 13:42:37 -0600 Subject: [PATCH] Update GCC required version Signed-off-by: Naveen Tatikonda --- scripts/build.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index c0ad56b30..656915832 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -112,7 +112,13 @@ fi # https://github.com/opensearch-project/k-NN/issues/1138 # https://github.com/opensearch-project/opensearch-build/issues/4386 GCC_VERSION=`gcc --version | head -n 1 | cut -d ' ' -f3` -GCC_REQUIRED_VERSION=12.4 +if [ "$ARCHITECTURE" = "x64" ]; then + # https://github.com/opensearch-project/opensearch-build/issues/5226 + # We need gcc version >=12.4 to build Faiss Sapphire library(avx512_spr) + GCC_REQUIRED_VERSION=12.4 +else + GCC_REQUIRED_VERSION=9.0.0 +fi COMPARE_VERSION=`echo $GCC_REQUIRED_VERSION $GCC_VERSION | tr ' ' '\n' | sort -V | uniq | head -n 1` if [ "$COMPARE_VERSION" != "$GCC_REQUIRED_VERSION" ]; then echo "gcc version on this env is older than $GCC_REQUIRED_VERSION, exit 1"