From 01a287bf0a3e6d45eb10d36330e422eef7686a40 Mon Sep 17 00:00:00 2001 From: Wilber Date: Fri, 8 Jan 2021 14:21:31 +0800 Subject: [PATCH] fix windows compile when WITH_PYTHON=ON and WITH_TENSORRT=ON (#30194) --- paddle/fluid/inference/tensorrt/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/paddle/fluid/inference/tensorrt/CMakeLists.txt b/paddle/fluid/inference/tensorrt/CMakeLists.txt index 4f3da10f6e..d1d146b2ce 100644 --- a/paddle/fluid/inference/tensorrt/CMakeLists.txt +++ b/paddle/fluid/inference/tensorrt/CMakeLists.txt @@ -1,4 +1,9 @@ +# Compiling with WITH_PYTHON=ON and WITH_TENSORRT=ON failed on windows. Temporarily add paddle_inference_api dependency to solve the problem +if(WIN32) +nv_library(tensorrt_engine SRCS engine.cc trt_int8_calibrator.cc DEPS ${GLOB_OPERATOR_DEPS} framework_proto device_context boost paddle_inference_api) +else() nv_library(tensorrt_engine SRCS engine.cc trt_int8_calibrator.cc DEPS ${GLOB_OPERATOR_DEPS} framework_proto device_context boost) +endif() nv_library(tensorrt_op_teller SRCS op_teller.cc DEPS framework_proto device_context boost) nv_test(test_tensorrt SRCS test_tensorrt.cc DEPS dynload_cuda device_context dynamic_loader) nv_test(test_tensorrt_engine SRCS test_engine.cc DEPS dynload_cuda tensorrt_engine) -- GitLab