From 432a7430cc4a85f90d6a1ea43cd2dc91037ab5d8 Mon Sep 17 00:00:00 2001 From: 0/0 Date: Sun, 9 Oct 2022 20:56:12 -0600 Subject: [PATCH] add building instructions --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 1c843a5..ab783cf 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,21 @@ See [examples/basic_use.rs](examples/basic_use.rs) for more details. Lower level bindings are exposed if needed, but the above should be enough for most use cases. See the docs: https://docs.rs/whisper-rs/ for more details. +## Building +By default, you will experience a vague error from rustc about not being able to "find native static library \`whisper`" + +To resolve this, you need to clone the original `whisper.cpp` repo and build it. Then, set `RUSTFLAGS` to point to the built library. + +You also need to link against the C++ standard library, which can be done with the `-lstdc++` flag. + +```shell +git clone https://github.com/ggerganov/whisper.cpp +cd whisper.cpp +make libwhisper.a +cd .. +RUSTFLAGS="-L whisper.cpp/ -Clink-args=-lstdc++" cargo build +``` + ## License [Unlicense](LICENSE)