diff --git a/CMakeLists.txt b/CMakeLists.txt index ff82dc080..84bf26e88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,8 +99,9 @@ find_package(prometheus-cpp REQUIRED) if(NOT WITH_RAFT) find_package(fmt REQUIRED) endif() -find_package(opentelemetry-cpp REQUIRED) - +if(NOT WITH_LIGHT) + find_package(opentelemetry-cpp REQUIRED) +endif() set(CMAKE_CXX_STANDARD 17) set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" diff --git a/cmake/libs/libfaiss.cmake b/cmake/libs/libfaiss.cmake index 92a1312eb..18446f1de 100644 --- a/cmake/libs/libfaiss.cmake +++ b/cmake/libs/libfaiss.cmake @@ -60,7 +60,6 @@ if(__PPC64) target_link_libraries(knowhere_utils PUBLIC glog::glog) endif() -find_package(LAPACK REQUIRED) if(LINUX) set(BLA_VENDOR OpenBLAS) @@ -70,8 +69,12 @@ if(APPLE) set(BLA_VENDOR Apple) endif() -find_package(BLAS REQUIRED) - +if(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") + find_package(OpenBLAS REQUIRED) + set(BLAS_LIBRARIES OpenBLAS::OpenBLAS) +else() + find_package(BLAS REQUIRED) +endif() if(__X86_64) list(REMOVE_ITEM FAISS_SRCS ${FAISS_AVX2_SRCS}) @@ -110,7 +113,7 @@ if(__X86_64) -Wno-unused-function -Wno-strict-aliasing>) target_link_libraries( - faiss PUBLIC OpenMP::OpenMP_CXX ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} + faiss PUBLIC OpenMP::OpenMP_CXX ${BLAS_LIBRARIES} faiss_avx2 faiss_avx512 knowhere_utils) target_compile_definitions(faiss PRIVATE FINTEGER=int) endif() @@ -133,7 +136,7 @@ if(__AARCH64) add_dependencies(faiss knowhere_utils) target_link_libraries(faiss PUBLIC OpenMP::OpenMP_CXX ${BLAS_LIBRARIES} - ${LAPACK_LIBRARIES} knowhere_utils) + knowhere_utils) target_compile_definitions(faiss PRIVATE FINTEGER=int) endif() @@ -160,6 +163,6 @@ if(__PPC64) add_dependencies(faiss knowhere_utils) target_link_libraries(faiss PUBLIC OpenMP::OpenMP_CXX ${BLAS_LIBRARIES} - ${LAPACK_LIBRARIES} knowhere_utils) + knowhere_utils) target_compile_definitions(faiss PRIVATE FINTEGER=int) endif() diff --git a/cmake/utils/platform_check.cmake b/cmake/utils/platform_check.cmake index afc41d07a..0604cb79c 100644 --- a/cmake/utils/platform_check.cmake +++ b/cmake/utils/platform_check.cmake @@ -12,4 +12,9 @@ macro(detect_target_arch) endif() endmacro() -detect_target_arch() + +if(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") + set(__AARCH64 1) +else() + detect_target_arch() +endif()