Skip to content

Complex number support issue with Clang 19.1.0 on Windows ARM64 (MSVC target) #111502

@Molier

Description

@Molier

Environment:

Issue:

When compiling NumPy, the build fails due to complex number type incompatibility. The error suggests that the complex.h header does not include the expected complex float type.

Error message:

Has header "complex.h" : YES
Checking for type "complex float" : NO
..\numpy_core\meson.build:175:4: ERROR: Problem encountered: "complex.h" header does not include complex type complex float

This occurs despite complex.h being present. It appears that Clang with MSVC target on Windows ARM64 may not be correctly supporting C99 complex types or may be using incompatible complex type definitions.

Steps to reproduce:

  1. Install llvm 19.1.0 for Windows ARM64
  2. Attempt to build NumPy 2.1.2 from source using pip or Meson

Expected behavior:
Clang should properly support C99 complex types when targeting MSVC on Windows ARM64.

Additional context:
This issue specifically affects building scientific Python libraries like NumPy on Windows ARM64 platforms using Clang with MSVC target.
longer error:

+ C:\Users\oscar\scoop\apps\python\current\python.exe C:\Users\oscar\AppData\Local\Temp\pip-install-gzlvntw3\numpy_9c189064778d48bab5b96a59a6325d56\vendored-meson\meson\meson.py setup C:\Users\oscar\AppData\Local\Temp\pip-install-gzlvntw3\numpy_9c189064778d48bab5b96a59a6325d56 C:\Users\oscar\AppData\Local\Temp\pip-install-gzlvntw3\numpy_9c189064778d48bab5b96a59a6325d56\.mesonpy-ocfzlwpn -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\oscar\AppData\Local\Temp\pip-install-gzlvntw3\numpy_9c189064778d48bab5b96a59a6325d56\.mesonpy-ocfzlwpn\meson-python-native-file.ini
  The Meson build system
  Version: 1.4.99
  Source dir: C:\Users\oscar\AppData\Local\Temp\pip-install-gzlvntw3\numpy_9c189064778d48bab5b96a59a6325d56
  Build dir: C:\Users\oscar\AppData\Local\Temp\pip-install-gzlvntw3\numpy_9c189064778d48bab5b96a59a6325d56\.mesonpy-ocfzlwpn
  Build type: native build
  Project name: NumPy
  Project version: 2.1.2
  C compiler for the host machine: clang (clang 19.1.0 "clang version 19.1.0")
  C linker for the host machine: clang lld-link 19.1.0
  C++ compiler for the host machine: clang++ (clang 19.1.0 "clang version 19.1.0")
  C++ linker for the host machine: clang++ lld-link 19.1.0
  Cython compiler for the host machine: cython (cython 3.0.11)
  Host machine cpu family: aarch64
  Host machine cpu: aarch64
  Program python found: YES (C:\Users\oscar\scoop\apps\python\current\python.exe)
  Run-time dependency python found: YES 3.12
  Has header "Python.h" with dependency python: YES
  Compiler for C supports arguments -fno-strict-aliasing: YES
  Compiler for C supports arguments -ftrapping-math: YES
  Message: During parsing cpu-dispatch: The following CPU features were ignored due to platform incompatibility or lack of support:
  "XOP FMA4"
  Test features "NEON NEON_FP16 NEON_VFPV4 ASIMD" : Supported
  Test features "ASIMDHP" : Supported
  Test features "ASIMDFHM" : Supported
  Test features "SVE" : Unsupported due to Compiler fails against the test code of "SVE"
  Configuring npy_cpu_dispatch_config.h using configuration
  Message:
  CPU Optimization Options
    baseline:
      Requested : min
      Enabled   : NEON NEON_FP16 NEON_VFPV4 ASIMD
    dispatch:
      Requested : max -xop -fma4
      Enabled   : ASIMDHP ASIMDFHM

  Library m found: NO
  Fetching value of define "__MINGW32__" : (undefined)
  Found pkg-config: YES (C:\Users\oscar\scoop\shims\pkg-config.EXE) 0.26
  Run-time dependency scipy-openblas found: NO (tried pkgconfig)
  Run-time dependency openblas found: YES 0.3.28.dev
  Message: BLAS symbol suffix:
  Run-time dependency openblas found: YES 0.3.28.dev
  Checking if "Check atomic builtins without -latomic" : links: NO
  Library atomic found: NO
  Program _build_utils/process_src_template.py found: YES (C:\Users\oscar\scoop\apps\python\current\python.exe C:\Users\oscar\AppData\Local\Temp\pip-install-gzlvntw3\numpy_9c189064778d48bab5b96a59a6325d56\numpy\_build_utils/process_src_template.py)
  Program _build_utils/tempita.py found: YES (C:\Users\oscar\scoop\apps\python\current\python.exe C:\Users\oscar\AppData\Local\Temp\pip-install-gzlvntw3\numpy_9c189064778d48bab5b96a59a6325d56\numpy\_build_utils/tempita.py)
  Configuring __config__.py using configuration
  Checking for size of "short" : 2
  Checking for size of "int" : 4
  Checking for size of "long" : 4
  Checking for size of "long long" : 8
  Checking for size of "float" : 4
  Checking for size of "double" : 8
  Checking for size of "long double" : 8
  Checking for size of "size_t" : 8
  Checking for size of "size_t" : 8 (cached)
  Checking for size of "wchar_t" : 2
  Checking for size of "off_t" : 4
  Checking for size of "Py_intptr_t" with dependency python: 8
  Checking for size of "PY_LONG_LONG" with dependency python: 8
  Has header "complex.h" : YES
  Checking for type "complex float" : NO

  ..\numpy\_core\meson.build:175:4: ERROR: Problem encountered: "complex.h" header does not include complex type complex float

  A full log can be found at C:\Users\oscar\AppData\Local\Temp\pip-install-gzlvntw3\numpy_9c189064778d48bab5b96a59a6325d56\.mesonpy-ocfzlwpn\meson-logs\meson-log.txt
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clangClang issues not falling into any other categoryinvalidResolved as invalid, i.e. not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions