[Enhancement] Set python3 as the default python version when compiling (backport #48586) (#48592)

Co-authored-by: yiming <xiadejun@starrocks.com>
This commit is contained in:
mergify[bot] 2024-07-19 11:40:47 +08:00 committed by GitHub
parent 98d83a879e
commit 015da37d14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 11 deletions

19
env.sh
View File

@ -38,20 +38,17 @@ fi
# check python
if [[ -z ${PYTHON} ]]; then
export PYTHON=python
export PYTHON=python3
fi
if ! ${PYTHON} --version; then
export PYTHON=python2.7
if ! ${PYTHON} --version; then
export PYTHON=python3
if ! ${PYTHON} --version; then
echo "Error: python is not found"
exit 1
fi
fi
if ${PYTHON} --version | grep -q '^Python 3\.'; then
echo "Found python3, version: `\${PYTHON} --version`"
else
echo "Error: python3 is needed"
exit 1
fi
# set GCC HOME
if [[ -z ${STARROCKS_GCC_HOME} ]]; then
export STARROCKS_GCC_HOME=$(dirname `which gcc`)/..
@ -59,7 +56,7 @@ fi
gcc_ver=`${STARROCKS_GCC_HOME}/bin/gcc -dumpfullversion -dumpversion`
required_ver="5.3.1"
if [[ ! "$(printf '%s\n' "$required_ver" "$gcc_ver" | sort -V | head -n1)" = "$required_ver" ]]; then
if [[ ! "$(printf '%s\n' "$required_ver" "$gcc_ver" | sort -V | head -n1)" = "$required_ver" ]]; then
echo "Error: GCC version (${gcc_ver}) must be greater than or equal to ${required_ver}"
exit 1
fi