Addressed review comments.
This commit is contained in:
parent
c9bd8b32f2
commit
0542d9f811
third_party
16
third_party/llvm-openmp/BUILD
vendored
16
third_party/llvm-openmp/BUILD
vendored
@ -5,7 +5,6 @@ exports_files(["LICENSE.txt"])
|
||||
load(
|
||||
"@org_tensorflow//third_party/llvm:llvm.bzl",
|
||||
"cmake_var_string",
|
||||
"dict_add",
|
||||
"expand_cmake_vars",
|
||||
)
|
||||
load(
|
||||
@ -14,17 +13,17 @@ load(
|
||||
)
|
||||
|
||||
genrule(
|
||||
name = "il8n_id",
|
||||
name = "kmp_il8n_id",
|
||||
srcs = [
|
||||
"runtime/tools/message-converter.pl",
|
||||
"runtime/src/i18n/en_US.txt",
|
||||
],
|
||||
outs = ["include/kmp_i18n_id.inc"],
|
||||
cmd = "$(location runtime/tools/message-converter.pl) --os=lin --prefix=kmp_i18n --enum=$@ $(location runtime/src/i18n/en_US.txt)",
|
||||
cmd = "perl $(location runtime/tools/message-converter.pl) --os=lin --prefix=kmp_i18n --enum=$@ $(location runtime/src/i18n/en_US.txt)",
|
||||
)
|
||||
|
||||
genrule(
|
||||
name = "kmp_i18n_default",
|
||||
name = "kmp_il8n_default",
|
||||
srcs = [
|
||||
"runtime/tools/message-converter.pl",
|
||||
"runtime/src/i18n/en_US.txt",
|
||||
@ -49,12 +48,12 @@ omp_vars = {
|
||||
"LIBOMP_ENABLE_ASSERTIONS": 1,
|
||||
"LIBOMP_ENABLE_SHARED": 1,
|
||||
"LIBOMP_LEGAL_ARCH": "Intel(R) 64",
|
||||
"LIBOMP_LIB_FILE": "libiomp5.so",
|
||||
"LIBOMP_LIB_FILE": "libiomp5",
|
||||
"LIBOMP_VERSION_MAJOR": 5,
|
||||
"LIBOMP_VERSION_MINOR": 0,
|
||||
}
|
||||
|
||||
omp_all_cmake_vars = cmake_var_string(dict_add(omp_vars))
|
||||
omp_all_cmake_vars = cmake_var_string(omp_vars)
|
||||
|
||||
expand_cmake_vars(
|
||||
name = "config_kmp",
|
||||
@ -73,7 +72,6 @@ expand_cmake_vars(
|
||||
cc_binary(
|
||||
name = "libiomp5.so",
|
||||
srcs = glob([
|
||||
"runtime/src/*.h",
|
||||
"runtime/src/kmp_alloc.cpp",
|
||||
"runtime/src/kmp_atomic.cpp",
|
||||
"runtime/src/kmp_csupport.cpp",
|
||||
@ -109,8 +107,8 @@ cc_binary(
|
||||
]) + [
|
||||
":config_kmp",
|
||||
":config_omp",
|
||||
":il8n_id",
|
||||
":kmp_i18n_default",
|
||||
":kmp_il8n_id",
|
||||
":kmp_il8n_default",
|
||||
":ldscript",
|
||||
],
|
||||
copts = ["-Domp_EXPORTS -D_GNU_SOURCE -D_REENTRANT"],
|
||||
|
5
third_party/llvm/BUILD
vendored
5
third_party/llvm/BUILD
vendored
@ -2,5 +2,8 @@ py_binary(
|
||||
name = "expand_cmake_vars",
|
||||
srcs = ["expand_cmake_vars.py"],
|
||||
srcs_version = "PY2AND3",
|
||||
visibility = ["//visibility:public"],
|
||||
visibility = [
|
||||
"@llvm-openmp//:__subpackages__",
|
||||
"@llvm-project//:__subpackages__",
|
||||
],
|
||||
)
|
||||
|
4
third_party/llvm/expand_cmake_vars.py
vendored
4
third_party/llvm/expand_cmake_vars.py
vendored
@ -38,10 +38,10 @@ def _parse_args(argv):
|
||||
|
||||
|
||||
def _expand_variables(input_str, cmake_vars):
|
||||
"""Expands ${VARIABLE} and @VARIABLE@s in 'input_str', using dictionary 'cmake_vars'.
|
||||
"""Expands ${VARIABLE}s and @VARIABLE@s in 'input_str', using dictionary 'cmake_vars'.
|
||||
|
||||
Args:
|
||||
input_str: the string containing ${VARIABLE} and @VARIABLE@ expressions to expand.
|
||||
input_str: the string containing ${VARIABLE} or @VARIABLE@ expressions to expand.
|
||||
cmake_vars: a dictionary mapping variable names to their values.
|
||||
|
||||
Returns:
|
||||
|
14
third_party/llvm/llvm.bzl
vendored
14
third_party/llvm/llvm.bzl
vendored
@ -7,7 +7,7 @@ TODO(chandlerc): Currently this expresses include-based dependencies as
|
||||
correctly understood by the build system.
|
||||
"""
|
||||
|
||||
def dict_add(*dictionaries):
|
||||
def _dict_add(*dictionaries):
|
||||
"""Returns a new `dict` that has all the entries of the given dictionaries.
|
||||
|
||||
If the same key is present in more than one of the input dictionaries, the
|
||||
@ -305,7 +305,7 @@ win32_cmake_vars = {
|
||||
# than hardcoding x86_64.
|
||||
llvm_all_cmake_vars = select({
|
||||
"@org_tensorflow//tensorflow:macos": cmake_var_string(
|
||||
dict_add(
|
||||
_dict_add(
|
||||
cmake_vars,
|
||||
llvm_target_cmake_vars("X86", "x86_64-apple-darwin"),
|
||||
posix_cmake_vars,
|
||||
@ -313,7 +313,7 @@ llvm_all_cmake_vars = select({
|
||||
),
|
||||
),
|
||||
"@org_tensorflow//tensorflow:linux_ppc64le": cmake_var_string(
|
||||
dict_add(
|
||||
_dict_add(
|
||||
cmake_vars,
|
||||
llvm_target_cmake_vars("PowerPC", "powerpc64le-unknown-linux_gnu"),
|
||||
posix_cmake_vars,
|
||||
@ -321,21 +321,21 @@ llvm_all_cmake_vars = select({
|
||||
),
|
||||
),
|
||||
"@org_tensorflow//tensorflow:windows": cmake_var_string(
|
||||
dict_add(
|
||||
_dict_add(
|
||||
cmake_vars,
|
||||
llvm_target_cmake_vars("X86", "x86_64-pc-win32"),
|
||||
win32_cmake_vars,
|
||||
),
|
||||
),
|
||||
"@org_tensorflow//tensorflow:freebsd": cmake_var_string(
|
||||
dict_add(
|
||||
_dict_add(
|
||||
cmake_vars,
|
||||
llvm_target_cmake_vars("X86", "x86_64-unknown-freebsd"),
|
||||
posix_cmake_vars,
|
||||
),
|
||||
),
|
||||
"@org_tensorflow//tensorflow:linux_s390x": cmake_var_string(
|
||||
dict_add(
|
||||
_dict_add(
|
||||
cmake_vars,
|
||||
llvm_target_cmake_vars("SystemZ", "systemz-unknown-linux_gnu"),
|
||||
posix_cmake_vars,
|
||||
@ -343,7 +343,7 @@ llvm_all_cmake_vars = select({
|
||||
),
|
||||
),
|
||||
"//conditions:default": cmake_var_string(
|
||||
dict_add(
|
||||
_dict_add(
|
||||
cmake_vars,
|
||||
llvm_target_cmake_vars("X86", "x86_64-unknown-linux_gnu"),
|
||||
posix_cmake_vars,
|
||||
|
Loading…
Reference in New Issue
Block a user