[GH-ISSUE #14298] x/mlxrunner/mlx generated bindings fail with mlx-c v0.5.0 (mlx_metal_device_info_t missing) #71366

Closed
opened 2026-05-05 01:22:12 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @chenrui333 on GitHub (Feb 17, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/14298

Originally assigned to: @pdevine on GitHub.

Summary

ollama 0.16.x is failing in Homebrew macOS arm64 builds due to MLX runner generated bindings referencing a type that is not present in mlx-c v0.5.0.

Downstream impact (Homebrew)

Failed bump PRs since 0.16.0:

Pattern: Linux builds pass, macOS arm64 builds fail.

That PR helps x/imagegen/mlx wrapper generation, but there still appears to be a separate x/mlxrunner/mlx compatibility issue with current mlx-c headers.

Error

From Homebrew macOS arm64 source build logs:

# github.com/ollama/ollama/x/mlxrunner/mlx
In file included from x/mlxrunner/mlx/memory.go:5:
./generated.h:1871:34: error: type specifier missing, defaults to 'int'
./generated.h:4756:15: error: unknown type name 'mlx_metal_device_info_t'
./generated.h:4757:12: error: call to undeclared function 'mlx_metal_device_info_'

Observed mismatch

x/mlxrunner/mlx/CMakeLists.txt pins:

  • MLX_C_GIT_TAG "v0.4.1"

In mlx-c:

  • v0.4.1 mlx/c/metal.h includes mlx_metal_device_info_t + mlx_metal_device_info()
  • v0.5.0 mlx/c/metal.h does not include that type/function

x/mlxrunner/mlx/generated.{h,c} currently references mlx_metal_device_info_t and mlx_metal_device_info, which breaks when building against mlx-c v0.5.0 (as packaged in Homebrew).

Request

Could you adjust x/mlxrunner/mlx generated bindings for mlx-c v0.5.0 compatibility (or otherwise align the expected MLX C API for system-library builds)?

A temporary downstream workaround is to strip only the mlx_metal_device_info* wrapper lines from committed generated files before build, but an upstream fix would be preferred.

Originally created by @chenrui333 on GitHub (Feb 17, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/14298 Originally assigned to: @pdevine on GitHub. ### Summary `ollama` 0.16.x is failing in Homebrew macOS arm64 builds due to MLX runner generated bindings referencing a type that is not present in `mlx-c` v0.5.0. ### Downstream impact (Homebrew) Failed bump PRs since 0.16.0: - https://github.com/Homebrew/homebrew-core/pull/267222 (`ollama 0.16.0`) - https://github.com/Homebrew/homebrew-core/pull/267331 (`ollama 0.16.1`) — macOS arm64 error log: https://github.com/Homebrew/homebrew-core/actions/runs/21973206610/job/63479313756 - https://github.com/Homebrew/homebrew-core/pull/267893 (`ollama 0.16.2`) — macOS arm64 error log: https://github.com/Homebrew/homebrew-core/actions/runs/22084663046/job/63816938049 Pattern: Linux builds pass, macOS arm64 builds fail. ### Related upstream PR - https://github.com/ollama/ollama/pull/14201 That PR helps `x/imagegen/mlx` wrapper generation, but there still appears to be a separate `x/mlxrunner/mlx` compatibility issue with current `mlx-c` headers. ### Error From Homebrew macOS arm64 source build logs: ```text # github.com/ollama/ollama/x/mlxrunner/mlx In file included from x/mlxrunner/mlx/memory.go:5: ./generated.h:1871:34: error: type specifier missing, defaults to 'int' ./generated.h:4756:15: error: unknown type name 'mlx_metal_device_info_t' ./generated.h:4757:12: error: call to undeclared function 'mlx_metal_device_info_' ``` ### Observed mismatch `x/mlxrunner/mlx/CMakeLists.txt` pins: - `MLX_C_GIT_TAG "v0.4.1"` In `mlx-c`: - `v0.4.1` `mlx/c/metal.h` includes `mlx_metal_device_info_t` + `mlx_metal_device_info()` - `v0.5.0` `mlx/c/metal.h` does **not** include that type/function `x/mlxrunner/mlx/generated.{h,c}` currently references `mlx_metal_device_info_t` and `mlx_metal_device_info`, which breaks when building against `mlx-c` v0.5.0 (as packaged in Homebrew). ### Request Could you adjust `x/mlxrunner/mlx` generated bindings for `mlx-c` v0.5.0 compatibility (or otherwise align the expected MLX C API for system-library builds)? A temporary downstream workaround is to strip only the `mlx_metal_device_info*` wrapper lines from committed generated files before build, but an upstream fix would be preferred.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#71366