Skip to content

Commit 63edc32

Browse files
kyamagufacebook-github-bot
authored andcommitted
Fix AVX512 build targets in CMakeLists.txt (facebookresearch#3214)
Summary: When `FAISS_OPT_LEVEL=avx512`, the current default target omits the `avx2` build, which conflicts with the install targets that specify both `avx2` and `avx512` builds. This PR fixes the default build targets for AVX512. Install targets: https://github.com/facebookresearch/faiss/blob/e19de27d72b47bb8782bc173725c45c46c9782eb/faiss/CMakeLists.txt#L332 With this PR, cmake can build and install without any error. ```bash cmake -B build -DFAISS_OPT_LEVEL=avx512 . cmake --build build --config Release -j cmake --install build ``` Pull Request resolved: facebookresearch#3214 Reviewed By: mlomeli1 Differential Revision: D52996716 Pulled By: algoriddle fbshipit-source-id: b8a46eee6cc15c2043a1a74c5e15d7a606e94acc
1 parent 99c0e2b commit 63edc32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

faiss/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ set(FAISS_HEADERS ${FAISS_HEADERS} PARENT_SCOPE)
230230
add_library(faiss ${FAISS_SRC})
231231

232232
add_library(faiss_avx2 ${FAISS_SRC})
233-
if(NOT FAISS_OPT_LEVEL STREQUAL "avx2")
233+
if(NOT FAISS_OPT_LEVEL STREQUAL "avx2" AND NOT FAISS_OPT_LEVEL STREQUAL "avx512")
234234
set_target_properties(faiss_avx2 PROPERTIES EXCLUDE_FROM_ALL TRUE)
235235
endif()
236236
if(NOT WIN32)

0 commit comments

Comments
 (0)