Fix Windows ARM64 (MSVC) build: disable NEON SIMD path#5046
Fix Windows ARM64 (MSVC) build: disable NEON SIMD path#5046Chessing234 wants to merge 1 commit intofacebookresearch:mainfrom
Conversation
MSVC ARM64 builds fail because MSVC implements NEON intrinsics as compiler builtins whose addresses cannot be taken, breaking the function-pointer template pattern in simdlib_neon.h. Additionally, MSVC collapses distinct NEON struct types (e.g., uint8x16x2_t and uint16x8x2_t) to the same __n128x2 type, causing overload ambiguity. This change excludes MSVC ARM64 from the NEON SIMD compilation path in CMake and in the simdlib dispatch header, causing it to fall back to the scalar (SIMDLevel::NONE) emulated implementation. This is a pragmatic workaround that unblocks the build while preserving correctness; a future change can add proper MSVC NEON support. Fixes facebookresearch#4993 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Thanks for the fix! The CMakeLists.txt and link_to_faiss_lib.cmake changes look correct. One simplification: the |
|
Hi! Thank you for your contribution! |
|
Thanks both! @algoriddle fair point — the @alibeklfc understood — I'll wait for the SIMD refactor to land before revising, so the fix lines up with the new layout instead of having to be rewritten twice. Ping me if you'd like me to rebase/trim earlier. |
Summary
SIMDLevel::NONE) emulated implementation, which compiles and runs correctly__n128x2, and (3) missing members/operators on NEON template specializationsChanges
faiss/CMakeLists.txt: AddedAND NOT MSVCguard to the ARM64 NEON block soCOMPILE_SIMD_ARM_NEONis not defined and NEON source files are not compiled on MSVC ARM64cmake/link_to_faiss_lib.cmake: Same guard for the Dynamic Dispatch (DD) mode ARM64 pathfaiss/impl/simdlib/simdlib_dispatch.h: Added_M_ARM64recognition (MSVC's equivalent of__aarch64__) with explicit!defined(_MSC_VER)exclusion, plus explanatory commentsTest plan
cmake -B build -DFAISS_ENABLE_GPU=OFF -DFAISS_ENABLE_PYTHON=OFF -DBUILD_TESTING=OFF -A ARM64 && cmake --build buildFixes #4993
🤖 Generated with Claude Code