diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-12-22 03:07:51 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-12-22 03:11:39 -0800 |
commit | fd29e9534f8fbaee00b233b0183320d58f26f3d7 (patch) | |
tree | 3c179e1c4eec8f8b1a03952f82791c2f0f8a946b /configure.py | |
parent | 531bf79775188a34c8ca5c427a554620a837847c (diff) |
Added an option to download a fresh release of clang for doing cuda_clang builds.
Tested only on Linux, but should also work for Mac.
No support for Windows is available yet.
PiperOrigin-RevId: 179910980
Diffstat (limited to 'configure.py')
-rw-r--r-- | configure.py | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/configure.py b/configure.py index 336559532d..073bccad2b 100644 --- a/configure.py +++ b/configure.py @@ -518,6 +518,21 @@ def set_tf_cuda_clang(environ_cp): no_reply=no_reply) +def set_tf_download_clang(environ_cp): + """Set TF_DOWNLOAD_CLANG action_env.""" + question = 'Do you want to download a fresh release of clang? (Experimental)' + yes_reply = 'Clang will be downloaded and used to compile tensorflow.' + no_reply = 'Clang will not be downloaded.' + set_action_env_var( + environ_cp, + 'TF_DOWNLOAD_CLANG', + None, + False, + question=question, + yes_reply=yes_reply, + no_reply=no_reply) + + def get_from_env_or_user_or_default(environ_cp, var_name, ask_for_var, var_default): """Get var_name either from env, or user or default. @@ -1301,8 +1316,19 @@ def main(): set_tf_cuda_clang(environ_cp) if environ_cp.get('TF_CUDA_CLANG') == '1': - # Set up which clang we should use as the cuda / host compiler. - set_clang_cuda_compiler_path(environ_cp) + if not is_windows(): + # Ask if we want to download clang release while building. + set_tf_download_clang(environ_cp) + else: + # We use bazel's generated crosstool on Windows and there is no + # way to provide downloaded toolchain for that yet. + # TODO(ibiryukov): Investigate using clang as a cuda compiler on + # Windows. + environ_cp['TF_DOWNLOAD_CLANG'] = '0' + + if environ_cp.get('TF_DOWNLOAD_CLANG') != '1': + # Set up which clang we should use as the cuda / host compiler. + set_clang_cuda_compiler_path(environ_cp) else: # Set up which gcc nvcc should use as the host compiler # No need to set this on Windows |