aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party
diff options
context:
space:
mode:
Diffstat (limited to 'third_party')
-rw-r--r--third_party/eigen3/unsupported/Eigen/CXX11/Tensor9
-rw-r--r--third_party/gpus/cuda/BUILD.tpl6
-rw-r--r--third_party/gpus/cuda_configure.bzl15
3 files changed, 24 insertions, 6 deletions
diff --git a/third_party/eigen3/unsupported/Eigen/CXX11/Tensor b/third_party/eigen3/unsupported/Eigen/CXX11/Tensor
index 41db119921..7fafd2a538 100644
--- a/third_party/eigen3/unsupported/Eigen/CXX11/Tensor
+++ b/third_party/eigen3/unsupported/Eigen/CXX11/Tensor
@@ -1 +1,10 @@
#include "unsupported/Eigen/CXX11/Tensor"
+
+#ifdef _WIN32
+// On Windows, Eigen will include Windows.h, which defines various
+// macros that conflict with TensorFlow symbols. Undefine them here to
+// prevent clashes.
+#undef DeleteFile
+#undef ERROR
+#undef LoadLibrary
+#endif // _WIN32
diff --git a/third_party/gpus/cuda/BUILD.tpl b/third_party/gpus/cuda/BUILD.tpl
index c920d64a79..cb985c2251 100644
--- a/third_party/gpus/cuda/BUILD.tpl
+++ b/third_party/gpus/cuda/BUILD.tpl
@@ -58,10 +58,8 @@ cc_library(
linkopts = [
"-ldl",
"-lpthread",
- ] + select({
- "@//tensorflow:darwin": [],
- "//conditions:default": ["-lrt"],
- }),
+ %{cudart_static_linkopt}
+ ],
visibility = ["//visibility:public"],
)
diff --git a/third_party/gpus/cuda_configure.bzl b/third_party/gpus/cuda_configure.bzl
index 31bf8cc3d8..90729463bd 100644
--- a/third_party/gpus/cuda_configure.bzl
+++ b/third_party/gpus/cuda_configure.bzl
@@ -315,6 +315,11 @@ def _find_cudnn_lib_path(repository_ctx, cudnn_install_basedir, symlink_files):
cudnn_install_basedir))
+def _cudart_static_linkopt(cpu_value):
+ """Returns additional platform-specific linkopts for cudart."""
+ return "" if cpu_value == "Darwin" else "\"-lrt\","
+
+
def _tpl(repository_ctx, tpl, substitutions={}, out=None):
if not out:
out = tpl.replace(":", "/")
@@ -364,8 +369,11 @@ def _create_dummy_repository(repository_ctx):
_DEFAULT_CUDNN_VERSION)
# Set up BUILD file for cuda/.
- _file(repository_ctx, "cuda:BUILD")
_file(repository_ctx, "cuda:build_defs.bzl")
+ _tpl(repository_ctx, "cuda:BUILD",
+ {
+ "%{cudart_static_linkopt}": _cudart_static_linkopt(cpu_value),
+ })
_tpl(repository_ctx, "cuda:platform.bzl",
{
"%{cuda_version}": _DEFAULT_CUDA_VERSION,
@@ -460,8 +468,11 @@ def _create_cuda_repository(repository_ctx):
repository_ctx.symlink(cudnn_lib_path, "cuda/" + symlink_files.cuda_dnn_lib)
# Set up BUILD file for cuda/
- _file(repository_ctx, "cuda:BUILD")
_file(repository_ctx, "cuda:build_defs.bzl")
+ _tpl(repository_ctx, "cuda:BUILD",
+ {
+ "%{cudart_static_linkopt}": _cudart_static_linkopt(cpu_value),
+ })
_tpl(repository_ctx, "cuda:platform.bzl",
{
"%{cuda_version}": cuda_version,