As a follow up to the last post, I recently needed to make a static binary release of whisper.cpp.
At some point whisper.cpp split out the old main
binary into multiple binaries, among them whisper-cli
and whisper-server
.
In this split both binaries now use shared libraries, which makes sense, except for when you want to make it easy to run them on another machine.
So spelunking through some github issues as you do, because lets be honest, you are seldomly the first person to have a problem I found a issue creating the Go bindings, and turns out there is a build switch for it.
# build static release for macos
cmake -B build -DGGML_METAL_EMBED_LIBRARY=1 -DGGML_METAL=1 -DBUILD_SHARED_LIBS=0
cmake --build build -j --config Release
So the relevant build switch is BUILD_SHARED_LIBS
.
In reality building on MacOS should automatically turn on GGML_METAL
, but I include it just to be sure.