Skip to content

Commit

Permalink
Remove k-NN gcc requirements ceiling and not equals 8.3.1 version (#1027
Browse files Browse the repository at this point in the history
)

Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon authored Aug 3, 2023
1 parent 478d87c commit 0d97aba
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,16 @@ if [ "$JAVA_HOME" = "" ]; then
echo "SET JAVA_HOME=$JAVA_HOME"
fi

# Ensure gcc version is above 4.9.0 for faiss 1.7.4+ compilation
# Ensure gcc version is above 4.9.0 and is not 8.3.1 for faiss 1.7.4+ compilation
# https://github.com/opensearch-project/k-NN/issues/975
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
echo "gcc version on this env is older than $GCC_REQUIRED_VERSION, exit 1"
if [ "$COMPARE_VERSION" != "$GCC_REQUIRED_VERSION" ] || [ "$GCC_VERSION" = "8.3.1" ]; then
echo "gcc version on this env is either older than $GCC_REQUIRED_VERSION, or equals 8.3.1, exit 1"
exit 1
fi

# Ensure gcc version is below 8.0.0 for faiss 1.7.4+ compilation so it will not crash on arm64 CentOS7
# 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" ] && (echo "$OSTYPE" | grep -i linux); then
echo "gcc version on this env is newer than $GCC_REQUIRED_VERSION_CEILING, exit 1"
exit 1
fi


# Build k-NN lib and plugin through gradle tasks
cd $work_dir
# Gradle build is used here to replace gradle assemble due to build will also call cmake and make before generating jars
Expand Down

0 comments on commit 0d97aba

Please sign in to comment.