From b6cc74f85546f60b5eb5486947e3be121ca54a28 Mon Sep 17 00:00:00 2001 From: MengqingCao Date: Tue, 19 Dec 2023 17:35:11 +0800 Subject: [PATCH] link libacl_dvpp_mpi library when building with CANN backend --- cmake/OpenCVFindCANN.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cmake/OpenCVFindCANN.cmake b/cmake/OpenCVFindCANN.cmake index 913c1887e7..36d160d0f4 100644 --- a/cmake/OpenCVFindCANN.cmake +++ b/cmake/OpenCVFindCANN.cmake @@ -57,6 +57,18 @@ if(CANN_INSTALL_DIR) set(HAVE_CANN OFF) return() endif() + + # * libacl_dvpp_mpi.so + set(libacl_dvpp_mpi "${CANN_INSTALL_DIR}/lib64") + find_library(found_libacldvppmpi NAMES acl_dvpp_mpi PATHS ${libacl_dvpp_mpi} NO_DEFAULT_PATH) + if(found_libacldvppmpi) + set(libacl_dvpp_mpi ${found_libacldvppmpi}) + message(STATUS "CANN: libacl_dvpp_mpi.so is found at ${libacl_dvpp_mpi}") + else() + message(STATUS "CANN: Missing libacl_dvpp_mpi.so. Turning off HAVE_CANN") + set(HAVE_CANN OFF) + return() + endif() # * libgraph.so set(lib_graph "${CANN_INSTALL_DIR}/compiler/lib64") find_library(found_lib_graph NAMES graph PATHS ${lib_graph} NO_DEFAULT_PATH) @@ -105,6 +117,7 @@ if(CANN_INSTALL_DIR) list(APPEND libs_cann ${lib_opsproto}) list(APPEND libs_cann ${lib_graph}) list(APPEND libs_cann ${lib_ge_compiler}) + list(APPEND libs_cann ${libacl_dvpp_mpi}) # * lib_graph_base.so if(NOT CANN_VERSION_BELOW_6_3_ALPHA002)