From 61deb0f5384bbf163e8c1ee4a6c2e6c434a7b6fc Mon Sep 17 00:00:00 2001 From: John Mazanec Date: Mon, 29 Apr 2024 17:57:27 -0700 Subject: [PATCH] Ensure blas is statically linked Signed-off-by: John Mazanec --- jni/cmake/init-faiss.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jni/cmake/init-faiss.cmake b/jni/cmake/init-faiss.cmake index bc3836b06..bef93eda0 100644 --- a/jni/cmake/init-faiss.cmake +++ b/jni/cmake/init-faiss.cmake @@ -41,13 +41,15 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL Darwin) endif() find_package(ZLIB REQUIRED) + +# Statically link BLAS - ensure this is before we find the blas package so we dont dynamically link +set(BLA_STATIC ON) find_package(BLAS REQUIRED) enable_language(Fortran) find_package(LAPACK REQUIRED) # Set relevant properties set(BUILD_TESTING OFF) # Avoid building faiss tests -set(BLA_STATIC ON) # Statically link BLAS set(FAISS_ENABLE_GPU OFF) set(FAISS_ENABLE_PYTHON OFF)