tazz4843/whisper-rs

Error building on windows.

i1Fury opened this issue · 5 comments

i1Fury commented

I followed the BUILDING.md perfectly(i tested everything in the paths and all), yet ran into this error:

error: failed to run custom build command for `whisper-rs-sys v0.6.1 (C:\Users\Elliot\Desktop\clip_it_chat\whisper-rs\sys)`

Caused by:
  process didn't exit successfully: `C:\Users\Elliot\Desktop\clip_it_chat\whisper-rs\target\debug\build\whisper-rs-sys-a11b4329329d64f0\build-script-build` (exit code: 101)
  --- stdout
  cargo:rustc-link-search=C:\Users\Elliot\Desktop\clip_it_chat\whisper-rs\target\debug\build\whisper-rs-sys-2b53c4a775c6a71b\out
  cargo:rustc-link-lib=static=whisper
  cargo:rerun-if-changed=wrapper.h

  --- stderr
  thread 'main' panicked at 'Unable to find libclang: "the `libclang` shared library at C:/msys64/mingw64\\bin\\libclang.dll could not be opened: LoadLibraryExW failed"', C:\Users\Elliot\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bindgen-0.64.0\./lib.rs:2393:31
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace```

I don't have Windows so can't really help. Quick internet search shows this: https://users.rust-lang.org/t/unable-to-find-libclang-the-libclang-issue/70746

Not sure if it helps, but might be worth a shot

i1Fury commented

It found libclang.dll just fine, its just panicking for some reason? libclang is in my msys2 bin folder which is in my path, same as gcc.

i1Fury commented

Also, if it helps, the Python version of Whisper installed through PiP works perfectly(although its much slower).

The Python version of whisper is completely unrelated. It shares zero code with whisper.cpp. See if you can build the upstream project: https://github.com/ggerganov/whisper.cpp

I got a similar error on Linux on a new system:

   Compiling whisper-rs-sys v0.6.1 (https://github.com/tazz4843/whisper-rs#3ca3a5de)
error: failed to run custom build command for `whisper-rs-sys v0.6.1 (https://github.com/tazz4843/whisper-rs#3ca3a5de)`

Caused by:
  process didn't exit successfully: `/home/niko/data/stt-service/target/release/build/whisper-rs-sys-b8d81d4d1e4a2779/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-link-lib=dylib=stdc++
  cargo:rustc-link-search=/home/niko/data/stt-service/target/release/build/whisper-rs-sys-871f3eb3a77fd66b/out
  cargo:rustc-link-lib=static=whisper
  cargo:rustc-link-lib=clblast
  cargo:rustc-link-lib=OpenCL
  cargo:rerun-if-changed=wrapper.h

  --- stderr
  thread 'main' panicked at /home/niko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.64.0/./lib.rs:2393:31:
  Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.so', 'libclang-*.so', 'libclang.so.*', 'libclang-*.so.*'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The fix was paru -S clang so I'm not sure what more to say.

Gonna go ahead and close this, PR that might've fixed was merged a while ago and 0.11 is released with it.