CMakeLists.txt 2.7 KB
Newer Older
X
xj.lin 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
include_directories(${CMAKE_SOURCE_DIR}/thirdparty)
include_directories(${CMAKE_SOURCE_DIR}/thirdparty/SPTAG/AnnService)
include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories(${CMAKE_SOURCE_DIR}/thirdparty/jsoncons-0.126.0/include)
include_directories(/usr/local/cuda/include)
link_directories(/usr/local/cuda/lib64)
link_directories(${CMAKE_SOURCE_DIR}/thirdparty/tbb)

set(unittest_libs
        gtest gmock gtest_main gmock_main)

set(depend_libs
        faiss openblas lapack
        arrow jemalloc_pic
        tbb
        )

set(basic_libs
        cudart cublas
        gomp gfortran pthread
        )


#<IVF-TEST>
#<<<<<<<<<<
set(ivf_srcs
        ${CMAKE_SOURCE_DIR}/src/knowhere/index/vector_index/ivf.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/index/vector_index/gpu_ivf.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/index/vector_index/cloner.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/index/vector_index/idmap.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/adapter/structure.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/common/exception.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/common/timer.cpp
        utils.cpp
        )
add_executable(test_ivf test_ivf.cpp ${ivf_srcs})
target_link_libraries(test_ivf ${depend_libs} ${unittest_libs} ${basic_libs})
#<<<<<<<<<<

#<IDMAP-TEST>
#<<<<<<<<<<
set(idmap_srcs
        ${CMAKE_SOURCE_DIR}/src/knowhere/index/vector_index/idmap.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/index/vector_index/ivf.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/index/vector_index/cloner.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/index/vector_index/gpu_ivf.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/adapter/structure.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/common/exception.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/common/timer.cpp
        utils.cpp
        )
add_executable(test_idmap test_idmap.cpp ${idmap_srcs})
target_link_libraries(test_idmap ${depend_libs} ${unittest_libs} ${basic_libs})
#<<<<<<<<<<


#<KDT-TEST>
#<<<<<<<<<<
set(kdt_srcs
        ${CMAKE_SOURCE_DIR}/src/knowhere/index/preprocessor/normalize.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/index/vector_index/kdt_parameters.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/index/vector_index/cpu_kdt_rng.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/adapter/structure.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/adapter/sptag.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/common/exception.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/adapter/arrow.cpp
        ${CMAKE_SOURCE_DIR}/src/knowhere/common/timer.cpp
        utils.cpp
        )
add_executable(test_kdt test_kdt.cpp ${kdt_srcs})
target_link_libraries(test_kdt
        SPTAGLibStatic
        ${depend_libs} ${unittest_libs} ${basic_libs})
#<<<<<<<<<<


add_subdirectory(faiss_ori)
add_subdirectory(test_nsg)