diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-05-15 06:12:46 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-05-15 06:16:34 -0700 |
commit | 68d198ee4999a8661a3249b15d108b08b0da8811 (patch) | |
tree | 78a6e7f3e17205e600e18d04ceb335790ca01e35 | |
parent | 2b90ef158b9dd07b71453f3254a6a8a16501cdfa (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.bzl | 6 |
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)) |