Skip to content

Commit c0866e2

Browse files
committed
refactor(//core): Break out the pre_cxx11_abi and python compilation
paths Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent 72bc1f7 commit c0866e2

File tree

12 files changed

+44
-39
lines changed

12 files changed

+44
-39
lines changed

.bazelrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,8 @@ build --cxxopt='-std=c++14'
2828

2929
build:python --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"
3030
build:python --linkopt="-D_GLIBCXX_USE_CXX11_ABI=0"
31-
build:python --define=api=python
31+
build:python --define=abi=pre_cxx11_abi
32+
33+
build:pre_cxx11_abi --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"
34+
build:pre_cxx11_abi --linkopt="-D_GLIBCXX_USE_CXX11_ABI=0"
35+
build:pre_cxx11_abi --define=abi=pre_cxx11_abi

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ docsrc/_api
3030
docsrc/_tmp
3131
*.so
3232
__pycache__
33-
*.egg-info
33+
*.egg-info
34+
dist
35+
bdist

core/BUILD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package(default_visibility = ["//visibility:public"])
22

33
config_setting(
4-
name = "dont_use_cxx11_abi",
4+
name = "use_pre_cxx11_abi",
55
values = {
6-
"define": "api=python",
6+
"define": "abi=pre_cxx11_abi",
77
}
88
)
99

@@ -22,7 +22,7 @@ cc_library(
2222
"//core/util/logging",
2323
"@tensorrt//:nvinfer"
2424
] + select({
25-
":dont_use_cxx11_abi": ["@libtorch_non_cxx11_abi//:libtorch"],
25+
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
2626
"//conditions:default": ["@libtorch//:libtorch"],
2727
}),
2828
alwayslink=True,

core/conversion/BUILD

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package(default_visibility = ["//visibility:public"])
22

33
config_setting(
4-
name = "dont_use_cxx11_abi",
4+
name = "use_pre_cxx11_abi",
55
values = {
6-
"define": "api=python",
6+
"define": "abi=pre_cxx11_abi",
77
}
88
)
99

@@ -15,7 +15,6 @@ cc_library(
1515
srcs = [
1616
"conversion.cpp",
1717
"conversion_blacklist.cpp",
18-
"string_to_type_lut.cpp",
1918
"InterfaceTypes.cpp"
2019
],
2120
deps = [
@@ -25,9 +24,9 @@ cc_library(
2524
"//core/conversion/evaluators",
2625
"//core/util:prelude"
2726
] + select({
28-
":dont_use_cxx11_abi": ["@libtorch_non_cxx11_abi//:libtorch"],
27+
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
2928
"//conditions:default": ["@libtorch//:libtorch"],
30-
})
29+
}),
3130
)
3231

3332
load("@rules_pkg//:pkg.bzl", "pkg_tar")

core/conversion/conversionctx/BUILD

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package(default_visibility = ["//visibility:public"])
22

33
config_setting(
4-
name = "dont_use_cxx11_abi",
4+
name = "use_pre_cxx11_abi",
55
values = {
6-
"define": "api=python",
6+
"define": "abi=pre_cxx11_abi",
77
}
88
)
99

@@ -19,9 +19,9 @@ cc_library(
1919
"@tensorrt//:nvinfer",
2020
"//core/util:prelude",
2121
] + select({
22-
":dont_use_cxx11_abi": ["@libtorch_non_cxx11_abi//:libtorch"],
22+
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
2323
"//conditions:default": ["@libtorch//:libtorch"],
24-
})
24+
}),
2525
)
2626

2727
load("@rules_pkg//:pkg.bzl", "pkg_tar")

core/conversion/converters/BUILD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package(default_visibility = ["//visibility:public"])
22

33
config_setting(
4-
name = "dont_use_cxx11_abi",
4+
name = "use_pre_cxx11_abi",
55
values = {
6-
"define": "api=python",
6+
"define": "abi=pre_cxx11_abi",
77
}
88
)
99

@@ -35,7 +35,7 @@ cc_library(
3535
"//core/util:prelude",
3636
"//core/conversion/conversionctx",
3737
] + select({
38-
":dont_use_cxx11_abi": ["@libtorch_non_cxx11_abi//:libtorch"],
38+
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
3939
"//conditions:default": ["@libtorch//:libtorch"],
4040
}),
4141
alwayslink = True,

core/conversion/evaluators/BUILD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package(default_visibility = ["//visibility:public"])
22

33
config_setting(
4-
name = "dont_use_cxx11_abi",
4+
name = "use_pre_cxx11_abi",
55
values = {
6-
"define": "api=python",
6+
"define": "abi=pre_cxx11_abi",
77
}
88
)
99

@@ -19,7 +19,7 @@ cc_library(
1919
deps = [
2020
"//core/util:prelude",
2121
] + select({
22-
":dont_use_cxx11_abi": ["@libtorch_non_cxx11_abi//:libtorch"],
22+
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
2323
"//conditions:default": ["@libtorch//:libtorch"],
2424
}),
2525
alwayslink = True,

core/execution/BUILD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package(default_visibility = ["//visibility:public"])
22

33
config_setting(
4-
name = "dont_use_cxx11_abi",
4+
name = "use_pre_cxx11_abi",
55
values = {
6-
"define": "api=python",
6+
"define": "abi=pre_cxx11_abi",
77
}
88
)
99

@@ -21,7 +21,7 @@ cc_library(
2121
"@tensorrt//:nvinfer",
2222
"//core/util:prelude"
2323
] + select({
24-
":dont_use_cxx11_abi": ["@libtorch_non_cxx11_abi//:libtorch"],
24+
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
2525
"//conditions:default": ["@libtorch//:libtorch"],
2626
}),
2727
alwayslink = True,

core/lowering/BUILD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package(default_visibility = ["//visibility:public"])
22

33
config_setting(
4-
name = "dont_use_cxx11_abi",
4+
name = "use_pre_cxx11_abi",
55
values = {
6-
"define": "api=python",
6+
"define": "abi=pre_cxx11_abi",
77
}
88
)
99

@@ -21,7 +21,7 @@ cc_library(
2121
"//core/lowering/passes",
2222
"//core/util:prelude"
2323
] + select({
24-
":dont_use_cxx11_abi": ["@libtorch_non_cxx11_abi//:libtorch"],
24+
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
2525
"//conditions:default": ["@libtorch//:libtorch"],
2626
}),
2727
alwayslink = True

core/lowering/passes/BUILD

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package(default_visibility = ["//visibility:public"])
22

33
config_setting(
4-
name = "dont_use_cxx11_abi",
4+
name = "use_pre_cxx11_abi",
55
values = {
6-
"define": "api=python",
6+
"define": "abi=pre_cxx11_abi",
77
}
88
)
99

@@ -24,9 +24,9 @@ cc_library(
2424
deps = [
2525
"//core/util:prelude",
2626
] + select({
27-
":dont_use_cxx11_abi": ["@libtorch_non_cxx11_abi//:libtorch"],
27+
":use_pre_cxx11_abi": ["@libtorch_pre_cxx11_abi//:libtorch"],
2828
"//conditions:default": ["@libtorch//:libtorch"],
29-
})
29+
}),
3030
)
3131

3232
load("@rules_pkg//:pkg.bzl", "pkg_tar")

0 commit comments

Comments
 (0)