Skip to content

Commit

Permalink
BLD: Fix default GPU toolchain (#524)
Browse files Browse the repository at this point in the history
* Refactor build to work outside of docker
  • Loading branch information
seanpmorgan authored Oct 1, 2019
1 parent aa16608 commit d20e803
Show file tree
Hide file tree
Showing 17 changed files with 1,532 additions and 53 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ cd addons
# If building GPU Ops (Requires CUDA 10.0 and CuDNN 7)
export TF_NEED_CUDA=1
export CUDA_HOME="/path/to/cuda10" (default: /usr/local/cuda)
export CUDNN_INSTALL_PATH="/path/to/cudnn" (default: /usr/lib/x86_64-linux-gnu)
# This script links project with TensorFlow dependency
./configure.sh
Expand Down
5 changes: 2 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("//build_deps/tf_dependency:tf_configure.bzl", "tf_configure")
load("//build_deps/gpu:cuda_configure.bzl", "cuda_configure")

load("//build_deps/toolchains/gpu:cuda_configure.bzl", "cuda_configure")

http_archive(
name = "cub_archive",
build_file = "//build_deps/gpu:cub.BUILD",
build_file = "//build_deps/toolchains/gpu:cub.BUILD",
sha256 = "6bfa06ab52a650ae7ee6963143a0bbc667d6504822cbd9670369b598f18c58c3",
strip_prefix = "cub-1.8.0",
urls = [
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ licenses(["restricted"])

package(default_visibility = ["//visibility:public"])

load(":cc_toolchain_config.bzl", "cc_toolchain_config")


toolchain(
name = "toolchain-linux-x86_64",
exec_compatible_with = [
Expand All @@ -20,64 +23,37 @@ cc_toolchain_suite(
name = "toolchain",
toolchains = {
"local|compiler": ":cc-compiler-local",
"darwin|compiler": ":cc-compiler-darwin",
"x64_windows|msvc-cl": ":cc-compiler-windows",
"x64_windows": ":cc-compiler-windows",
"arm": ":cc-compiler-local",
"k8": ":cc-compiler-local",
"piii": ":cc-compiler-local",
"ppc": ":cc-compiler-local",
"darwin": ":cc-compiler-darwin",
},
)

cc_toolchain(
name = "cc-compiler-local",
all_files = "%{linker_files}",
compiler_files = ":empty",
cpu = "local",
dwp_files = ":empty",
dynamic_runtime_libs = [":empty"],
linker_files = "%{linker_files}",
objcopy_files = ":empty",
static_runtime_libs = [":empty"],
strip_files = ":empty",
# To support linker flags that need to go to the start of command line
# we need the toolchain to support parameter files. Parameter files are
# last on the command line and contain all shared libraries to link, so all
# regular options will be left of them.
supports_param_files = 1,
toolchain_config = ":cc-compiler-local-config",
toolchain_identifier = "local_linux",
)

cc_toolchain(
name = "cc-compiler-darwin",
all_files = "%{linker_files}",
compiler_files = ":empty",
cpu = "darwin",
dwp_files = ":empty",
dynamic_runtime_libs = [":empty"],
linker_files = "%{linker_files}",
objcopy_files = ":empty",
static_runtime_libs = [":empty"],
strip_files = ":empty",
supports_param_files = 0,
toolchain_identifier = "local_darwin",
)

cc_toolchain(
name = "cc-compiler-windows",
all_files = "%{win_linker_files}",
compiler_files = ":empty",
cpu = "x64_windows",
dwp_files = ":empty",
dynamic_runtime_libs = [":empty"],
linker_files = "%{win_linker_files}",
objcopy_files = ":empty",
static_runtime_libs = [":empty"],
strip_files = ":empty",
supports_param_files = 1,
toolchain_identifier = "local_windows",
cc_toolchain_config(
name = "cc-compiler-local-config",
cpu = "local",
builtin_include_directories = "%{cxx_builtin_include_directories}".split(","),
extra_no_canonical_prefixes_flags = ["-fno-canonical-system-headers"],
host_compiler_path = "clang/bin/crosstool_wrapper_driver_is_not_gcc",
host_compiler_prefix = "/usr/bin",
host_compiler_warnings = [],
host_unfiltered_compile_flags = [],
linker_bin_path = "/usr/bin",
)

filegroup(
Expand All @@ -88,9 +64,4 @@ filegroup(
filegroup(
name = "crosstool_wrapper_driver_is_not_gcc",
srcs = ["clang/bin/crosstool_wrapper_driver_is_not_gcc"],
)

filegroup(
name = "windows_msvc_wrapper_files",
srcs = glob(["windows/msvc_*"]),
)
File renamed without changes.
Loading

0 comments on commit d20e803

Please sign in to comment.