tazz4843/whisper-rs

Enabling CoreML Support produces link error with v1.3.0

Closed this issue · 2 comments

jcsoo commented

Whisper.cpp v1.3.0 has optional support for CoreML acceleration, which speeds up inference significantly (about 4x for me on a MacBook Air M1). To test this out, I added -DWHISPER_COREML=1 to the cmake command in build.rs, but got an error in the linking step:

 = note: Undefined symbols for architecture arm64:
            "_whisper_coreml_encode", referenced from:
                whisper_encode_internal(whisper_context&, whisper_state&, int, int) in libwhisper_rs_sys-c9402f202599effc.rlib(whisper.cpp.o)
            "_whisper_coreml_free", referenced from:
                _whisper_free_state in libwhisper_rs_sys-c9402f202599effc.rlib(whisper.cpp.o)
            "_whisper_coreml_init", referenced from:
                _whisper_init_state in libwhisper_rs_sys-c9402f202599effc.rlib(whisper.cpp.o)
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

My guess is that this an upstream issue where the symbols aren't getting exported publicly when building the library, but my C++ isn't good enough to figure out a solution. Hoping that someone can verify that there isn't anything else we should be doing to enable this.

I have no way to check this, so your best chance at getting this fixed is going to be hoping someone else can reproduce it. Sorry about that.

May be closed by #35