From 50c7edac68963e1f3dc2d50834ec4e61bfd2954d Mon Sep 17 00:00:00 2001 From: Naren Dasan Date: Mon, 24 Aug 2020 18:12:06 -0700 Subject: [PATCH] fix(//docker): Workaround only shared libraries being available in PyTorch container Signed-off-by: Naren Dasan Signed-off-by: Naren Dasan --- docker/Dockerfile.20.07 | 3 +++ third_party/tensorrt/local/BUILD | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile.20.07 b/docker/Dockerfile.20.07 index 3a1d49ce76..54daf25fdd 100644 --- a/docker/Dockerfile.20.07 +++ b/docker/Dockerfile.20.07 @@ -14,6 +14,9 @@ COPY . /workspace/TRTorch RUN rm /workspace/TRTorch/WORKSPACE COPY ./docker/WORKSPACE.cu11.docker /workspace/TRTorch/WORKSPACE +# Workaround for bazel expecting both static and shared versions, we only use shared libraries inside container +RUN cp /usr/lib/x86_64-linux-gnu/libnvinfer.so /usr/lib/x86_64-linux-gnu/libnvinfer_static.a + WORKDIR /workspace/TRTorch RUN bazel build //:libtrtorch --compilation_mode opt diff --git a/third_party/tensorrt/local/BUILD b/third_party/tensorrt/local/BUILD index 69f54d8246..dfbe5a3c4a 100644 --- a/third_party/tensorrt/local/BUILD +++ b/third_party/tensorrt/local/BUILD @@ -68,8 +68,9 @@ cc_import( "//conditions:default": "lib/x86_64-linux-gnu/libnvinfer.so", }), static_library = select({ + ":aarch64_linux": "lib/aarch64-linux-gnu/libnvinfer_static.a", ":windows": "lib/nvinfer.lib", - "//conditions:default": "" + "//conditions:default": "lib/x86_64-linux-gnu/libnvinfer_static.a" }), visibility = ["//visibility:private"], )