aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure
diff options
context:
space:
mode:
authorGravatar Vijay Vasudevan <vrv@google.com>2016-03-29 18:23:11 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-03-29 19:33:33 -0700
commit80a5a3e653f3b10e2680fe2ea9bc511e8801e273 (patch)
tree6d205c779cde774c46e6aa328a8f7ef0f85a1461 /configure
parente3a0d6fb61cbb1dd9864684c20e49ef3fa385bb6 (diff)
Merge changes from github.
Change: 118532471
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure42
1 files changed, 41 insertions, 1 deletions
diff --git a/configure b/configure
index 0faf61c67b..0a7d697c40 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,7 @@
#!/usr/bin/env bash
+DO_NOT_SUBMIT_WARNING="Unofficial setting. DO NOT SUBMIT!!!"
+
## Set up python-related environment settings
while true; do
fromuser=""
@@ -22,6 +24,16 @@ while true; do
# Retry
done
+## Find swig path
+if [ -z "$SWIG_PATH" ]; then
+ SWIG_PATH=`type -p swig 2> /dev/null`
+fi
+if [[ ! -e "$SWIG_PATH" ]]; then
+ echo "Can't find swig. Ensure swig is in \$PATH or set \$SWIG_PATH."
+ exit 1
+fi
+echo "$SWIG_PATH" > tensorflow/tools/swig/swig_path
+
# Invoke python_config and set up symlinks to python includes
(./util/python/python_config.sh --setup "$PYTHON_BIN_PATH";) || exit -1
@@ -42,6 +54,29 @@ if [ "$TF_NEED_CUDA" == "0" ]; then
exit
fi
+# Set up which gcc nvcc should use as the host compiler
+while true; do
+ fromuser=""
+ if [ -z "$GCC_HOST_COMPILER_PATH" ]; then
+ default_gcc_host_compiler_path=$(which gcc)
+ read -p "Please specify which gcc nvcc should use as the host compiler. [Default is $default_gcc_host_compiler_path]: " GCC_HOST_COMPILER_PATH
+ fromuser="1"
+ if [ -z "$GCC_HOST_COMPILER_PATH" ]; then
+ GCC_HOST_COMPILER_PATH=$default_gcc_host_compiler_path
+ fi
+ fi
+ if [ -e "$GCC_HOST_COMPILER_PATH" ]; then
+ break
+ fi
+ echo "Invalid gcc path. ${GCC_HOST_COMPILER_PATH} cannot be found" 1>&2
+ if [ -z "$fromuser" ]; then
+ exit 1
+ fi
+ GCC_HOST_COMPILER_PATH=""
+ # Retry
+done
+
+
# Find out where the CUDA toolkit is installed
while true; do
# Configure the Cuda SDK version to use.
@@ -136,6 +171,11 @@ TF_CUDNN_VERSION=$TF_CUDNN_EXT
EOF
+# Configure the gcc host compiler to use
+export WARNING=$DO_NOT_SUBMIT_WARNING
+perl -pi -e "s,CPU_COMPILER = \('.*'\),# \$ENV{WARNING}\nCPU_COMPILER = ('$GCC_HOST_COMPILER_PATH'),s" third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc
+perl -pi -e "s,GCC_HOST_COMPILER_PATH = \('.*'\),# \$ENV{WARNING}\nGCC_HOST_COMPILER_PATH = ('$GCC_HOST_COMPILER_PATH'),s" third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc
+
# Configure the Cuda toolkit version to work with.
perl -pi -e "s,CUDA_VERSION = \"[0-9\.]*\",CUDA_VERSION = \"$TF_CUDA_EXT\",s" tensorflow/core/platform/default/build_config.bzl
perl -pi -e "s,(GetCudaVersion.*return )\"[0-9\.]*\",\1\"$TF_CUDA_EXT\",s" tensorflow/stream_executor/dso_loader.cc
@@ -178,7 +218,7 @@ EOF
done
if [ ! -z "$TF_CUDA_COMPUTE_CAPABILITIES" ]; then
- export WARNING="Unofficial setting. DO NOT"" SUBMIT!!!"
+ export WARNING=$DO_NOT_SUBMIT_WARNING
function CudaGenCodeOpts() {
OUTPUT=""
for CAPABILITY in $@; do