Skip to content

Instantly share code, notes, and snippets.

@momeara
Created March 8, 2017 15:21
Show Gist options
  • Save momeara/996dc8e67825134df107a29779d96150 to your computer and use it in GitHub Desktop.
Save momeara/996dc8e67825134df107a29779d96150 to your computer and use it in GitHub Desktop.
Custom configuration of tensorflow leads to XLA compilation error
diff --git a/configure b/configure
index 5a9a7c0..9b4568d 100755
--- a/configure
+++ b/configure
@@ -39,9 +39,9 @@ function bazel_clean_and_fetch() {
# bazel clean --expunge currently doesn't work on Windows
# TODO(pcloudy): Re-enable it after bazel clean --expunge is fixed.
if ! is_windows; then
- bazel clean --expunge
+ bazel --output_user_root=/scratch/momeara/.cache/baze clean --expunge_async
fi
- bazel fetch "//tensorflow/... -//tensorflow/contrib/nccl/... \
+ bazel --output_user_root=/scratch/momeara/.cache/baze fetch "//tensorflow/... -//tensorflow/contrib/nccl/... \
-//tensorflow/examples/android/..."
}
diff --git a/tensorflow/core/platform/default/build_config.bzl b/tensorflow/core/platform/default/build_config.bzl
index a2c133b..e570e7f 100644
--- a/tensorflow/core/platform/default/build_config.bzl
+++ b/tensorflow/core/platform/default/build_config.bzl
@@ -6,8 +6,8 @@ load("//tensorflow:tensorflow.bzl", "if_not_mobile")
# configure may change the following lines
WITH_GCP_SUPPORT = False
-WITH_HDFS_SUPPORT = False
-WITH_JEMALLOC = True
+WITH_HDFS_SUPPORT = True
+WITH_JEMALLOC = False
# Appends a suffix to a list of deps.
def tf_deps(deps, suffix):
diff --git a/tensorflow/core/platform/default/build_config_root.bzl b/tensorflow/core/platform/default/build_config_root.bzl
index 23a7b90..79484bc 100644
--- a/tensorflow/core/platform/default/build_config_root.bzl
+++ b/tensorflow/core/platform/default/build_config_root.bzl
@@ -2,7 +2,7 @@
# The functions in this file might be referred by tensorflow.bzl. They have to
# be separate to avoid cyclic references.
-WITH_XLA_SUPPORT = False
+WITH_XLA_SUPPORT = True
def tf_cuda_tests_tags():
return ["local"]
diff --git a/third_party/gpus/crosstool/CROSSTOOL.tpl b/third_party/gpus/crosstool/CROSSTOOL.tpl
index b77a45c..c836a78 100644
--- a/third_party/gpus/crosstool/CROSSTOOL.tpl
+++ b/third_party/gpus/crosstool/CROSSTOOL.tpl
@@ -44,7 +44,7 @@ toolchain {
tool_path { name: "ar" path: "/usr/bin/ar" }
tool_path { name: "compat-ld" path: "/usr/bin/ld" }
- tool_path { name: "cpp" path: "/usr/bin/cpp" }
+ tool_path { name: "cpp" path: "/usr/nfs/home/momeara/opt/bin/cpp" }
tool_path { name: "dwp" path: "/usr/bin/dwp" }
# As part of the TensorFlow release, we place some cuda-related compilation
# files in @local_config_cuda//crosstool/clang/bin, and this relative
@@ -56,10 +56,17 @@ toolchain {
cxx_flag: "-std=c++11"
linker_flag: "-Wl,-no-as-needed"
linker_flag: "-lstdc++"
- linker_flag: "-B/usr/bin/"
+ linker_flag: "-B/mnt/nfs/home/momeara/opt/bin/"
+ linker_flag: "-L/mnt/nfs/home/momeara/opt/lib64/"
+ linker_flag: "-Wl,-rpath,/mnt/nfs/home/momeara/opt/lib64/"
+
%{gcc_host_compiler_includes}
- tool_path { name: "gcov" path: "/usr/bin/gcov" }
+ cxx_builtin_include_directory: "/mnt/nfs/home/momeara/opt/lib/gcc/"
+ cxx_builtin_include_directory: "/mnt/nfs/home/momeara/opt/lib64/"
+ cxx_builtin_include_directory: "/mnt/nfs/home/momeara/opt/include"
+ tool_path { name: "gcov" path: "/mnt/nfs/home/momeara/opt/bin/gcov" }
+
# C(++) compiles invoke the compiler (as that is the one knowing where
# to find libraries), but we provide LD so other rules can invoke the linker.
@@ -69,8 +76,9 @@ toolchain {
tool_path { name: "objcopy" path: "/usr/bin/objcopy" }
objcopy_embed_flag: "-I"
objcopy_embed_flag: "binary"
- tool_path { name: "objdump" path: "/usr/bin/objdump" }
- tool_path { name: "strip" path: "/usr/bin/strip" }
+ tool_path { name: "objdump" path: "/mnt/nfs/home/momeara/opt/bin/objdump" }
+ tool_path { name: "strip" path: "/mnt/nfs/home/momeara/opt/bin/strip" }
+
# Anticipated future default.
unfiltered_cxx_flag: "-no-canonical-prefixes"
@@ -167,7 +175,7 @@ toolchain {
tool_path { name: "ar" path: "/usr/bin/libtool" }
tool_path { name: "compat-ld" path: "/usr/bin/ld" }
- tool_path { name: "cpp" path: "/usr/bin/cpp" }
+ tool_path { name: "cpp" path: "/mnt/nfs/home/momeara/opt/bin/cpp" }
tool_path { name: "dwp" path: "/usr/bin/dwp" }
tool_path { name: "gcc" path: "clang/bin/crosstool_wrapper_driver_is_not_gcc" }
cxx_flag: "-std=c++11"
@@ -180,7 +188,7 @@ toolchain {
# TODO(ulfjack): This is wrong on so many levels. Figure out a way to auto-detect the proper
# setting from the local compiler, and also how to make incremental builds correct.
cxx_builtin_include_directory: "/"
- tool_path { name: "gcov" path: "/usr/bin/gcov" }
+ tool_path { name: "gcov" path: "/mnt/nfs/home/momeara/opt/bin/gcov" }
tool_path { name: "ld" path: "/usr/bin/ld" }
tool_path { name: "nm" path: "/usr/bin/nm" }
tool_path { name: "objcopy" path: "/usr/bin/objcopy" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment