early-access version 2853
This commit is contained in:
39
externals/vcpkg/ports/faiss/fix-dependencies.patch
vendored
Executable file
39
externals/vcpkg/ports/faiss/fix-dependencies.patch
vendored
Executable file
@@ -0,0 +1,39 @@
|
||||
diff --git a/cmake/faiss-config.cmake.in b/cmake/faiss-config.cmake.in
|
||||
index 43ea9d4..437a7f8 100644
|
||||
--- a/cmake/faiss-config.cmake.in
|
||||
+++ b/cmake/faiss-config.cmake.in
|
||||
@@ -4,4 +4,7 @@
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
+find_dependency(OpenMP REQUIRED)
|
||||
+find_dependency(BLAS REQUIRED)
|
||||
+find_dependency(LAPACK REQUIRED)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/faiss-targets.cmake")
|
||||
diff --git a/faiss/CMakeLists.txt b/faiss/CMakeLists.txt
|
||||
index 30d573f..9af8baf 100644
|
||||
--- a/faiss/CMakeLists.txt
|
||||
+++ b/faiss/CMakeLists.txt
|
||||
@@ -212,17 +212,17 @@ target_link_libraries(faiss PRIVATE OpenMP::OpenMP_CXX)
|
||||
target_link_libraries(faiss_avx2 PRIVATE OpenMP::OpenMP_CXX)
|
||||
|
||||
find_package(MKL)
|
||||
-if(MKL_FOUND)
|
||||
+if(0)
|
||||
target_link_libraries(faiss PRIVATE ${MKL_LIBRARIES})
|
||||
target_link_libraries(faiss_avx2 PRIVATE ${MKL_LIBRARIES})
|
||||
else()
|
||||
find_package(BLAS REQUIRED)
|
||||
- target_link_libraries(faiss PRIVATE ${BLAS_LIBRARIES})
|
||||
- target_link_libraries(faiss_avx2 PRIVATE ${BLAS_LIBRARIES})
|
||||
+ target_link_libraries(faiss PRIVATE BLAS::BLAS)
|
||||
+ target_link_libraries(faiss_avx2 PRIVATE BLAS::BLAS)
|
||||
|
||||
find_package(LAPACK REQUIRED)
|
||||
- target_link_libraries(faiss PRIVATE ${LAPACK_LIBRARIES})
|
||||
- target_link_libraries(faiss_avx2 PRIVATE ${LAPACK_LIBRARIES})
|
||||
+ target_link_libraries(faiss PRIVATE LAPACK::LAPACK)
|
||||
+ target_link_libraries(faiss_avx2 PRIVATE LAPACK::LAPACK)
|
||||
endif()
|
||||
|
||||
install(TARGETS faiss
|
||||
38
externals/vcpkg/ports/faiss/portfile.cmake
vendored
Executable file
38
externals/vcpkg/ports/faiss/portfile.cmake
vendored
Executable file
@@ -0,0 +1,38 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO facebookresearch/faiss
|
||||
REF v1.7.2
|
||||
SHA512 dddf55af3cc73a15fbbd104ab75942194a4d5d088611bd98b11e459e034ba5df1d9247eb8c8b9f4631cc64c6ed284b2cf407041be7b6095f9395f9ac29d78df4
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-dependencies.patch
|
||||
)
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
gpu FAISS_ENABLE_GPU
|
||||
)
|
||||
|
||||
if ("${FAISS_ENABLE_GPU}")
|
||||
if (NOT VCPKG_CMAKE_SYSTEM_NAME AND NOT ENV{CUDACXX})
|
||||
set(ENV{CUDACXX} "$ENV{CUDA_PATH}/bin/nvcc.exe")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
${FEATURE_OPTIONS}
|
||||
-DFAISS_ENABLE_PYTHON=OFF # Requires SWIG
|
||||
-DBUILD_TESTING=OFF
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_cmake_config_fixup()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
28
externals/vcpkg/ports/faiss/vcpkg.json
vendored
Executable file
28
externals/vcpkg/ports/faiss/vcpkg.json
vendored
Executable file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "faiss",
|
||||
"version-semver": "1.7.2",
|
||||
"description": "Faiss is a library for efficient similarity search and clustering of dense vectors.",
|
||||
"homepage": "https://github.com/facebookresearch/faiss",
|
||||
"license": "MIT",
|
||||
"supports": "!uwp & !osx & !x86",
|
||||
"dependencies": [
|
||||
"lapack",
|
||||
"openblas",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"features": {
|
||||
"gpu": {
|
||||
"description": "Whether to enable GPU support",
|
||||
"dependencies": [
|
||||
"cuda"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user