whisper.cpp icon indicating copy to clipboard operation
whisper.cpp copied to clipboard

Golang Bindings Error

Open mbaxamb3333 opened this issue 1 year ago • 3 comments

I would like to start by saying a big thank you for all the work that you put into maintaining and developing this project. My issue is with regards to the golang bindings. As I try to initialise the model, I get the following error.

../go/pkg/mod/github.com/ggerganov/whisper.cpp/bindings/[email protected]/params.go:11:10: fatal error: 'whisper.h' file not found #include <whisper.h>

Does anyone has any idea why this might happen?

mbaxamb3333 avatar Jan 17 '23 07:01 mbaxamb3333

The same thing happens when I try to run the whisper_test file.

Running tool: /opt/homebrew/bin/go test -timeout 30s -coverprofile=/var/folders/y0/dbsx2zd55lz31wt__nmdgm840000gn/T/vscode-goJry90s/go-code-cover github.com/ggerganov/whisper.cpp/bindings/go

github.com/ggerganov/whisper.cpp/bindings/go

/var/folders/y0/dbsx2zd55lz31wt__nmdgm840000gn/T/go-build3341714362/b084/params.cover.go:11:10: fatal error: 'whisper.h' file not found #include <whisper.h> ^~~~~~~~~~~ 1 error generated. FAIL github.com/ggerganov/whisper.cpp/bindings/go [build failed] FAIL

mbaxamb3333 avatar Jan 17 '23 10:01 mbaxamb3333

When I run the tests from the make file everything works fine, whilst when I run the package test, it fails with the error above

mbaxamb3333 avatar Jan 17 '23 12:01 mbaxamb3333

Screenshot 2023-01-17 at 13 10 09

mbaxamb3333 avatar Jan 17 '23 13:01 mbaxamb3333

I believe this has been resolved at some point. Feel free to reopen if problem persists

ggerganov avatar Feb 15 '23 18:02 ggerganov

mbaxamb3333 This typically means you need to tell the go compiler where your whisper.cpp files are located. Try setting these environment variables

export CGO_CFLAGS=-I/path/to/whisper.cpp/ export CGO_LDFLAGS=-L/path/to//whisper.cpp/

On Thu, 16 Feb 2023 at 04:38, Georgi Gerganov @.***> wrote:

I believe this has been resolved at some point. Feel free to reopen if problem persists

— Reply to this email directly, view it on GitHub https://github.com/ggerganov/whisper.cpp/issues/418#issuecomment-1431835186, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALQR6YJHPDHVD4JYZ6MEL3WXUPDPANCNFSM6AAAAAAT5Q73H4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Sincerely

Jay

jaybinks avatar Feb 16 '23 01:02 jaybinks