Skip to content

Commit

Permalink
feat(scripts): check version of the compilation tools before build(#1295
Browse files Browse the repository at this point in the history
)
  • Loading branch information
davidshiz authored and mergify[bot] committed Feb 27, 2023
1 parent 7fdeec2 commit e160cfa
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions scripts/stonedb_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

set -e

# Specify the required version numbers
required_gcc_version='9.3.0'
required_make_version='3.8.2'
required_cmake_version='3.7.2'

# Check GCC version
gcc_version=$(gcc -v 2>&1 > /dev/null | grep 'gcc version' | awk '{print $3}')
if [ $required_gcc_version != $(printf "$required_gcc_version\n$gcc_version\n" | sort -V | head -1) ]; then
echo "Error: the GCC version num is less than the version 9.3.0"
exit 1
fi

# Check make version
make_version=$(make --version | grep 'GNU Make' | awk '{print $3}')
if [ $required_make_version != $(printf "$required_make_version\n$make_version\n" | sort -V| head -1) ]; then
echo "Error: the make version num is less than the version 3.8.2 or 3.82"
exit 1
fi

# Check cmake version
cmake_version=$(cmake --version | grep 'cmake version' | awk '{print $3}')
if [ $required_cmake_version != $(printf "$required_cmake_version\n$cmake_version\n" | sort -V| head -1) ]; then
echo "Error: the cmake version num is less than the version 3.7.2"
exit 1
fi

# step 1. create dir: build
if [ ! -d ../build ]
then
Expand Down

0 comments on commit e160cfa

Please sign in to comment.