Skip to content

[Bug]: Windows ARM64 (MSVC): ailego CMake returns early and never creates zvec_ailego #622

Description

@ahmedSamir50

Description

Configuring zvec for Windows ARM64 with MSVC fails at CMake configure (before any compile of zvec_c_api).

src/ailego/CMakeLists.txt enters the ARM path correctly (HOST_ARCH matches arm|arm64), then does:

elseif (HOST_ARCH MATCHES ^(arm|arm64)$)
    if(MSVC)
        return()
    endif()
    set(MATH_MARCH_FLAG_NEON -march=armv8-a)
    ...
endif()

cc_library(
    NAME zvec_ailego STATIC STRICT PACKED
    ...
)

The return() exits this CMakeLists before cc_library, so target zvec_ailego is never created.

Meanwhile src/CMakeLists.txt still has BUILD_ZVEC_AILEGO_SHARED=ON (default) and calls zvec_add_all_in_one_shared(zvec_ailego_shared ... LIBS zvec_ailego), which fatals:

CMake Error at src/CMakeLists.txt:31 (message):
  Target zvec_ailego is required by zvec_ailego_shared

So ARM64 itself works for non-MSVC compilers; MSVC ARM64 is aborted without disabling the shared target that depends on ailego.

Contrast (same zvec pin, same CI matrix)

On the same desktop native workflow:

Target Compiler Result
linux-arm64 GCC/Clang success
osx-arm64 (Apple Silicon) AppleClang success
win-arm64 MSVC configure FATAL above

All three hit HOST_ARCH arm/arm64; only MSVC hits return().

Public job: https://github.com/ahmedSamir50/AdamSystems.ZVec.NET/actions/runs/30286685888/job/90046139977

Steps to Reproduce

On Windows with the MSVC arm64 toolset (x64 host → arm64 target is enough; a native Windows ARM MSVC build should hit the same return()):

cmake -B build -G Ninja ^
  -DCMAKE_SYSTEM_NAME=Windows ^
  -DCMAKE_SYSTEM_PROCESSOR=ARM64 ^
  -DBUILD_C_BINDINGS=ON ^
  -DBUILD_ZVEC_AILEGO_SHARED=ON

Configure ends with Target zvec_ailego is required by zvec_ailego_shared.

Log excerpts from CI:

-- BUILD_ZVEC_AILEGO_SHARED:ON
-- turbo: ARM64 detected, skipping x86-specific optimizations
CMake Error at external/zvec/src/CMakeLists.txt:31 (message):
  Target zvec_ailego is required by zvec_ailego_shared
-- Configuring incomplete, errors occurred!

Suggested fix

  1. Preferred: Remove the MSVC return() and wire MSVC-compatible ARM64 / NEON flags (instead of GCC-style -march=armv8-a) so cc_library(zvec_ailego) still runs on MSVC ARM64.
  2. Or, if MSVC ARM64 ailego is intentionally unsupported for now: emit a clear error and turn off BUILD_ZVEC_AILEGO_SHARED / skip zvec_add_all_in_one_shared when the static target was not created (do not FATAL after silently skipping the library).

A silent return() that leaves the shared graph enabled is what bites consumers.

Additional Context

Operating System

Windows (MSVC arm64 toolset; CI: windows-2025 x64 host + amd64→arm64 cross).

Build & Runtime Environment

  • Generator: Ninja
  • Compiler: MSVC 19.51.x (Hostx64/arm64)
  • Flags: -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=ARM64, BUILD_C_BINDINGS=ON, BUILD_ZVEC_AILEGO_SHARED=ON

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions