CMakeLists.txt 3.0 KB
Newer Older
Z
zhiru 已提交
1 2 3 4
include_directories(${CORE_SOURCE_DIR}/thirdparty)
include_directories(${CORE_SOURCE_DIR}/thirdparty/SPTAG/AnnService)
include_directories(${CORE_SOURCE_DIR}/include)
include_directories(${CORE_SOURCE_DIR}/thirdparty/jsoncons-0.126.0/include)
X
xj.lin 已提交
5 6
include_directories(/usr/local/cuda/include)
link_directories(/usr/local/cuda/lib64)
Z
zhiru 已提交
7
link_directories(${CORE_SOURCE_DIR}/thirdparty/tbb)
X
xj.lin 已提交
8 9 10 11

set(unittest_libs
        gtest gmock gtest_main gmock_main)

Z
zhiru 已提交
12 13
message(STATUS "arrow prefix: ${ARROW_PREFIX}")
message(STATUS "libjemalloc_pic path: ${ARROW_PREFIX}/lib/libjemalloc_pic.a")
X
xj.lin 已提交
14 15
set(depend_libs
        faiss openblas lapack
Z
zhiru 已提交
16
        arrow "${ARROW_PREFIX}/lib/libjemalloc_pic.a"
X
xj.lin 已提交
17 18 19 20 21 22 23 24 25 26 27
        tbb
        )

set(basic_libs
        cudart cublas
        gomp gfortran pthread
        )


#<IVF-TEST>
set(ivf_srcs
Z
zhiru 已提交
28 29 30 31 32 33 34
        ${CORE_SOURCE_DIR}/src/knowhere/index/vector_index/ivf.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/index/vector_index/gpu_ivf.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/index/vector_index/cloner.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/index/vector_index/idmap.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/adapter/structure.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/common/exception.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/common/timer.cpp
X
xj.lin 已提交
35 36
        utils.cpp
        )
Z
zhiru 已提交
37 38 39
if(NOT TARGET test_ivf)
    add_executable(test_ivf test_ivf.cpp ${ivf_srcs})
endif()
X
xj.lin 已提交
40 41 42 43
target_link_libraries(test_ivf ${depend_libs} ${unittest_libs} ${basic_libs})

#<IDMAP-TEST>
set(idmap_srcs
Z
zhiru 已提交
44 45 46 47 48 49 50
        ${CORE_SOURCE_DIR}/src/knowhere/index/vector_index/idmap.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/index/vector_index/ivf.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/index/vector_index/cloner.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/index/vector_index/gpu_ivf.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/adapter/structure.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/common/exception.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/common/timer.cpp
X
xj.lin 已提交
51 52
        utils.cpp
        )
Z
zhiru 已提交
53 54 55
if(NOT TARGET test_idmap)
    add_executable(test_idmap test_idmap.cpp ${idmap_srcs})
endif()
X
xj.lin 已提交
56 57 58 59
target_link_libraries(test_idmap ${depend_libs} ${unittest_libs} ${basic_libs})

#<KDT-TEST>
set(kdt_srcs
Z
zhiru 已提交
60 61 62 63 64 65 66 67
        ${CORE_SOURCE_DIR}/src/knowhere/index/preprocessor/normalize.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/index/vector_index/kdt_parameters.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/index/vector_index/cpu_kdt_rng.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/adapter/structure.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/adapter/sptag.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/common/exception.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/adapter/arrow.cpp
        ${CORE_SOURCE_DIR}/src/knowhere/common/timer.cpp
X
xj.lin 已提交
68 69
        utils.cpp
        )
Z
zhiru 已提交
70 71 72
if(NOT TARGET test_kdt)
    add_executable(test_kdt test_kdt.cpp ${kdt_srcs})
endif()
X
xj.lin 已提交
73 74 75 76
target_link_libraries(test_kdt
        SPTAGLibStatic
        ${depend_libs} ${unittest_libs} ${basic_libs})

Z
zhiru 已提交
77 78 79 80
install(TARGETS test_ivf DESTINATION unittest)
install(TARGETS test_idmap DESTINATION unittest)
install(TARGETS test_kdt DESTINATION unittest)

X
xj.lin 已提交
81
#add_subdirectory(faiss_ori)
Y
Yu Kun 已提交
82
#add_subdirectory(test_nsg)
X
xj.lin 已提交
83