natrys / whisper.el

Speech-to-Text interface for Emacs using OpenAI's whisper model and whisper.cpp as inference engine.
140 stars 10 forks source link

add Windows support #9

Closed jochalek closed 1 year ago

jochalek commented 1 year ago

This solves #8

jochalek commented 1 year ago

Whisper still needs to be built separately in a MINGW64/MSYS2 environment, rather than with the automated process in this package.

natrys commented 1 year ago

Thanks a lot :)

Whisper still needs to be built separately in a MINGW64/MSYS2 environment, rather than with the automated process in this package.

I am a little curious. Is this due to PATH issues or something more sinister? If it's a PATH issue, does that have anything to do with how whisper.el is written, or Emacs can't find the utilities because they are not in exec-path?

jochalek commented 1 year ago

The reason it didn't work for me is that my default shell in emacs launches bash.exe from Git for Windows.

Sending the make command from that environment results in:

$ make
I whisper.cpp build info:
I UNAME_S:  MINGW64_NT-10.0-22621
I UNAME_P:  unknown
I UNAME_M:  x86_64
I CFLAGS:   -I.              -O3 -DNDEBUG -std=c11   -fPIC -mfma -mf16c -mavx -mavx2
I CXXFLAGS: -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC
I LDFLAGS:
I CC:       cc.exe (Rev10, Built by MSYS2 project) 12.2.0
I CXX:      g++.exe (Rev10, Built by MSYS2 project) 12.2.0

cc  -I.              -O3 -DNDEBUG -std=c11   -fPIC -mfma -mf16c -mavx -mavx2   -c ggml.c -o ggml.o
Cannot create temporary file in C:\WINDOWS\: Permission denied
make: *** [Makefile:241: ggml.o] Error 3

I did not investigate that any farther given that Git for Windows bash is not meant to be used for building software. I'm not sure if you can reasonably set a MINGW64/MSYS2 environment as the default shell. If that worked it might cause headaches in other areas and I'm happy with this working solution.