From c7c3025bbdc75cbf1fdd9eb8186480e62a3928ba Mon Sep 17 00:00:00 2001 From: Samuel Herman Date: Fri, 24 Jan 2025 19:19:39 -0800 Subject: [PATCH 1/3] move build to one directory, fix broken flag Signed-off-by: Samuel Herman --- build.gradle | 2 +- jni/cmake/init-faiss.cmake | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 512508022..59ae97781 100644 --- a/build.gradle +++ b/build.gradle @@ -333,7 +333,7 @@ task cmakeJniLib(type:Exec) { workingDir 'jni' def args = [] args.add("cmake") - args.add(".") + args.add("-B build") args.add("-DKNN_PLUGIN_VERSION=${opensearch_version}") args.add("-DAVX2_ENABLED=${avx2_enabled}") args.add("-DAVX512_ENABLED=${avx512_enabled}") diff --git a/jni/cmake/init-faiss.cmake b/jni/cmake/init-faiss.cmake index 3cb90b767..523b3c17d 100644 --- a/jni/cmake/init-faiss.cmake +++ b/jni/cmake/init-faiss.cmake @@ -111,10 +111,10 @@ endif() if(NOT DEFINED AVX512_SPR_ENABLED) # Check if the system is Intel(R) Sapphire Rapids or a newer-generation processor execute_process(COMMAND bash -c "lscpu | grep -q 'GenuineIntel' && lscpu | grep -i 'avx512_fp16' | grep -i 'avx512_bf16' | grep -i 'avx512_vpopcntdq'" OUTPUT_VARIABLE SPR_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) - if (AND NOT "${SPR_FLAGS}" STREQUAL "") - set(AVX512_SPR_ENABLED true) + if (NOT "${SPR_FLAGS}" STREQUAL "") + set(AVX512_SPR_ENABLED true) else() - set(AVX512_SPR_ENABLED false) + set(AVX512_SPR_ENABLED false) endif() endif() From 232f840c375d2d1fda55883d3b5406adcf32be6f Mon Sep 17 00:00:00 2001 From: Samuel Herman Date: Fri, 24 Jan 2025 23:39:34 -0800 Subject: [PATCH 2/3] fix make path Signed-off-by: Samuel Herman --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 59ae97781..b4fdeaf2c 100644 --- a/build.gradle +++ b/build.gradle @@ -358,7 +358,7 @@ task cmakeJniLib(type:Exec) { task buildJniLib(type:Exec) { dependsOn cmakeJniLib - workingDir 'jni' + workingDir 'jni/build' commandLine 'make', 'opensearchknn_nmslib', 'opensearchknn_faiss', 'opensearchknn_common', '-j', "${nproc_count}" } From 53943ecd539fe90aec137fe69209a77300eebdf2 Mon Sep 17 00:00:00 2001 From: Samuel Herman Date: Fri, 24 Jan 2025 23:41:19 -0800 Subject: [PATCH 3/3] changelog update Signed-off-by: Samuel Herman --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61f94e79a..5cb98978d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), * Fixing it to retrieve space_type from index setting when both method and top level don't have the value. [#2374](https://github.com/opensearch-project/k-NN/pull/2374) * Fixing the bug where setting rescore as false for on_disk knn_vector query is a no-op (#2399)[https://github.com/opensearch-project/k-NN/pull/2399] * Fixing bug where mapping accepts both dimension and model-id (#2410)[https://github.com/opensearch-project/k-NN/pull/2410] +* Fixing bug where cmake condition to detect flag was broken and fix build path for JNI (#2442)[https://github.com/opensearch-project/k-NN/pull/2442] ### Infrastructure * Updated C++ version in JNI from c++11 to c++17 [#2259](https://github.com/opensearch-project/k-NN/pull/2259) * Upgrade bytebuddy and objenesis version to match OpenSearch core and, update github ci runner for macos [#2279](https://github.com/opensearch-project/k-NN/pull/2279)