Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only check the gcc version ceiling when it is on linux #991

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Only check the gcc version ceiling when it is on linux
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
  • Loading branch information
peterzhuamazon committed Jul 14, 2023
commit 53b19989df72b904518cf29a1fbd4cecaf62dfbd
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use "$PLATFORM" from top instead ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is temp code specifically for centos7 before we move to rockylinux8.
Both the x64 and the arm64 centos7 image is built based on the same dockerfile thus have same gcc version.
As long as linux is specifically locked to version above 4.9 and lower than 8 we are good.

echo "gcc version on this env is newer than $GCC_REQUIRED_VERSION_CEILING, exit 1"
exit 1
fi
Expand Down