Skip to content

fix build on macOS when Metal is disabled#196

Open
LoganDark wants to merge 1 commit intoRWKV:masterfrom
LoganDark:cmake-ggml-blas
Open

fix build on macOS when Metal is disabled#196
LoganDark wants to merge 1 commit intoRWKV:masterfrom
LoganDark:cmake-ggml-blas

Conversation

@LoganDark
Copy link
Contributor

ggml-blas was only linked and had PIC set inside the GGML_METAL condition, but on macOS, ggml enables the BLAS backend by default (via Accelerate) regardless of whether Metal is enabled. This caused an undefined symbol error for ggml_backend_blas_reg at link time.

Decouple ggml-blas from the Metal condition by using if (TARGET ggml-blas) instead, which correctly handles all cases: macOS with or without Metal, Linux with OpenBLAS, and platforms without BLAS.

ggml-blas was only linked and had PIC set inside the GGML_METAL
condition, but on macOS, ggml enables the BLAS backend by default
(via Accelerate) regardless of whether Metal is enabled. This caused
an undefined symbol error for ggml_backend_blas_reg at link time.

Decouple ggml-blas from the Metal condition by using `if (TARGET
ggml-blas)` instead, which correctly handles all cases: macOS with
or without Metal, Linux with OpenBLAS, and platforms without BLAS.

Co-authored-by: Claude
Signed-off-by: LoganDark <4723091+LoganDark@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant