From fd5ab665a13bacfc17a01e168cd18a48f655252a Mon Sep 17 00:00:00 2001 From: Luke Hutton Date: Tue, 14 Jun 2022 10:14:10 +0000 Subject: [PATCH] [ETHOSN][CPP-RPC] Link NPU runtime in CPP RPC build When building the CPP RPC package with the NPU enabled, `link_directories` fails to find the NPU runtime libraries. This is presumably because the TVM runtime is linked with the PRIVATE option in: https://github.com/apache/tvm/blob/main/CMakeLists.txt#L601. Therefore working around this by following the precedent of other libraries such as Hexagon and Open CL. Change-Id: Iba2fbc245df18147e3b564ba807ca78c9cc8461d --- apps/cpp_rpc/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/cpp_rpc/CMakeLists.txt b/apps/cpp_rpc/CMakeLists.txt index 2fb8923d39c3..fc3aafcc4443 100644 --- a/apps/cpp_rpc/CMakeLists.txt +++ b/apps/cpp_rpc/CMakeLists.txt @@ -57,6 +57,14 @@ if (BUILD_FOR_ANDROID AND USE_HEXAGON) list(APPEND TVM_RPC_LINKER_LIBS cdsprpc log) endif() +if(USE_ETHOSN) + if (ETHOSN_RUNTIME_LIBRARY) + list(APPEND TVM_RPC_LINKER_LIBS ${ETHOSN_RUNTIME_LIBRARY}) + else() + message(WARNING "Could not locate Arm(R) Ethos(TM)-N runtime library components") + endif() +endif() + if(BUILD_STATIC_RUNTIME) list(APPEND TVM_RPC_LINKER_LIBS -Wl,--whole-archive tvm_runtime -Wl,--no-whole-archive) else()