Skip to content

Commit

Permalink
[Enhancement] Set python3 as the default python version when compiling (
Browse files Browse the repository at this point in the history
#48586)

Signed-off-by: Dejun Xia <[email protected]>
  • Loading branch information
nshangyiming authored Jul 19, 2024
1 parent 8fc6720 commit 2746fdd
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,25 @@ 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`)/..
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
Expand Down

0 comments on commit 2746fdd

Please sign in to comment.