-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
examples/stream
does not build
#2626
Comments
I had the same issue. Already addressed here and works for me - Link Try this from the root folder of Whisper |
i dont understand the steps needed, i too have the same issues, im using windows and git bash, i too have installed SDL2
|
Thanks for the pointers, @donivpx. What works for me on a debian system with
This produces the output binary in build log
@Azkazar, Note that just running |
I've updated the build instructions for the https://github.com/ggerganov/whisper.cpp/tree/master/examples/stream |
that doesnt work using windows, cmake 3.31.2 (latest release 2024), git bash Build log
stderr "error" asked to add cstdio in common-sdl.hhp_5C@DESKTOP-B2S5CM7 MINGW64 ~/Documents/agin/whisper.cpp (master) $ cd build && make stream [ 3%] Building C object ggml/src/CMakeFiles/ggml-base.dir/ggml.c.obj [ 7%] Building C object ggml/src/CMakeFiles/ggml-base.dir/ggml-alloc.c.obj [ 11%] Building CXX object ggml/src/CMakeFiles/ggml-base.dir/ggml-backend.cpp.ob j [ 14%] Building CXX object ggml/src/CMakeFiles/ggml-base.dir/ggml-opt.cpp.obj [ 18%] Building CXX object ggml/src/CMakeFiles/ggml-base.dir/ggml-threading.cpp. obj [ 22%] Building C object ggml/src/CMakeFiles/ggml-base.dir/ggml-quants.c.obj [ 25%] Building C object ggml/src/CMakeFiles/ggml-base.dir/ggml-aarch64.c.obj [ 29%] Linking CXX static library libggml-base.a [ 29%] Built target ggml-base [ 33%] Building C object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ggml-cpu.c.ob j C:\Users\hp_5C\Documents\agin\whisper.cpp\ggml\src\ggml-cpu\ggml-cpu.c:130:9: wa rning: "GGML_CACHE_ALIGN" redefined 130 | #define GGML_CACHE_ALIGN __declspec(align(GGML_CACHE_LINE)) | ^~~~~~~~~~~~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\ggml\src\ggml-cpu\ggml-cpu.c:70:9: not e: this is the location of the previous definition 70 | #define GGML_CACHE_ALIGN __attribute__((aligned(GGML_CACHE_LINE))) | ^~~~~~~~~~~~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\ggml\src\ggml-cpu\ggml-cpu.c: In funct ion 'atomic_store_explicit': C:\Users\hp_5C\Documents\agin\whisper.cpp\ggml\src\ggml-cpu\ggml-cpu.c:150:76: w arning: unused parameter 'mo' [-Wunused-parameter] 150 | static void atomic_store_explicit(atomic_int * ptr, LONG val, memory_ord er mo) { | ~~~~~~~~~~ ~~~^~ C:\Users\hp_5C\Documents\agin\whisper.cpp\ggml\src\ggml-cpu\ggml-cpu.c: In funct ion 'atomic_load_explicit': C:\Users\hp_5C\Documents\agin\whisper.cpp\ggml\src\ggml-cpu\ggml-cpu.c:157:65: w arning: unused parameter 'mo' [-Wunused-parameter] 157 | static LONG atomic_load_explicit(atomic_int * ptr, memory_order mo) { | ~~~~~~~~~~~~~^~ C:\Users\hp_5C\Documents\agin\whisper.cpp\ggml\src\ggml-cpu\ggml-cpu.c: In funct ion 'atomic_fetch_add_explicit': C:\Users\hp_5C\Documents\agin\whisper.cpp\ggml\src\ggml-cpu\ggml-cpu.c:164:80: w arning: unused parameter 'mo' [-Wunused-parameter] 164 | static LONG atomic_fetch_add_explicit(atomic_int * ptr, LONG inc, memory _order mo) { | ~~~~~~ ~~~~~~~^~ C:\Users\hp_5C\Documents\agin\whisper.cpp\ggml\src\ggml-cpu\ggml-cpu.c: At top l evel: C:\Users\hp_5C\Documents\agin\whisper.cpp\ggml\src\ggml-cpu\ggml-cpu.c:168:8: wa rning: type qualifiers ignored on function return type [-Wignored-qualifiers] 168 | static atomic_bool atomic_flag_test_and_set(atomic_flag * ptr) { | ^~~~~~~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\ggml\src\ggml-cpu\ggml-cpu.c: In funct ion 'atomic_thread_fence': C:\Users\hp_5C\Documents\agin\whisper.cpp\ggml\src\ggml-cpu\ggml-cpu.c:174:46: w arning: unused parameter 'mo' [-Wunused-parameter] 174 | static void atomic_thread_fence(memory_order mo) { | ~~~~~~~~~~~~~^~ C:\Users\hp_5C\Documents\agin\whisper.cpp\ggml\src\ggml-cpu\ggml-cpu.c: At top l evel: C:\Users\hp_5C\Documents\agin\whisper.cpp\ggml\src\ggml-cpu\ggml-cpu.c:1339:5: w arning: 'align' attribute directive ignored [-Wattributes] 1339 | atomic_int GGML_CACHE_ALIGN n_barrier; | ^~~~~~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\ggml\src\ggml-cpu\ggml-cpu.c:1340:5: w arning: 'align' attribute directive ignored [-Wattributes] 1340 | atomic_int GGML_CACHE_ALIGN n_barrier_passed; | ^~~~~~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\ggml\src\ggml-cpu\ggml-cpu.c:13085:6: warning: no previous prototype for 'ggml_thread_apply_affinity' [-Wmissing-proto types] 13085 | bool ggml_thread_apply_affinity(bool * mask) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~ [ 37%] Building CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ggml-cpu.cp p.obj [ 40%] Building C object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ggml-cpu-aarc h64.c.obj [ 44%] Building C object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ggml-cpu-quan ts.c.obj [ 48%] Building CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/amx/amx.cpp .obj [ 51%] Building CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/amx/mmq.cpp .obj [ 55%] Linking CXX static library libggml-cpu.a [ 55%] Built target ggml-cpu [ 59%] Building CXX object ggml/src/CMakeFiles/ggml.dir/ggml-backend-reg.cpp.obj [ 62%] Linking CXX static library libggml.a [ 62%] Built target ggml [ 66%] Building CXX object src/CMakeFiles/whisper.dir/whisper.cpp.obj [ 70%] Linking CXX static library libwhisper.a [ 70%] Built target whisper [ 74%] Building CXX object examples/CMakeFiles/common-sdl.dir/common-sdl.cpp.obj C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp: In member fun ction 'bool audio_async::init(int, int)': C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:28:17: error: 'stderr' was not declared in this scope 28 | fprintf(stderr, "%s: found %d capture devices:\n", __func__, nDe vices); | ^~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:2:1: note: 'st derr' is defined in header ''; this is probably fixable by adding '#incl ude ' 1 | #include "common-sdl.h" +++ |+#include 2 | C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:28:9: error: ' fprintf' was not declared in this scope 28 | fprintf(stderr, "%s: found %d capture devices:\n", __func__, nDe vices); | ^~~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:51:17: error: 'stderr' was not declared in this scope 51 | fprintf(stderr, "%s: attempt to open capture device %d : '%s' .. .\n", __func__, capture_id, SDL_GetAudioDeviceName(capture_id, SDL_TRUE)); | ^~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:51:17: note: ' stderr' is defined in header ''; this is probably fixable by adding '#in clude ' C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:51:9: error: ' fprintf' was not declared in this scope 51 | fprintf(stderr, "%s: attempt to open capture device %d : '%s' .. .\n", __func__, capture_id, SDL_GetAudioDeviceName(capture_id, SDL_TRUE)); | ^~~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:54:17: error: 'stderr' was not declared in this scope 54 | fprintf(stderr, "%s: attempt to open default capture device ...\ n", __func__); | ^~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:54:17: note: ' stderr' is defined in header ''; this is probably fixable by adding '#in clude ' C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:54:9: error: ' fprintf' was not declared in this scope 54 | fprintf(stderr, "%s: attempt to open default capture device ...\ n", __func__); | ^~~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:59:17: error: 'stderr' was not declared in this scope 59 | fprintf(stderr, "%s: couldn't open an audio device for capture: %s!\n", __func__, SDL_GetError()); | ^~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:59:17: note: ' stderr' is defined in header ''; this is probably fixable by adding '#in clude ' C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:59:9: error: ' fprintf' was not declared in this scope 59 | fprintf(stderr, "%s: couldn't open an audio device for capture: %s!\n", __func__, SDL_GetError()); | ^~~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:64:17: error: 'stderr' was not declared in this scope 64 | fprintf(stderr, "%s: obtained spec for input device (SDL Id = %d ):\n", __func__, m_dev_id_in); | ^~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:64:17: note: ' stderr' is defined in header ''; this is probably fixable by adding '#in clude ' C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:64:9: error: ' fprintf' was not declared in this scope 64 | fprintf(stderr, "%s: obtained spec for input device (SDL Id = %d ):\n", __func__, m_dev_id_in); | ^~~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp: In member fun ction 'bool audio_async::resume()': C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:82:17: error: 'stderr' was not declared in this scope 82 | fprintf(stderr, "%s: no audio device to resume!\n", __func__); | ^~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:82:17: note: ' stderr' is defined in header ''; this is probably fixable by adding '#in clude ' C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:82:9: error: ' fprintf' was not declared in this scope 82 | fprintf(stderr, "%s: no audio device to resume!\n", __func__); | ^~~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:87:17: error: 'stderr' was not declared in this scope 87 | fprintf(stderr, "%s: already running!\n", __func__); | ^~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:87:17: note: ' stderr' is defined in header ''; this is probably fixable by adding '#in clude ' C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:87:9: error: ' fprintf' was not declared in this scope 87 | fprintf(stderr, "%s: already running!\n", __func__); | ^~~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp: In member fun ction 'bool audio_async::pause()': C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:100:17: error: 'stderr' was not declared in this scope 100 | fprintf(stderr, "%s: no audio device to pause!\n", __func__); | ^~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:100:17: note: 'stderr' is defined in header ''; this is probably fixable by adding '#i nclude ' C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:100:9: error: 'fprintf' was not declared in this scope 100 | fprintf(stderr, "%s: no audio device to pause!\n", __func__); | ^~~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:105:17: error: 'stderr' was not declared in this scope 105 | fprintf(stderr, "%s: already paused!\n", __func__); | ^~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:105:17: note: 'stderr' is defined in header ''; this is probably fixable by adding '#i nclude ' C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:105:9: error: 'fprintf' was not declared in this scope 105 | fprintf(stderr, "%s: already paused!\n", __func__); | ^~~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp: In member fun ction 'bool audio_async::clear()': C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:118:17: error: 'stderr' was not declared in this scope 118 | fprintf(stderr, "%s: no audio device to clear!\n", __func__); | ^~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:118:17: note: 'stderr' is defined in header ''; this is probably fixable by adding '#i nclude ' C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:118:9: error: 'fprintf' was not declared in this scope 118 | fprintf(stderr, "%s: no audio device to clear!\n", __func__); | ^~~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:123:17: error: 'stderr' was not declared in this scope 123 | fprintf(stderr, "%s: not running!\n", __func__); | ^~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:123:17: note: 'stderr' is defined in header ''; this is probably fixable by adding '#i nclude ' C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:123:9: error: 'fprintf' was not declared in this scope 123 | fprintf(stderr, "%s: not running!\n", __func__); | ^~~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp: In member fun ction 'void audio_async::get(int, std::vector&)': C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:175:17: error: 'stderr' was not declared in this scope 175 | fprintf(stderr, "%s: no audio device to get audio from!\n", __fu nc__); | ^~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:175:17: note: 'stderr' is defined in header ''; this is probably fixable by adding '#i nclude ' C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:175:9: error: 'fprintf' was not declared in this scope 175 | fprintf(stderr, "%s: no audio device to get audio from!\n", __fu nc__); | ^~~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:180:17: error: 'stderr' was not declared in this scope 180 | fprintf(stderr, "%s: not running!\n", __func__); | ^~~~~~ C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:180:17: note: 'stderr' is defined in header ''; this is probably fixable by adding '#i nclude ' C:\Users\hp_5C\Documents\agin\whisper.cpp\examples\common-sdl.cpp:180:9: error: 'fprintf' was not declared in this scope 180 | fprintf(stderr, "%s: not running!\n", __func__); | ^~~~~~~ make[3]: *** [examples\CMakeFiles\common-sdl.dir\build.make:79: examples/CMakeFi les/common-sdl.dir/common-sdl.cpp.obj] Error 1 make[2]: *** [CMakeFiles\Makefile2:610: examples/CMakeFiles/common-sdl.dir/all] Error 2 make[1]: *** [CMakeFiles\Makefile2:688: examples/stream/CMakeFiles/stream.dir/ru le] Error 2 make: *** [Makefile:259: stream] Error 2 added #include into common-sdl.h and running "cd build && make stream once again at root"hp_5C@DESKTOP-B2S5CM7 MINGW64 ~/Documents/agin/whisper.cpp (master) $ cd build && make stream [ 29%] Built target ggml-base [ 55%] Built target ggml-cpu [ 62%] Built target ggml [ 70%] Built target whisper [ 74%] Building CXX object examples/CMakeFiles/common-sdl.dir/common-sdl.cpp.obj [ 77%] Linking CXX static library libcommon-sdl.a [ 77%] Built target common-sdl [ 81%] Building CXX object examples/CMakeFiles/common.dir/common.cpp.obj [ 85%] Building CXX object examples/CMakeFiles/common.dir/common-ggml.cpp.obj [ 88%] Building CXX object examples/CMakeFiles/common.dir/grammar-parser.cpp.obj [ 92%] Linking CXX static library libcommon.a [ 92%] Built target common [ 96%] Building CXX object examples/stream/CMakeFiles/stream.dir/stream.cpp.obj [100%] Linking CXX executable ..\..\bin\stream.exe collect2.exe: error: ld returned 116 exit status make[3]: *** [examples\stream\CMakeFiles\stream.dir\build.make:112: bin/stream.exe] Error 1 make[3]: *** Deleting file 'bin/stream.exe' make[2]: *** [CMakeFiles\Makefile2:681: examples/stream/CMakeFiles/stream.dir/all] Error 2 make[1]: *** [CMakeFiles\Makefile2:688: examples/stream/CMakeFiles/stream.dir/rule] Error 2 make: *** [Makefile:259: stream] Error 2 |
Hm, I'm not sure what is the problem. I don't have a Windows machine to test. |
examples/stream/README.md
says:Ensure you are at the root of the repo when running
make stream
. Not within theexamples/stream
diras the libraries needed like
common-sdl.h
are located withinexamples
. Attempting to compile withinexamples/steam
means your compiler cannot find them and it gives an error it cannot find the file.I can confirm that running
make stream
fails in the way described above. But running from the root of the repo yields:The text was updated successfully, but these errors were encountered: