From 05bb9bda85a03ffca482034c61a424ac64aa62c4 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 3 Jun 2021 00:16:54 +0200 Subject: [PATCH] add patch to separate build of libfaiss_avx2 from libfaiss --- recipe/meta.yaml | 2 + recipe/patches/0001-use-c-14.patch | 2 +- ...-skip-test_stress-for-GPU-on-windows.patch | 2 +- ...lding-libfaiss_avx2-without-libfaiss.patch | 46 +++++++++++++++++++ 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 recipe/patches/0003-enable-building-libfaiss_avx2-without-libfaiss.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index a1dd8768..c1e54e7e 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -77,6 +77,8 @@ source: - patches/0001-use-c-14.patch # [win and cuda_compiler_version != "10.2"] # patch for avoiding crash in GPU test suite on windows - patches/0002-skip-test_stress-for-GPU-on-windows.patch + # enable building libfaiss_avx2 without libfaiss + - patches/0003-enable-building-libfaiss_avx2-without-libfaiss.patch build: number: 0 diff --git a/recipe/patches/0001-use-c-14.patch b/recipe/patches/0001-use-c-14.patch index 8ae1f065..9d5d5deb 100644 --- a/recipe/patches/0001-use-c-14.patch +++ b/recipe/patches/0001-use-c-14.patch @@ -1,7 +1,7 @@ From a2e1ffdca0490b4e377c9aebb5ab5b554669c5fb Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 26 Oct 2020 22:44:44 +0100 -Subject: [PATCH 1/2] use c++14 +Subject: [PATCH 1/3] use c++14 --- CMakeLists.txt | 2 +- diff --git a/recipe/patches/0002-skip-test_stress-for-GPU-on-windows.patch b/recipe/patches/0002-skip-test_stress-for-GPU-on-windows.patch index b97e7023..3c3494cb 100644 --- a/recipe/patches/0002-skip-test_stress-for-GPU-on-windows.patch +++ b/recipe/patches/0002-skip-test_stress-for-GPU-on-windows.patch @@ -1,7 +1,7 @@ From baa69fd2dec67313670eb271dff4717e25bd51f7 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Fri, 19 Feb 2021 14:14:31 +0100 -Subject: [PATCH 2/2] skip test_stress for GPU on windows +Subject: [PATCH 2/3] skip test_stress for GPU on windows --- faiss/gpu/test/test_gpu_basics.py | 2 ++ diff --git a/recipe/patches/0003-enable-building-libfaiss_avx2-without-libfaiss.patch b/recipe/patches/0003-enable-building-libfaiss_avx2-without-libfaiss.patch new file mode 100644 index 00000000..a2912acb --- /dev/null +++ b/recipe/patches/0003-enable-building-libfaiss_avx2-without-libfaiss.patch @@ -0,0 +1,46 @@ +From c6396047a9f44ee4349bea3da1e903b9019d3d1a Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Wed, 2 Jun 2021 22:58:19 +0200 +Subject: [PATCH 3/3] enable building libfaiss_avx2 without libfaiss + +--- + faiss/CMakeLists.txt | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/faiss/CMakeLists.txt b/faiss/CMakeLists.txt +index 30d573f0..4231ae9b 100644 +--- a/faiss/CMakeLists.txt ++++ b/faiss/CMakeLists.txt +@@ -225,18 +225,21 @@ else() + target_link_libraries(faiss_avx2 PRIVATE ${LAPACK_LIBRARIES}) + endif() + +-install(TARGETS faiss +- EXPORT faiss-targets +- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +-) +-if(FAISS_OPT_LEVEL STREQUAL "avx2") ++if(NOT FAISS_OPT_LEVEL STREQUAL "avx2") ++ install(TARGETS faiss ++ EXPORT faiss-targets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++ ) ++else() + install(TARGETS faiss_avx2 + EXPORT faiss-targets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) + endif() + +-- +2.31.1.windows.1 +