aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure
diff options
context:
space:
mode:
authorGravatar Patrick Nguyen <drpng@google.com>2016-10-20 12:09:18 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-10-20 13:19:03 -0700
commitc5ab3dd177dc16bb211821e38219f350a613b5e8 (patch)
tree69f38f2790f85f31dae60b6b7c6b136b3b380daa /configure
parent8532897352ada1d8ecd3ca1dd17aaa869a42d4b8 (diff)
Merge changes from github.
Change: 136750267
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure34
1 files changed, 29 insertions, 5 deletions
diff --git a/configure b/configure
index 8bc271aaf3..8f0a77dcae 100755
--- a/configure
+++ b/configure
@@ -8,8 +8,22 @@ pushd `dirname $0` #> /dev/null
SOURCE_BASE_DIR=`pwd -P`
popd > /dev/null
+PLATFORM="$(uname -s | tr 'A-Z' 'a-z')"
+function is_windows() {
+ # On windows, the shell script is actually running in msys
+ if [[ "${PLATFORM}" =~ msys_nt* ]]; then
+ true
+ else
+ false
+ fi
+}
+
function bazel_clean_and_fetch() {
- bazel clean --expunge
+ # bazel clean --expunge currently doesn't work on Windows
+ # TODO(pcloudy): Re-enable it after bazel clean --expunge is fixed.
+ if ! is_windows; then
+ bazel clean --expunge
+ fi
bazel fetch //tensorflow/...
}
@@ -35,6 +49,12 @@ while true; do
# Retry
done
+if is_windows; then
+ TF_NEED_GCP=0
+ TF_NEED_HDFS=0
+ TF_NEED_CUDA=0
+fi
+
while [ "$TF_NEED_GCP" == "" ]; do
read -p "Do you wish to build TensorFlow with "\
"Google Cloud Platform support? [y/N] " INPUT
@@ -89,12 +109,16 @@ fi
## Find swig path
if [ -z "$SWIG_PATH" ]; then
- SWIG_PATH=`type -p swig 2> /dev/null`
+ SWIG_PATH=`type -p swig 2> /dev/null || true`
fi
if [[ ! -e "$SWIG_PATH" ]]; then
echo "Can't find swig. Ensure swig is in \$PATH or set \$SWIG_PATH."
exit 1
fi
+# Convert swig path to Windows style before writing into swig_path
+if is_windows; then
+ SWIG_PATH="$(cygpath -m "$SWIG_PATH")"
+fi
echo "$SWIG_PATH" > tensorflow/tools/swig/swig_path
# Invoke python_config and set up symlinks to python includes
@@ -104,7 +128,7 @@ echo "$SWIG_PATH" > tensorflow/tools/swig/swig_path
# git hash propagation
GEN_GIT_SOURCE=tensorflow/tools/git/gen_git_source.py
chmod a+x ${GEN_GIT_SOURCE}
-${PYTHON_BIN_PATH} ${GEN_GIT_SOURCE} --configure ${SOURCE_BASE_DIR}
+"${PYTHON_BIN_PATH}" ${GEN_GIT_SOURCE} --configure "${SOURCE_BASE_DIR}"
## Set up Cuda-related environment settings
@@ -255,8 +279,8 @@ while true; do
CUDA_DNN_LIB_PATH="lib64/libcudnn.so${TF_CUDNN_EXT}"
CUDA_DNN_LIB_ALT_PATH="libcudnn.so${TF_CUDNN_EXT}"
elif [ "$OSNAME" == "Darwin" ]; then
- CUDA_DNN_LIB_PATH="lib/libcudnn${TF_CUDNN_EXT}.dylib"
- CUDA_DNN_LIB_ALT_PATH="libcudnn${TF_CUDNN_EXT}.dylib"
+ CUDA_DNN_LIB_PATH="lib/libcudnn${TF_CUDNN_EXT}"
+ CUDA_DNN_LIB_ALT_PATH="libcudnn${TF_CUDNN_EXT}"
fi
if [ -e "$CUDNN_INSTALL_PATH/${CUDA_DNN_LIB_ALT_PATH}" -o -e "$CUDNN_INSTALL_PATH/${CUDA_DNN_LIB_PATH}" ]; then