@@ -10,65 +10,18 @@ load("//third_party/sycl:sycl_configure.bzl", "sycl_configure")
1010load ("//third_party/toolchains/clang6:repo.bzl" , "clang6_configure" )
1111load ("//third_party/toolchains/cpus/arm:arm_compiler_configure.bzl" , "arm_compiler_configure" )
1212load ("//third_party:repo.bzl" , "tf_http_archive" )
13+ load ("//third_party/clang_toolchain:cc_configure_clang.bzl" , "cc_download_clang_toolchain" )
1314load ("@io_bazel_rules_closure//closure/private:java_import_external.bzl" , "java_import_external" )
1415load ("@io_bazel_rules_closure//closure:defs.bzl" , "filegroup_external" )
1516
16- def _extract_version_number (bazel_version ):
17- """Extracts the semantic version number from a version string
18-
19- Args:
20- bazel_version: the version string that begins with the semantic version
21- e.g. "1.2.3rc1 abc1234" where "abc1234" is a commit hash.
22-
23- Returns:
24- The semantic version string, like "1.2.3".
25- """
26- for i in range (len (bazel_version )):
27- c = bazel_version [i ]
28- if not (c .isdigit () or c == "." ):
29- return bazel_version [:i ]
30- return bazel_version
31-
32- # Parse the bazel version string from `native.bazel_version`.
33- # e.g.
34- # "0.10.0rc1 abc123d" => (0, 10, 0)
35- # "0.3.0" => (0, 3, 0)
36- def _parse_bazel_version (bazel_version ):
37- """Parses a version string into a 3-tuple of ints
38-
39- int tuples can be compared directly using binary operators (<, >).
40-
41- Args:
42- bazel_version: the Bazel version string
43-
44- Returns:
45- An int 3-tuple of a (major, minor, patch) version.
46- """
47-
48- version = _extract_version_number (bazel_version )
49- return tuple ([int (n ) for n in version .split ("." )])
50-
51- def check_bazel_version_at_least (minimum_bazel_version ):
52- if "bazel_version" not in dir (native ):
53- fail ("\n Current Bazel version is lower than 0.2.1, expected at least %s\n " % minimum_bazel_version )
54- elif not native .bazel_version :
55- print ("\n Current Bazel is not a release version, cannot check for compatibility." )
56- print ("Make sure that you are running at least Bazel %s.\n " % minimum_bazel_version )
57- return
58-
59- if _parse_bazel_version (native .bazel_version ) < _parse_bazel_version (minimum_bazel_version ):
60- fail ("\n Current Bazel version is {}, expected at least {}\n " .format (
61- native .bazel_version , minimum_bazel_version ))
6217
6318# If TensorFlow is linked as a submodule.
6419# path_prefix is no longer used.
6520# tf_repo_name is thought to be under consideration.
6621def tf_workspace (path_prefix = "" , tf_repo_name = "" ):
67- # We must check the bazel version before trying to parse any other BUILD
68- # files, in case the parsing of those build files depends on the bazel
69- # version we require here.
70- check_bazel_version_at_least ("0.5.4" )
22+ # Note that we check the minimum bazel version in WORKSPACE.
7123 clang6_configure (name = "local_config_clang6" )
24+ cc_download_clang_toolchain (name = "local_config_download_clang" )
7225 cuda_configure (name = "local_config_cuda" )
7326 tensorrt_configure (name = "local_config_tensorrt" )
7427 git_configure (name = "local_config_git" )
0 commit comments