]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
metal : fix default.metallib build (llama/12224)
authorDaniel Bevenius <redacted>
Fri, 7 Mar 2025 05:23:16 +0000 (06:23 +0100)
committerGeorgi Gerganov <redacted>
Sat, 8 Mar 2025 13:13:01 +0000 (15:13 +0200)
commit548e7052f101772239f87ee5ae1e839d78c94846
tree2aba76671f291d6261b6f8a57a2f6e443f1c083c
parenta34cb73dc28068d6c5b58c5e209dd26c8eac1e0a
metal : fix default.metallib build (llama/12224)

This commit updates the custom command to build the default.metallib
file to use the correct path to ../ggml-common.h by using the variable
METALLIB_COMMON.

The motivation for this change is that currently when building and
specifying GGML_METAL_EMBED_LIBRARY=OFF the following error is
generated:
```console
[ 11%] Linking CXX shared library ../../bin/libggml.dylib
[ 11%] Built target ggml
make[2]: *** No rule to make target `ggml/src/ggml-metal/ggml-common.h', needed by `bin/default.metallib'.  Stop.
make[1]: *** [ggml/src/ggml-metal/CMakeFiles/ggml-metal-lib.dir/all] Error 2
```

With the above change the build could progress but there was a follow
on error about not being able to find the ggml-common.h file in
ggml-metal.metal where is was included as a relative path:
```console
[ 11%] Compiling Metal kernels
/Users/danbev/work/llama.cpp/build/bin/ggml-metal.metal:6:10: error: '../ggml-common.h' file not found, did you mean 'ggml-common.h'?
         ^~~~~~~~~~~~~~~~~~
         "ggml-common.h"
1 error generated.
```
Removing the relative path then allowed the build to complete
successfully.
ggml/src/ggml-metal/CMakeLists.txt
ggml/src/ggml-metal/ggml-metal.metal