mutablelogic/go-whisper

`make all` fails to build

Closed this issue · 3 comments

Hi, I'm looking to test your go app, and i get the following error when i try to build it:
Any help would be much appreciated, thanks!

make all
Clean
Update submodules
Submodule 'third_party/whisper.cpp' (https://github.com/ggerganov/whisper.cpp) registered for path 'third_party/whisper.cpp'
Submodule path 'third_party/whisper.cpp': checked out '21c569ba4acce5bf30fd71da609ba038c1f5129c'
Submodule path 'third_party/whisper.cpp/bindings/ios': checked out 'f6334b026f63700ff86f2a942da7ef69690d10a2'
Build whisper
sysctl: unknown oid 'hw.optional.arm64'
I whisper.cpp build info:
I UNAME_S:  Darwin
I UNAME_P:  i386
I UNAME_M:  x86_64
I CFLAGS:   -I.              -O3 -std=c11   -fPIC -pthread -mf16c -mfma -mavx -mavx2 -DGGML_USE_ACCELERATE
I CXXFLAGS: -I. -I./examples -O3 -std=c++11 -fPIC -pthread
I LDFLAGS:   -framework Accelerate
I CC:       Apple clang version 14.0.0 (clang-1400.0.29.202)
I CXX:      Apple clang version 14.0.0 (clang-1400.0.29.202)

cc  -I.              -O3 -std=c11   -fPIC -pthread -mf16c -mfma -mavx -mavx2 -DGGML_USE_ACCELERATE   -c ggml.c -o ggml.o
c++ -I. -I./examples -O3 -std=c++11 -fPIC -pthread -c whisper.cpp -o whisper.o
ar rcs libwhisper.a ggml.o whisper.o
Mkdir build models
Build cmd stream
# github.com/ggerganov/whisper.cpp/bindings/go
../../../../go/pkg/mod/github.com/ggerganov/whisper.cpp/bindings/go@v0.0.0-20230106173633-41e05c6b1b5f/whisper.go:152:19: could not determine kind of name for C.whisper_sample_best
../../../../go/pkg/mod/github.com/ggerganov/whisper.cpp/bindings/go@v0.0.0-20230106173633-41e05c6b1b5f/whisper.go:157:19: could not determine kind of name for C.whisper_sample_timestamp
make: *** [cmd/stream] Error 2

Those two functions (whisper_sample_best and whisper_sample_timestamp) were recently removed from the C++ code and it's possible that change is only in the main branch (the change is #409). Will take a look shortly. For a quick fix, just remove the functiions in whisper.go and try again!

The PR #13 may fix this issue. Please pull from main and LMK if this fixes the issue. As an aside, the code in this repo is horrible and barely works. I'll try and improve it over time, or if you are able to do that send me some changes!

thanks that solved it!