aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party
diff options
context:
space:
mode:
authorGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-28 15:15:33 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-28 15:15:33 -0700
commitaf94082f0bb8d665cf20aaa5f86b207e176dd4e0 (patch)
tree76dbd54ec63ce9362fd5cb11413d05ca4c7acb90 /third_party
parent03bbc166c07ed9abcfabeb2ab98618b2a430d5a6 (diff)
parentb425b0ed272a28ccb6dbc3d3ab937da257b7f02d (diff)
Merge pull request #21808 from NervanaSystems:avijit/fix-license-files
PiperOrigin-RevId: 210614909
Diffstat (limited to 'third_party')
-rw-r--r--third_party/mkl/build_defs.bzl76
-rw-r--r--third_party/ngraph/ngraph.BUILD10
-rw-r--r--third_party/ngraph/ngraph_tf.BUILD10
-rw-r--r--third_party/ngraph/nlohmann_json.BUILD10
4 files changed, 37 insertions, 69 deletions
diff --git a/third_party/mkl/build_defs.bzl b/third_party/mkl/build_defs.bzl
index 06a8c3518c..b645c0fc5c 100644
--- a/third_party/mkl/build_defs.bzl
+++ b/third_party/mkl/build_defs.bzl
@@ -11,10 +11,8 @@ mkl_repository depends on the following environment variables:
* `TF_MKL_ROOT`: The root folder where a copy of libmkl is located.
"""
-
_TF_MKL_ROOT = "TF_MKL_ROOT"
-
def if_mkl(if_true, if_false = []):
"""Shorthand for select()'ing on whether we're building with MKL.
@@ -26,7 +24,7 @@ def if_mkl(if_true, if_false = []):
a select evaluating to either if_true or if_false as appropriate.
"""
return select({
- "//third_party/mkl:using_mkl": if_true,
+ str(Label("//third_party/mkl:using_mkl")): if_true,
"//conditions:default": if_false,
})
@@ -42,11 +40,10 @@ def if_mkl_ml(if_true, if_false = []):
a select evaluating to either if_true or if_false as appropriate.
"""
return select({
- "//third_party/mkl_dnn:using_mkl_dnn_only":
- if_false,
- "//third_party/mkl:using_mkl": if_true,
+ str(Label("//third_party/mkl_dnn:using_mkl_dnn_only")): if_false,
+ str(Label("//third_party/mkl:using_mkl")): if_true,
"//conditions:default": if_false,
- })
+ })
def if_mkl_ml_only(if_true, if_false = []):
"""Shorthand for select()'ing on whether we're building with MKL-ML only.
@@ -59,7 +56,7 @@ def if_mkl_ml_only(if_true, if_false = []):
a select evaluating to either if_true or if_false as appropriate.
"""
return select({
- "//third_party/mkl:using_mkl_ml_only": if_true,
+ str(Label("//third_party/mkl:using_mkl_ml_only")): if_true,
"//conditions:default": if_false,
})
@@ -76,7 +73,7 @@ def if_mkl_lnx_x64(if_true, if_false = []):
a select evaluating to either if_true or if_false as appropriate.
"""
return select({
- "//third_party/mkl:using_mkl_lnx_x64": if_true,
+ str(Label("//third_party/mkl:using_mkl_lnx_x64")): if_true,
"//conditions:default": if_false,
})
@@ -90,45 +87,40 @@ def mkl_deps():
inclusion in the deps attribute of rules.
"""
return select({
- "//third_party/mkl_dnn:using_mkl_dnn_only":
- ["@mkl_dnn"],
- "//third_party/mkl:using_mkl_ml_only":
- ["//third_party/mkl:intel_binary_blob"],
- "//third_party/mkl:using_mkl":
- [
+ str(Label("//third_party/mkl_dnn:using_mkl_dnn_only")): ["@mkl_dnn"],
+ str(Label("//third_party/mkl:using_mkl_ml_only")): ["//third_party/mkl:intel_binary_blob"],
+ str(Label("//third_party/mkl:using_mkl")): [
"//third_party/mkl:intel_binary_blob",
- "@mkl_dnn"
+ "@mkl_dnn",
],
- "//conditions:default": []
- })
+ "//conditions:default": [],
+ })
def _enable_local_mkl(repository_ctx):
- return _TF_MKL_ROOT in repository_ctx.os.environ
-
+ return _TF_MKL_ROOT in repository_ctx.os.environ
def _mkl_autoconf_impl(repository_ctx):
- """Implementation of the local_mkl_autoconf repository rule."""
-
- if _enable_local_mkl(repository_ctx):
- # Symlink lib and include local folders.
- mkl_root = repository_ctx.os.environ[_TF_MKL_ROOT]
- mkl_lib_path = "%s/lib" % mkl_root
- repository_ctx.symlink(mkl_lib_path, "lib")
- mkl_include_path = "%s/include" % mkl_root
- repository_ctx.symlink(mkl_include_path, "include")
- mkl_license_path = "%s/license.txt" % mkl_root
- repository_ctx.symlink(mkl_license_path, "license.txt")
- else:
- # setup remote mkl repository.
- repository_ctx.download_and_extract(
- repository_ctx.attr.urls,
- sha256=repository_ctx.attr.sha256,
- stripPrefix=repository_ctx.attr.strip_prefix,
- )
-
- # Also setup BUILD file.
- repository_ctx.symlink(repository_ctx.attr.build_file, "BUILD")
-
+ """Implementation of the local_mkl_autoconf repository rule."""
+
+ if _enable_local_mkl(repository_ctx):
+ # Symlink lib and include local folders.
+ mkl_root = repository_ctx.os.environ[_TF_MKL_ROOT]
+ mkl_lib_path = "%s/lib" % mkl_root
+ repository_ctx.symlink(mkl_lib_path, "lib")
+ mkl_include_path = "%s/include" % mkl_root
+ repository_ctx.symlink(mkl_include_path, "include")
+ mkl_license_path = "%s/license.txt" % mkl_root
+ repository_ctx.symlink(mkl_license_path, "license.txt")
+ else:
+ # setup remote mkl repository.
+ repository_ctx.download_and_extract(
+ repository_ctx.attr.urls,
+ sha256 = repository_ctx.attr.sha256,
+ stripPrefix = repository_ctx.attr.strip_prefix,
+ )
+
+ # Also setup BUILD file.
+ repository_ctx.symlink(repository_ctx.attr.build_file, "BUILD")
mkl_repository = repository_rule(
implementation = _mkl_autoconf_impl,
diff --git a/third_party/ngraph/ngraph.BUILD b/third_party/ngraph/ngraph.BUILD
index f73ce4f674..31aa3cee51 100644
--- a/third_party/ngraph/ngraph.BUILD
+++ b/third_party/ngraph/ngraph.BUILD
@@ -1,14 +1,6 @@
licenses(["notice"]) # 3-Clause BSD
-exports_files(["license.txt"])
-
-filegroup(
- name = "LICENSE",
- srcs = [
- "license.txt",
- ],
- visibility = ["//visibility:public"],
-)
+exports_files(["LICENSE"])
cc_library(
name = "ngraph_core",
diff --git a/third_party/ngraph/ngraph_tf.BUILD b/third_party/ngraph/ngraph_tf.BUILD
index 0c2c8a718f..4d96ccf2f2 100644
--- a/third_party/ngraph/ngraph_tf.BUILD
+++ b/third_party/ngraph/ngraph_tf.BUILD
@@ -1,14 +1,6 @@
licenses(["notice"]) # 3-Clause BSD
-exports_files(["license.txt"])
-
-filegroup(
- name = "LICENSE",
- srcs = [
- "license.txt",
- ],
- visibility = ["//visibility:public"],
-)
+exports_files(["LICENSE"])
load(
"@org_tensorflow//tensorflow:tensorflow.bzl",
diff --git a/third_party/ngraph/nlohmann_json.BUILD b/third_party/ngraph/nlohmann_json.BUILD
index a0b18a51cb..04c8db6a96 100644
--- a/third_party/ngraph/nlohmann_json.BUILD
+++ b/third_party/ngraph/nlohmann_json.BUILD
@@ -1,14 +1,6 @@
licenses(["notice"]) # 3-Clause BSD
-exports_files(["license.txt"])
-
-filegroup(
- name = "LICENSE",
- srcs = [
- "license.txt",
- ],
- visibility = ["//visibility:public"],
-)
+exports_files(["LICENSE.MIT"])
cc_library(
name = "nlohmann_json_lib",