Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions ports/clapack/FindLAPACK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -200,34 +200,40 @@ if(CLAPACK_FOUND AND NOT TARGET clapack::clapack)
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}")
add_library(lapack SHARED IMPORTED)
set_target_properties(lapack PROPERTIES
add_library(LAPACK::LAPACK SHARED IMPORTED)
set_target_properties(LAPACK::LAPACK PROPERTIES
IMPORTED_LOCATION_RELEASE "${LAPACK_LIBRARY_RELEASE_DLL}"
IMPORTED_IMPLIB_RELEASE "${oLAPACK_LIBRARY_RELEASE}"
INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}"
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_CONFIGURATIONS Release
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
if(EXISTS "${LAPACK_LIBRARY_DEBUG_DLL}")
set_property(TARGET lapack APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug)
set_target_properties(lapack PROPERTIES
set_property(TARGET LAPACK::LAPACK APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug)
set_target_properties(LAPACK::LAPACK PROPERTIES
IMPORTED_LOCATION_DEBUG "${LAPACK_LIBRARY_DEBUG_DLL}"
IMPORTED_IMPLIB_DEBUG "${oLAPACK_LIBRARY_DEBUG}")
endif()
else()
add_library(lapack UNKNOWN IMPORTED)
set_target_properties(lapack PROPERTIES
add_library(LAPACK::LAPACK UNKNOWN IMPORTED)
set_target_properties(LAPACK::LAPACK PROPERTIES
IMPORTED_LOCATION_RELEASE "${oLAPACK_LIBRARY_RELEASE}"
INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}"
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}>"
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
if(EXISTS "${LAPACK_LIBRARY_DEBUG}")
set_property(TARGET lapack APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug)
set_target_properties(lapack PROPERTIES
set_property(TARGET LAPACK::LAPACK APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug)
set_target_properties(LAPACK::LAPACK PROPERTIES
IMPORTED_LOCATION_DEBUG "${oLAPACK_LIBRARY_DEBUG}")
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()
2 changes: 1 addition & 1 deletion ports/clapack/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "clapack",
"version-string": "3.2.1",
"port-version": 18,
"port-version": 19,
"description": "CLAPACK (f2c'ed version of LAPACK)",
"homepage": "https://www.netlib.org/clapack",
"dependencies": [
Expand Down
34 changes: 34 additions & 0 deletions ports/faiss/fix-dependencies.patch
Original file line number Diff line number Diff line change
@@ -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
11 changes: 10 additions & 1 deletion ports/faiss/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ vcpkg_from_github(
REF 0fb6c00cfa9487416b5cdf514f5f796476eecb06 # v1.6.4
SHA512 c7019615103fd29124c1f4458a47faebc5fe35545eea185c41cf643f2eabe82d134dc558c85f67faea7680c292abd7477ceefde157a7c3969eda78b77a23462b
HEAD_REF master
PATCHES
fix-dependencies.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
gpu FAISS_ENABLE_GPU
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_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
Expand Down
3 changes: 2 additions & 1 deletion ports/faiss/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"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.",
"homepage": "https://github.com/facebookresearch/faiss",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion ports/lapack-reference/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: lapack-reference
Version: 3.8.0
Port-Version: 4
Port-Version: 5
Description: LAPACK — Linear Algebra PACKage http://www.netlib.org/lapack/
Default-Features: blas-select
Build-Depends: vcpkg-gfortran (windows)
Expand Down
6 changes: 2 additions & 4 deletions ports/lapack-reference/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,5 @@ if(VCPKG_TARGET_IS_WINDOWS)
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}/FindLAPACK.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack)
endif()
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack)
Comment thread
bobuc-havok marked this conversation as resolved.
file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindLAPACK.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/lapack)
6 changes: 3 additions & 3 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@
},
"clapack": {
"baseline": "3.2.1",
"port-version": 18
"port-version": 19
},
"clara": {
"baseline": "1.1.5",
Expand Down Expand Up @@ -1918,7 +1918,7 @@
},
"faiss": {
"baseline": "1.6.4",
"port-version": 0
"port-version": 1
},
"fakeit": {
"baseline": "2.0.7",
Expand Down Expand Up @@ -2950,7 +2950,7 @@
},
"lapack-reference": {
"baseline": "3.8.0",
"port-version": 4
"port-version": 5
},
"lastools": {
"baseline": "2020-05-09",
Expand Down
5 changes: 5 additions & 0 deletions versions/c-/clapack.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "bedf61cf9cf765a2c823e1f2427a16af6d8a711e",
"version-string": "3.2.1",
"port-version": 19
},
{
"git-tree": "229447785643f09b1a4ef53bab355ff3757e178e",
"version-string": "3.2.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/f-/faiss.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "eb401df0155a10cfc7cba057bbf63d10fdc37067",
"version-semver": "1.6.4",
"port-version": 1
},
{
"git-tree": "57552b56d2871ea87459fc655463067e1b02fcf3",
"version-string": "1.6.4",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/lapack-reference.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1887fc1fcb0c96df1ea24fffc9b045330426e3b6",
"version-string": "3.8.0",
"port-version": 5
},
{
"git-tree": "34971ac86a76f6bffefe5962980c3991abf87a58",
"version-string": "3.8.0",
Expand Down