mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 19:25:27 +08:00
[Faiss] Fix dependencies (#18780)
* fixed targets * bumped port version * updated sha * lapack-reference should always write into lapack * lapack-reference sha * Fixed clapack target * versions * sha * ensure cmake finds the cuda compiler * sha
This commit is contained in:
parent
0bf44b144b
commit
0f05959612
@ -200,10 +200,11 @@ if(CLAPACK_FOUND AND NOT TARGET clapack::clapack)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CLAPACK_FOUND AND NOT TARGET lapack)
|
# Ensure consistency with both CMake's vanilla as well as lapack-reference's FindLAPACK.cmake module and register the LAPACK::LAPACK target
|
||||||
|
if(CLAPACK_FOUND AND NOT TARGET LAPACK::LAPACK)
|
||||||
if(EXISTS "${LAPACK_LIBRARY_RELEASE_DLL}")
|
if(EXISTS "${LAPACK_LIBRARY_RELEASE_DLL}")
|
||||||
add_library(lapack SHARED IMPORTED)
|
add_library(LAPACK::LAPACK SHARED IMPORTED)
|
||||||
set_target_properties(lapack PROPERTIES
|
set_target_properties(LAPACK::LAPACK PROPERTIES
|
||||||
IMPORTED_LOCATION_RELEASE "${LAPACK_LIBRARY_RELEASE_DLL}"
|
IMPORTED_LOCATION_RELEASE "${LAPACK_LIBRARY_RELEASE_DLL}"
|
||||||
IMPORTED_IMPLIB_RELEASE "${oLAPACK_LIBRARY_RELEASE}"
|
IMPORTED_IMPLIB_RELEASE "${oLAPACK_LIBRARY_RELEASE}"
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}"
|
INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}"
|
||||||
@ -211,23 +212,28 @@ if(CLAPACK_FOUND AND NOT TARGET lapack)
|
|||||||
IMPORTED_CONFIGURATIONS Release
|
IMPORTED_CONFIGURATIONS Release
|
||||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
|
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
|
||||||
if(EXISTS "${LAPACK_LIBRARY_DEBUG_DLL}")
|
if(EXISTS "${LAPACK_LIBRARY_DEBUG_DLL}")
|
||||||
set_property(TARGET lapack APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug)
|
set_property(TARGET LAPACK::LAPACK APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug)
|
||||||
set_target_properties(lapack PROPERTIES
|
set_target_properties(LAPACK::LAPACK PROPERTIES
|
||||||
IMPORTED_LOCATION_DEBUG "${LAPACK_LIBRARY_DEBUG_DLL}"
|
IMPORTED_LOCATION_DEBUG "${LAPACK_LIBRARY_DEBUG_DLL}"
|
||||||
IMPORTED_IMPLIB_DEBUG "${oLAPACK_LIBRARY_DEBUG}")
|
IMPORTED_IMPLIB_DEBUG "${oLAPACK_LIBRARY_DEBUG}")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
add_library(lapack UNKNOWN IMPORTED)
|
add_library(LAPACK::LAPACK UNKNOWN IMPORTED)
|
||||||
set_target_properties(lapack PROPERTIES
|
set_target_properties(LAPACK::LAPACK PROPERTIES
|
||||||
IMPORTED_LOCATION_RELEASE "${oLAPACK_LIBRARY_RELEASE}"
|
IMPORTED_LOCATION_RELEASE "${oLAPACK_LIBRARY_RELEASE}"
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}"
|
INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}"
|
||||||
IMPORTED_CONFIGURATIONS Release
|
IMPORTED_CONFIGURATIONS Release
|
||||||
INTERFACE_LINK_LIBRARIES "$<$<NOT:$<CONFIG:DEBUG>>:${oF2C_LIBRARY_RELEASE}>;$<$<CONFIG:DEBUG>:${oF2C_LIBRARY_DEBUG}>;$<$<NOT:$<CONFIG:DEBUG>>:${LAPACK_BLAS_LIBRARY_RELEASE}>;$<$<CONFIG:DEBUG>:${LAPACK_BLAS_LIBRARY_DEBUG}>;$<LINK_ONLY:${ADDITIONAL_LAPACK_LIBRARY}>;$<LINK_ONLY:${PTHREAD_LINK_NAME}>"
|
INTERFACE_LINK_LIBRARIES "$<$<NOT:$<CONFIG:DEBUG>>:${oF2C_LIBRARY_RELEASE}>;$<$<CONFIG:DEBUG>:${oF2C_LIBRARY_DEBUG}>;$<$<NOT:$<CONFIG:DEBUG>>:${LAPACK_BLAS_LIBRARY_RELEASE}>;$<$<CONFIG:DEBUG>:${LAPACK_BLAS_LIBRARY_DEBUG}>;$<LINK_ONLY:${ADDITIONAL_LAPACK_LIBRARY}>;$<LINK_ONLY:${PTHREAD_LINK_NAME}>"
|
||||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
|
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
|
||||||
if(EXISTS "${LAPACK_LIBRARY_DEBUG}")
|
if(EXISTS "${LAPACK_LIBRARY_DEBUG}")
|
||||||
set_property(TARGET lapack APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug)
|
set_property(TARGET LAPACK::LAPACK APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug)
|
||||||
set_target_properties(lapack PROPERTIES
|
set_target_properties(LAPACK::LAPACK PROPERTIES
|
||||||
IMPORTED_LOCATION_DEBUG "${oLAPACK_LIBRARY_DEBUG}")
|
IMPORTED_LOCATION_DEBUG "${oLAPACK_LIBRARY_DEBUG}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Preserve backwards compatibility and also register the 'lapack' target
|
||||||
|
if(CLAPACK_FOUND AND NOT TARGET lapack)
|
||||||
|
add_library(lapack ALIAS LAPACK::LAPACK)
|
||||||
|
endif()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "clapack",
|
"name": "clapack",
|
||||||
"version-string": "3.2.1",
|
"version-string": "3.2.1",
|
||||||
"port-version": 18,
|
"port-version": 19,
|
||||||
"description": "CLAPACK (f2c'ed version of LAPACK)",
|
"description": "CLAPACK (f2c'ed version of LAPACK)",
|
||||||
"homepage": "https://www.netlib.org/clapack",
|
"homepage": "https://www.netlib.org/clapack",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
|
34
ports/faiss/fix-dependencies.patch
Normal file
34
ports/faiss/fix-dependencies.patch
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
diff --git a/cmake/faiss-config.cmake.in b/cmake/faiss-config.cmake.in
|
||||||
|
index 43ea9d4c..437a7f81 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 51680fd1..691f52c2 100644
|
||||||
|
--- a/faiss/CMakeLists.txt
|
||||||
|
+++ b/faiss/CMakeLists.txt
|
||||||
|
@@ -148,14 +148,14 @@ find_package(OpenMP REQUIRED)
|
||||||
|
target_link_libraries(faiss PRIVATE OpenMP::OpenMP_CXX)
|
||||||
|
|
||||||
|
find_package(MKL)
|
||||||
|
-if(MKL_FOUND)
|
||||||
|
+if(0)
|
||||||
|
target_link_libraries(faiss PRIVATE ${MKL_LIBRARIES})
|
||||||
|
else()
|
||||||
|
find_package(BLAS REQUIRED)
|
||||||
|
- target_link_libraries(faiss PRIVATE ${BLAS_LIBRARIES})
|
||||||
|
+ target_link_libraries(faiss PRIVATE BLAS::BLAS)
|
||||||
|
|
||||||
|
find_package(LAPACK REQUIRED)
|
||||||
|
- target_link_libraries(faiss PRIVATE ${LAPACK_LIBRARIES})
|
||||||
|
+ target_link_libraries(faiss PRIVATE LAPACK::LAPACK)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
install(TARGETS faiss
|
@ -6,12 +6,21 @@ vcpkg_from_github(
|
|||||||
REF 0fb6c00cfa9487416b5cdf514f5f796476eecb06 # v1.6.4
|
REF 0fb6c00cfa9487416b5cdf514f5f796476eecb06 # v1.6.4
|
||||||
SHA512 c7019615103fd29124c1f4458a47faebc5fe35545eea185c41cf643f2eabe82d134dc558c85f67faea7680c292abd7477ceefde157a7c3969eda78b77a23462b
|
SHA512 c7019615103fd29124c1f4458a47faebc5fe35545eea185c41cf643f2eabe82d134dc558c85f67faea7680c292abd7477ceefde157a7c3969eda78b77a23462b
|
||||||
HEAD_REF master
|
HEAD_REF master
|
||||||
|
PATCHES
|
||||||
|
fix-dependencies.patch
|
||||||
)
|
)
|
||||||
|
|
||||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||||
|
FEATURES
|
||||||
gpu FAISS_ENABLE_GPU
|
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_configure_cmake(
|
vcpkg_configure_cmake(
|
||||||
SOURCE_PATH ${SOURCE_PATH}
|
SOURCE_PATH ${SOURCE_PATH}
|
||||||
PREFER_NINJA
|
PREFER_NINJA
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "faiss",
|
"name": "faiss",
|
||||||
"version-string": "1.6.4",
|
"version-semver": "1.6.4",
|
||||||
|
"port-version": 1,
|
||||||
"description": "Faiss is a library for efficient similarity search and clustering of dense vectors.",
|
"description": "Faiss is a library for efficient similarity search and clustering of dense vectors.",
|
||||||
"homepage": "https://github.com/facebookresearch/faiss",
|
"homepage": "https://github.com/facebookresearch/faiss",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Source: lapack-reference
|
Source: lapack-reference
|
||||||
Version: 3.8.0
|
Version: 3.8.0
|
||||||
Port-Version: 4
|
Port-Version: 5
|
||||||
Description: LAPACK — Linear Algebra PACKage http://www.netlib.org/lapack/
|
Description: LAPACK — Linear Algebra PACKage http://www.netlib.org/lapack/
|
||||||
Default-Features: blas-select
|
Default-Features: blas-select
|
||||||
Build-Depends: vcpkg-gfortran (windows)
|
Build-Depends: vcpkg-gfortran (windows)
|
||||||
|
@ -137,7 +137,5 @@ if(VCPKG_TARGET_IS_WINDOWS)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
|
||||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack)
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack)
|
||||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindLAPACK.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack)
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindLAPACK.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack)
|
||||||
endif()
|
|
||||||
|
@ -1266,7 +1266,7 @@
|
|||||||
},
|
},
|
||||||
"clapack": {
|
"clapack": {
|
||||||
"baseline": "3.2.1",
|
"baseline": "3.2.1",
|
||||||
"port-version": 18
|
"port-version": 19
|
||||||
},
|
},
|
||||||
"clara": {
|
"clara": {
|
||||||
"baseline": "1.1.5",
|
"baseline": "1.1.5",
|
||||||
@ -1926,7 +1926,7 @@
|
|||||||
},
|
},
|
||||||
"faiss": {
|
"faiss": {
|
||||||
"baseline": "1.6.4",
|
"baseline": "1.6.4",
|
||||||
"port-version": 0
|
"port-version": 1
|
||||||
},
|
},
|
||||||
"fakeit": {
|
"fakeit": {
|
||||||
"baseline": "2.0.7",
|
"baseline": "2.0.7",
|
||||||
@ -2966,7 +2966,7 @@
|
|||||||
},
|
},
|
||||||
"lapack-reference": {
|
"lapack-reference": {
|
||||||
"baseline": "3.8.0",
|
"baseline": "3.8.0",
|
||||||
"port-version": 4
|
"port-version": 5
|
||||||
},
|
},
|
||||||
"lastools": {
|
"lastools": {
|
||||||
"baseline": "2020-05-09",
|
"baseline": "2020-05-09",
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"versions": [
|
"versions": [
|
||||||
|
{
|
||||||
|
"git-tree": "bedf61cf9cf765a2c823e1f2427a16af6d8a711e",
|
||||||
|
"version-string": "3.2.1",
|
||||||
|
"port-version": 19
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"git-tree": "229447785643f09b1a4ef53bab355ff3757e178e",
|
"git-tree": "229447785643f09b1a4ef53bab355ff3757e178e",
|
||||||
"version-string": "3.2.1",
|
"version-string": "3.2.1",
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"versions": [
|
"versions": [
|
||||||
|
{
|
||||||
|
"git-tree": "eb401df0155a10cfc7cba057bbf63d10fdc37067",
|
||||||
|
"version-semver": "1.6.4",
|
||||||
|
"port-version": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"git-tree": "57552b56d2871ea87459fc655463067e1b02fcf3",
|
"git-tree": "57552b56d2871ea87459fc655463067e1b02fcf3",
|
||||||
"version-string": "1.6.4",
|
"version-string": "1.6.4",
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"versions": [
|
"versions": [
|
||||||
|
{
|
||||||
|
"git-tree": "1887fc1fcb0c96df1ea24fffc9b045330426e3b6",
|
||||||
|
"version-string": "3.8.0",
|
||||||
|
"port-version": 5
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"git-tree": "34971ac86a76f6bffefe5962980c3991abf87a58",
|
"git-tree": "34971ac86a76f6bffefe5962980c3991abf87a58",
|
||||||
"version-string": "3.8.0",
|
"version-string": "3.8.0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user