From d5cc07e9169abfb7b9c3a9989ab2274de4d8c55c Mon Sep 17 00:00:00 2001 From: Ramana Radhakrishnan Date: Tue, 22 Jun 2021 18:37:38 +0100 Subject: [PATCH] Check for presence of LLVM configuration. (#8293) LLVM is a pre-requisite for configuring Compute Library and offloading to Ethos-N NPU. Better to get the error message at build time rather than debugging SEGVs in testsuites. --- cmake/modules/contrib/ArmComputeLib.cmake | 4 ++++ cmake/modules/contrib/EthosN.cmake | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/cmake/modules/contrib/ArmComputeLib.cmake b/cmake/modules/contrib/ArmComputeLib.cmake index 54ce917dfb50..9f6b9c1a058e 100644 --- a/cmake/modules/contrib/ArmComputeLib.cmake +++ b/cmake/modules/contrib/ArmComputeLib.cmake @@ -27,6 +27,10 @@ if(USE_ARM_COMPUTE_LIB) if(NOT USE_ARM_COMPUTE_LIB_GRAPH_EXECUTOR) list(APPEND COMPILER_SRCS ${ACL_RUNTIME_MODULE}) endif() + if(NOT DEFINED TVM_LLVM_VERSION) + message(FATAL_ERROR "Support for offloading to Compute library for the Arm Architecture requires LLVM Support") + endif() + message(STATUS "Build with Arm Compute Library support...") endif() diff --git a/cmake/modules/contrib/EthosN.cmake b/cmake/modules/contrib/EthosN.cmake index 44d2a2a17ace..6eb5271f91b9 100644 --- a/cmake/modules/contrib/EthosN.cmake +++ b/cmake/modules/contrib/EthosN.cmake @@ -20,6 +20,10 @@ if(NOT USE_ETHOSN STREQUAL "OFF") find_ethosn(${USE_ETHOSN}) + if(NOT DEFINED TVM_LLVM_VERSION) + message(FATAL_ERROR "Support for offloading to Ethos-N requires LLVM Support") + endif() + if(NOT ETHOSN_FOUND) message(FATAL_ERROR "Cannot find Ethos-N, USE_ETHOSN=" ${USE_ETHOSN})