You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by as...@apache.org on 2023/07/20 08:39:36 UTC

[tvm] branch main updated: [CMAKE] Conditionally link "clog" in NNPack install (#15359)

This is an automated email from the ASF dual-hosted git repository.

ashutoshp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new ae3de3d64c [CMAKE] Conditionally link "clog" in NNPack install (#15359)
ae3de3d64c is described below

commit ae3de3d64c6ba624d206f1a2f7dca8faa65dbd5a
Author: Luke Hutton <lu...@arm.com>
AuthorDate: Thu Jul 20 09:39:28 2023 +0100

    [CMAKE] Conditionally link "clog" in NNPack install (#15359)
    
    "cpuinfo" is a direct dependency of NNPack. It is installed via the
    NNPack's cmake script, but the version is not pinned. The "clog"
    dependency was recently removed from "cpuinfo"
    (https://github.com/pytorch/cpuinfo/commit/3dc310302210c1891ffcfb12ae67b11a3ad3a150),
    which leads to issues when compiling TVM with support for NNPack.
    
    When building TVM with newly generated docker images and NNPack enabled,
    we run into the following cmake configuration error:
    ```
    The following variables are used in this project, but they are set to NOTFOUND.
    Please set them or make sure they are set and tested correctly in the CMake files: NNPACK_CLOG_CONTRIB_LIB
    ```
    
    This commit intends to fix this failure while also keeping compatibility
    with older versions of cpuinfo. It conditionally adds "clog" to the
    linker libs variable if it was found.
---
 cmake/modules/contrib/NNPack.cmake | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cmake/modules/contrib/NNPack.cmake b/cmake/modules/contrib/NNPack.cmake
index 7030333f8e..86059b298f 100644
--- a/cmake/modules/contrib/NNPack.cmake
+++ b/cmake/modules/contrib/NNPack.cmake
@@ -32,5 +32,7 @@ if(USE_NNPACK)
   list(APPEND TVM_RUNTIME_LINKER_LIBS ${NNPACK_CONTRIB_LIB})
   list(APPEND TVM_RUNTIME_LINKER_LIBS ${NNPACK_PTHREAD_CONTRIB_LIB})
   list(APPEND TVM_RUNTIME_LINKER_LIBS ${NNPACK_CPUINFO_CONTRIB_LIB})
-  list(APPEND TVM_RUNTIME_LINKER_LIBS ${NNPACK_CLOG_CONTRIB_LIB})
+  if(NNPACK_CLOG_CONTRIB_LIB)
+    list(APPEND TVM_RUNTIME_LINKER_LIBS ${NNPACK_CLOG_CONTRIB_LIB})
+  endif(NNPACK_CLOG_CONTRIB_LIB)
 endif(USE_NNPACK)