-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include bin and headers to packaging and provide option to ensure tests can use precompiled trtorch libs #670
Changes from 9 commits
7ac6f1c
9860f85
b5c324a
4807d8d
ddc0685
bafa675
eb9e1f6
45a16c5
e847abd
d2cc1e9
7d67da2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
config_setting( | ||
name = "aarch64_linux", | ||
constraint_values = [ | ||
"@platforms//cpu:aarch64", | ||
"@platforms//os:linux", | ||
], | ||
) | ||
|
||
config_setting( | ||
name = "windows", | ||
constraint_values = [ | ||
"@platforms//os:windows", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "libtrtorch", | ||
srcs = select({ | ||
":windows": [ | ||
"lib/x64/trtorch.dll", | ||
], | ||
"//conditions:default": [ | ||
"lib/libtrtorch.so", | ||
], | ||
}), | ||
hdrs = glob([ | ||
"include/**/*.h", | ||
]), | ||
strip_include_prefix = "include", | ||
includes = ["include/"] | ||
) | ||
|
||
cc_library( | ||
name = "libtrtorchrt", | ||
srcs = select({ | ||
":windows": [ | ||
"lib/x64/trtorchrt.dll" | ||
], | ||
"//conditions:default": [ | ||
"lib/libtrtorchrt.so" | ||
] | ||
}) | ||
) | ||
|
||
cc_library( | ||
name = "libtrtorch_plugins", | ||
srcs = select({ | ||
":windows": [ | ||
"lib/x64/trtorch_plugins.dll" | ||
], | ||
"//conditions:default": [ | ||
"lib/libtrtorch_plugins.so" | ||
] | ||
}), | ||
hdrs = glob([ | ||
"include/trtorch/core/plugins/**/*.h", | ||
]), | ||
strip_include_prefix = "include", | ||
includes = ["include/"] | ||
) | ||
|
||
cc_library( | ||
name = "trtorch_core_hdrs", | ||
hdrs = glob([ | ||
"include/trtorch/core/**/*.h" | ||
]), | ||
strip_include_prefix = "include/trtorch", | ||
includes = ["include/trtorch/"] | ||
) | ||
|
||
# Alias for ease of use | ||
cc_library( | ||
name = "trtorch", | ||
deps = [ | ||
":libtrtorch", | ||
] | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
exports_files([ | ||
"WORKSPACE", | ||
"BUILD" | ||
]) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
workspace(name = "trtorch") |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,6 @@ cc_test( | |
"//tests/modules:jit_models", | ||
], | ||
deps = [ | ||
"//cpp:trtorch", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did we not have to replace any of these dependencies? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't get your question. We replaced |
||
"//tests/util", | ||
"@googletest//:gtest_main", | ||
] + select({ | ||
|
@@ -115,7 +114,6 @@ cc_test( | |
"//tests/modules:jit_models", | ||
], | ||
deps = [ | ||
"//cpp:trtorch", | ||
"//tests/util", | ||
"@googletest//:gtest_main", | ||
] + select({ | ||
|
@@ -150,7 +148,6 @@ cc_library( | |
name = "cpp_api_test", | ||
hdrs = ["cpp_api_test.h"], | ||
deps = [ | ||
"//cpp:trtorch", | ||
"//tests/util", | ||
"@googletest//:gtest_main", | ||
] + select({ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to list every directory, can we not glob?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably can use python glob library (glob.glob(pattern) - requires 3/4 patterns).
Naive globbing (eg: providing directly
include/**/*.h
,include/**/**/*.h
etc intrtorch
key doesn't work. Referred to pytorch setup.py which included all directories https://github.com/pytorch/pytorch/blob/master/setup.py#L918