Skip to content

Commit 9e03ef0

Browse files
stemannfacebook-github-bot
authored andcommitted
Added support for building without MKL (#4147)
Summary: Pull Request resolved: #4147 Reviewed By: mnorris11 Differential Revision: D68790116 Pulled By: gtwang01 fbshipit-source-id: b0213913963991db6123e7f94e957f27d55ffa60
1 parent dd4cec2 commit 9e03ef0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ option(FAISS_OPT_LEVEL "" "generic")
6262
option(FAISS_ENABLE_GPU "Enable support for GPU indexes." ON)
6363
option(FAISS_ENABLE_CUVS "Enable cuVS for GPU indexes." OFF)
6464
option(FAISS_ENABLE_ROCM "Enable ROCm for GPU indexes." OFF)
65+
option(FAISS_ENABLE_MKL "Enable MKL." ON)
6566
option(FAISS_ENABLE_PYTHON "Build Python extension." ON)
6667
option(FAISS_ENABLE_C_API "Build C API." OFF)
6768
option(FAISS_ENABLE_EXTRAS "Build extras like benchmarks and demos" ON)

faiss/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,9 @@ target_link_libraries(faiss_avx512 PRIVATE OpenMP::OpenMP_CXX)
372372
target_link_libraries(faiss_avx512_spr PRIVATE OpenMP::OpenMP_CXX)
373373
target_link_libraries(faiss_sve PRIVATE OpenMP::OpenMP_CXX)
374374

375-
find_package(MKL)
375+
if(FAISS_ENABLE_MKL)
376+
find_package(MKL)
377+
endif()
376378
if(MKL_FOUND)
377379
target_link_libraries(faiss PRIVATE ${MKL_LIBRARIES})
378380
target_link_libraries(faiss_avx2 PRIVATE ${MKL_LIBRARIES})

0 commit comments

Comments
 (0)