51 lines
1.2 KiB
CMake
51 lines
1.2 KiB
CMake
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
# All rights reserved.
|
|
#
|
|
# This source code is licensed under the BSD-style license found in the
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
cmake_minimum_required(VERSION 3.17 FATAL_ERROR)
|
|
|
|
project(faiss
|
|
VERSION 1.6.4
|
|
DESCRIPTION "A library for efficient similarity search and clustering of dense vectors."
|
|
HOMEPAGE_URL "https://github.com/facebookresearch/faiss"
|
|
LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
|
|
|
# Valid values are "generic", "sse4", "avx2".
|
|
option(FAISS_OPT_LEVEL "" "generic")
|
|
option(FAISS_ENABLE_GPU "Enable support for GPU indexes." ON)
|
|
option(FAISS_ENABLE_PYTHON "Build Python extension." ON)
|
|
|
|
if(FAISS_ENABLE_GPU)
|
|
set(CMAKE_CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER})
|
|
enable_language(CUDA)
|
|
endif()
|
|
|
|
add_subdirectory(faiss)
|
|
|
|
if(FAISS_ENABLE_GPU)
|
|
add_subdirectory(faiss/gpu)
|
|
endif()
|
|
|
|
if(FAISS_ENABLE_PYTHON)
|
|
add_subdirectory(faiss/python)
|
|
endif()
|
|
|
|
add_subdirectory(demos)
|
|
add_subdirectory(tutorial/cpp)
|
|
|
|
# CTest must be included in the top level to enable `make test` target.
|
|
include(CTest)
|
|
if(BUILD_TESTING)
|
|
add_subdirectory(tests)
|
|
|
|
if(FAISS_ENABLE_GPU)
|
|
add_subdirectory(faiss/gpu/test)
|
|
endif()
|
|
endif()
|