build: update pmetal bindings to MLX 0.32 - #360
Draft
ilblackdragon wants to merge 17 commits into
Draft
Conversation
- Patch MLX device.cpp via FetchContent PATCH_COMMAND to check PMETAL_METALLIB_PATH env var and ~/.cache/pmetal/lib/ before existing fallback chain - Stage mlx-c source to OUT_DIR before cmake to avoid modifying the git submodule - Auto-cache mlx.metallib to ~/.cache/pmetal/lib/ during build (critical for cargo install where build dir is cleaned up) - Bump pmetal-mlx-sys to 0.2.2, pmetal-mlx-rs to 0.25.5
Cargo defaults MACOSX_DEPLOYMENT_TARGET to 10.13 which causes the cmake crate to inject -mmacosx-version-min=10.13 into CFLAGS. MLX's CMakeLists.txt then rejects the build with "MLX requires macOS >= 14.0". Set MACOSX_DEPLOYMENT_TARGET and CMAKE_OSX_DEPLOYMENT_TARGET to 14.0 (or user override) before cmake runs. Fixes builds from Tauri and other frameworks that don't set their own deployment target. Bumps pmetal-mlx-sys 0.2.2 → 0.2.3, pmetal-mlx-rs 0.25.5 → 0.25.6.
resolve_deployment_target() now enforces a floor of 14.0 instead of blindly using MACOSX_DEPLOYMENT_TARGET. Cargo/Tauri default this to 10.13 which MLX's CMakeLists.txt rejects. Higher values (e.g. 15.0) are preserved. Bumps pmetal-mlx-sys 0.2.3 → 0.2.4, pmetal-mlx-rs 0.25.6 → 0.25.7.
Add mlx_rs::memory module wrapping mlx_sys FFI calls for: - get_active_memory, get_peak_memory, get_cache_memory - get_memory_limit, set_memory_limit - set_cache_limit, set_wired_limit - clear_cache, reset_peak_memory Bump version to 0.25.8.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The branch is based on the commits used to publish
pmetal-mlx-rs 0.25.8/pmetal-mlx-sys 0.2.4, which are newer than the current default branch.Validation
cargo test -p pmetal-mlx-rs random::tests:: -- --test-threads=1(32 passed)v0.32.0