tensorflow: If TMP is not set, then the build system defaults to the wrong path

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): CentOS Linux release 7.3.1611 (Core)
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: no
  • TensorFlow installed from (source or binary): source
  • TensorFlow version: v2.2.0
  • Python version: 3.5.1
  • Installed using virtualenv? pip? conda?: no, compiling from source
  • Bazel version (if compiling from source): 2.0.0 (it claimed that Tensorflow did not support anything higher)
  • GCC/Compiler version (if compiling from source): 8.2.0
  • CUDA/cuDNN version: 10.1
  • GPU model and memory: Tesla P100, 16280MiB

Describe the problem

Provide the exact sequence of commands / steps that you executed before running into the problem When building Tensorflow from source when the TMP environment variable is not set, then following warning is shown:

Auto-Configuration Warning: 'TMP' environment variable is not set, using 'C:\Windows\Temp' as default

Naturally, I would expect it to default to something. However, I’m on a Linux computer, not a Windows computer. On Linux, it should default to something sensible (e.g. /tmp, or the current directory), instead of C:\Windows\Temp - which clearly isn’t going to work - as on Linux this is not a valid file/directory path.

Any other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

Auto-Configuration Warning: 'TMP' environment variable is not set, using 'C:\Windows\Temp' as default

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 38 (7 by maintainers)

Most upvoted comments

Hi @sbrl ! We are checking to see whether you still need help in this issue .

I was able to build from source earlier with above commands. Can you check the build from source instruction within <2.11 .

Just FYI! From 2.11 version onwards, Windows binary wheels will be maintained by Microsoft and can be installed Tensorflow- DirectML plugin.

Thank you!

@sbrl sorry, the WAI comment was for a(n offtopic) comment that got deleted, not for the entire issue

Oh, ok. I’ve opened https://github.com/bazelbuild/bazel/issues/11650.

Fair warning: I’ve never used Bazel before, so I’m seriously out of my depth with that bug report I’ve made against Bazel itself.

@samcom12 note that this issue only results in a warning, the build succeeds. So it is likely your issue is different.

To set the environment variable you have to use export or similar constructs for your shell.

blaze build //.../build_pip_package only builds a binary that will then be used to build the actual wheel. This is WAI.

It’s interesting that the if not is_windows(...) lines above that check don’t get triggered.

https://github.com/tensorflow/tensorflow/blob/62b6c316d2a9a1fb06aefb086856e76241280c08/third_party/gpus/cuda_configure.bzl#L140-L150

I’ll have to debug. You are able to get a successful build, despite this warning, right?

I am facing the same problem, I got a successful build but could not find my .whl file in /tmp directory of ubuntu

Ah, of course! I forgot about that. Indeed, you do get a successful build when TMP is not set. I just thought I’d report it here because it looked like a bug.

Hey there, @mihaimaruseac! I can get a successful build if I specify the TMP environment variable, but I haven’t tried to see what happens if I leave it blank.

Sorry about taking so long to reply again… these times are very busy 😕

Update, @mihaimaruseac @Saduf2019:

The people over at Bazel in the issue referenced above say it’s not a bug in bazel. Here’s a quote:

This is not a bug in Bazel. The warning was thrown because TensorFlow was trying to generate a C++ cuda toolchain for Windows on Linux. See here

The Windows C++ cuda toolchain is not actually used on Linux, but TF implemented the auto configuration in a way that will run on all platform. That’s why you still got a successful build with this warning.

Link to comment: https://github.com/bazelbuild/bazel/issues/11650#issuecomment-652856805

So I guess this issue being opened is still relevant.

Ok, so I’ve re-run the build with the settings described above, and here’s the log.txt file:

log.txt

(this is with cache, as I accidentally ran bazel build --config=opt --config=monolithic //tensorflow/tools/lib_package:libtensorflow | tee ../log.txt with a missing 2>&1 there)