aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-06-07 11:34:47 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-06-07 11:40:03 -0700
commitabe0877ef1abfbd678ba05f195c553303cc8263c (patch)
treee9f5f7592a3fde5d9820ec440c6370f15399a1b9 /configure
parentb702e7e79d4cf2abb87146d6593e3d3ee3c2bba7 (diff)
Add bazel version check to .configure
PiperOrigin-RevId: 158294569
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure18
1 files changed, 18 insertions, 0 deletions
diff --git a/configure b/configure
index 472f099796..71c14345f5 100755
--- a/configure
+++ b/configure
@@ -3,6 +3,8 @@
set -e
set -o pipefail
+MIN_BAZEL_VERSION=0.4.5
+
# Find out the absolute path to where ./configure resides
pushd `dirname $0` > /dev/null
SOURCE_BASE_DIR=`pwd -P`
@@ -163,6 +165,22 @@ function setup_python {
echo "export PYTHON_BIN_PATH=\"$PYTHON_BIN_PATH\"" > tools/python_bin_path.sh
}
+function version {
+ echo "$@" | awk -F. '{ printf("%03d%03d%03d\n", $1,$2,$3); }';
+}
+
+
+bazel version > bazel.version
+curr_bazel_version=$(head -n 1 bazel.version | cut -d ' ' -f3)
+rm -f bazel.version
+
+echo "You have bazel $curr_bazel_version installed."
+if [ "$(version "$MIN_BAZEL_VERSION")" -gt "$(version "$curr_bazel_version")" ]; then
+ echo "Please upgrade your bazel installation to version $MIN_BAZEL_VERSION or higher to build TensorFlow!"
+ echo "Exiting..."
+ exit 1
+fi
+
# This file contains customized config settings.
rm -f .tf_configure.bazelrc
touch .tf_configure.bazelrc