aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-05-15 06:12:46 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-05-15 06:16:34 -0700
commit68d198ee4999a8661a3249b15d108b08b0da8811 (patch)
tree78a6e7f3e17205e600e18d04ceb335790ca01e35
parent2b90ef158b9dd07b71453f3254a6a8a16501cdfa (diff)
Fixing issue with cuda configuration when cuda symlinked directories have a single file
PiperOrigin-RevId: 156046172
-rw-r--r--third_party/gpus/cuda_configure.bzl6
1 files changed, 4 insertions, 2 deletions
diff --git a/third_party/gpus/cuda_configure.bzl b/third_party/gpus/cuda_configure.bzl
index 0fef94cf9c..6994db0a04 100644
--- a/third_party/gpus/cuda_configure.bzl
+++ b/third_party/gpus/cuda_configure.bzl
@@ -785,8 +785,10 @@ def _symlink_genrule_for_dir(repository_ctx, src_dir, dest_dir, genrule_name,
outs = []
for i in range(len(dest_files)):
if dest_files[i] != "":
- command.append('ln -s ' + src_files[i] + ' $(@D)/' +
- dest_dir + dest_files[i])
+ # If we have only one file to link we do not want to use the dest_dir, as
+ # $(@D) will include the full path to the file.
+ dest = ' $(@D)/' + dest_dir + dest_files[i] if len(dest_files) != 1 else ' $(@D)' + dest_files[i]
+ command.append('ln -s ' + src_files[i] + dest)
outs.append(' "' + dest_dir + dest_files[i] + '",')
genrule = _genrule(src_dir, genrule_name, " && ".join(command),
"\n".join(outs))