Skip to content

Instantly share code, notes, and snippets.

@annanay25
Last active April 2, 2017 07:27
Show Gist options
  • Save annanay25/06ba6e7a66e448a1259024ec026bb51c to your computer and use it in GitHub Desktop.
Save annanay25/06ba6e7a66e448a1259024ec026bb51c to your computer and use it in GitHub Desktop.
Changes made to compiler TensorFlow using a local LLVM repository
diff --git a/tensorflow/core/platform/default/build_config.bzl b/tensorflow/core/platform/default/build_config.bzl
index 48ef8df..717bfba 100644
--- a/tensorflow/core/platform/default/build_config.bzl
+++ b/tensorflow/core/platform/default/build_config.bzl
@@ -7,7 +7,7 @@ load("//tensorflow:tensorflow.bzl", "if_not_mobile")
# configure may change the following lines
WITH_GCP_SUPPORT = False
WITH_HDFS_SUPPORT = False
-WITH_XLA_SUPPORT = False
+WITH_XLA_SUPPORT = True
WITH_JEMALLOC = True
# Appends a suffix to a list of deps.
diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
index 085dad0..4b7617e 100644
--- a/tensorflow/workspace.bzl
+++ b/tensorflow/workspace.bzl
@@ -315,18 +315,25 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
# TODO(phawkins): currently, this rule uses an unofficial LLVM mirror.
# Switch to an official source of snapshots if/when possible.
- temp_workaround_http_archive(
+ # temp_workaround_http_archive(
+ # name = "llvm",
+ # urls = [
+ # "http://bazel-mirror.storage.googleapis.com/github.com/llvm-mirror/llvm/archive/2276fd31f36aa58f39397c435a8be6632d8c8505.tar.gz",
+ # "https://github.com/llvm-mirror/llvm/archive/2276fd31f36aa58f39397c435a8be6632d8c8505.tar.gz",
+ # ],
+ # sha256 = "0e08c91752732227280466d12f330a5854569deddf28ff4a6c3898334dbb0d16",
+ # strip_prefix = "llvm-2276fd31f36aa58f39397c435a8be6632d8c8505",
+ # build_file = str(Label("//third_party/llvm:llvm.BUILD")),
+ # repository = tf_repo_name,
+ # )
+
+ native.new_local_repository (
name = "llvm",
- urls = [
- "http://bazel-mirror.storage.googleapis.com/github.com/llvm-mirror/llvm/archive/2276fd31f36aa58f39397c435a8be6632d8c8505.tar.gz",
- "https://github.com/llvm-mirror/llvm/archive/2276fd31f36aa58f39397c435a8be6632d8c8505.tar.gz",
- ],
- sha256 = "0e08c91752732227280466d12f330a5854569deddf28ff4a6c3898334dbb0d16",
- strip_prefix = "llvm-2276fd31f36aa58f39397c435a8be6632d8c8505",
+ path = "/git/llvm",
build_file = str(Label("//third_party/llvm:llvm.BUILD")),
- repository = tf_repo_name,
)
+
native.new_http_archive(
name = "jsoncpp_git",
urls = [
diff --git a/third_party/llvm/llvm.BUILD b/third_party/llvm/llvm.BUILD
index 02f1393..08ceda2 100644
--- a/third_party/llvm/llvm.BUILD
+++ b/third_party/llvm/llvm.BUILD
@@ -7,18 +7,18 @@ licenses(["notice"])
exports_files(["LICENSE.TXT"])
load(
- "@%ws%//third_party/llvm:llvm.bzl",
+ "@//third_party/llvm:llvm.bzl",
"gentbl",
"expand_cmake_vars",
"llvm_target_cmake_vars",
"cmake_var_string",
)
load(
- "@%ws%//third_party:common.bzl",
+ "@//third_party:common.bzl",
"template_rule",
)
-package(default_visibility = ["@%ws%//tensorflow/compiler/xla:internal"])
+package(default_visibility = ["@//tensorflow/compiler/xla:internal"])
llvm_host_triple = "x86_64-unknown-linux_gnu"
@@ -147,7 +147,7 @@ darwin_cmake_vars = {
# TODO(phawkins): use a better method to select the right host triple, rather
# than hardcoding x86_64.
all_cmake_vars = select({
- "@%ws%//tensorflow:darwin": cmake_var_string(
+ "@//tensorflow:darwin": cmake_var_string(
cmake_vars + llvm_target_cmake_vars("X86", "x86_64-apple-darwin") +
darwin_cmake_vars,
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment