Skip to content

Commit ae3de3d

Browse files
authored
[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" (pytorch/cpuinfo@3dc3103), 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.
1 parent 0a3ad64 commit ae3de3d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmake/modules/contrib/NNPack.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,7 @@ if(USE_NNPACK)
3232
list(APPEND TVM_RUNTIME_LINKER_LIBS ${NNPACK_CONTRIB_LIB})
3333
list(APPEND TVM_RUNTIME_LINKER_LIBS ${NNPACK_PTHREAD_CONTRIB_LIB})
3434
list(APPEND TVM_RUNTIME_LINKER_LIBS ${NNPACK_CPUINFO_CONTRIB_LIB})
35-
list(APPEND TVM_RUNTIME_LINKER_LIBS ${NNPACK_CLOG_CONTRIB_LIB})
35+
if(NNPACK_CLOG_CONTRIB_LIB)
36+
list(APPEND TVM_RUNTIME_LINKER_LIBS ${NNPACK_CLOG_CONTRIB_LIB})
37+
endif(NNPACK_CLOG_CONTRIB_LIB)
3638
endif(USE_NNPACK)

0 commit comments

Comments
 (0)