Skip to content
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

Open
dkg opened this issue Dec 13, 2024 · 6 comments
Open

examples/stream does not build #2626

dkg opened this issue Dec 13, 2024 · 6 comments

Comments

@dkg
Copy link

dkg commented Dec 13, 2024

examples/stream/README.md says:

## Building

The `stream` tool depends on SDL2 library to capture audio from the microphone. You can build it like this:

```bash
# Install SDL2
# On Debian based linux distributions:
sudo apt-get install libsdl2-dev

# On Fedora Linux:
sudo dnf install SDL2 SDL2-devel

# Install SDL2 on Mac OS
brew install sdl2

make stream

Ensure you are at the root of the repo when running make stream. Not within the examples/stream dir
as the libraries needed like common-sdl.h are located within examples. Attempting to compile within
examples/steam means your compiler cannot find them and it gives an error it cannot find the file.

whisper.cpp/examples/stream$ make stream
g++     stream.cpp   -o stream
stream.cpp:6:10: fatal error: common/sdl.h: No such file or directory
    6 | #include "common/sdl.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
make: *** [<builtin>: stream] Error 1

I can confirm that running make stream fails in the way described above. But running from the root of the repo yields:

0 dkg@bob:~/src/whisper/whisper.cpp$ make stream
make: *** No rule to make target 'stream'.  Stop.
2 dkg@bob:~/src/whisper/whisper.cpp$ 
@donivpx
Copy link

donivpx commented Dec 14, 2024

I had the same issue. Already addressed here and works for me - Link

Try this from the root folder of Whisper
cmake -DWHISPER_SDL2=ON .

@Azkazar
Copy link

Azkazar commented Dec 14, 2024

I had the same issue. Already addressed here and works for me - Link

Try this from the root folder of Whisper cmake -DWHISPER_SDL2=ON .

i dont understand the steps needed, i too have the same issues, im using windows and git bash, i too have installed SDL2

hp_5C@DESKTOP-B2S5CM7 MINGW64 ~/whisper.cpp - Copy (master)
$ cmake -DWHISPER_SDL2=ON .
-- Building for: Visual Studio 17 2022
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.40.33808.0
-- The CXX compiler identification is MSVC 19.40.33808.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: C:/Program Files/Git/mingw64/bin/git.exe (found version "2.42.0.windows.2")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- ccache found, compilation results will be cached. Disable with GGML_CCACHE=OFF.
-- CMAKE_SYSTEM_PROCESSOR: AMD64
-- CMAKE_GENERATOR_PLATFORM:
-- Including CPU backend
-- Found OpenMP_C: -openmp (found version "2.0")
-- Found OpenMP_CXX: -openmp (found version "2.0")
-- Found OpenMP: TRUE (found version "2.0")
-- Performing Test HAS_AVX_1
-- Performing Test HAS_AVX_1 - Success
-- Performing Test HAS_AVX2_1
-- Performing Test HAS_AVX2_1 - Success
-- Performing Test HAS_FMA_1
-- Performing Test HAS_FMA_1 - Success
-- Performing Test HAS_AVX512_1
-- Performing Test HAS_AVX512_1 - Failed
-- Performing Test HAS_AVX512_2
-- Performing Test HAS_AVX512_2 - Failed
-- Adding CPU backend variant ggml-cpu: /arch:AVX2 GGML_AVX2;GGML_FMA;GGML_F16C
-- SDL2_INCLUDE_DIRS = C:/msys64/mingw64/include;C:/msys64/mingw64/include/SDL2
-- SDL2_LIBRARIES    = SDL2::SDL2main;SDL2::SDL2
-- Configuring done (18.0s)
-- Generating done (0.2s)
-- Build files have been written to: C:/Users/hp_5C/whisper.cpp - Copy

hp_5C@DESKTOP-B2S5CM7 MINGW64 ~/whisper.cpp - Copy (master)
$ make stream
make: *** No rule to make target 'stream'.  Stop.

@dkg
Copy link
Author

dkg commented Dec 15, 2024

Thanks for the pointers, @donivpx. What works for me on a debian system with libsdl2-dev installed is, from the repository root:

cmake -B build -DWHISPER_SDL2=ON
(cd build && make stream)

This produces the output binary in build/bin/stream

build log
0 dkg@bob:~/src/whisper/whisper.cpp$ cmake -B build -DWHISPER_SDL2=ON 
-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.45.2")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF
-- CMAKE_SYSTEM_PROCESSOR: x86_64
-- Including CPU backend
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Adding CPU backend variant ggml-cpu: -march=native 
-- SDL2_INCLUDE_DIRS = /usr/include;/usr/include/SDL2
-- SDL2_LIBRARIES    = SDL2::SDL2
-- Configuring done (0.7s)
-- Generating done (0.0s)
-- Build files have been written to: /home/dkg/src/whisper/whisper.cpp/build
0 dkg@bob:~/src/whisper/whisper.cpp$ (cd build && make -j stream)
[  3%] Building CXX object examples/CMakeFiles/common-sdl.dir/common-sdl.cpp.o
[ 11%] Building CXX object ggml/src/CMakeFiles/ggml-base.dir/ggml-backend.cpp.o
[ 11%] Building C object ggml/src/CMakeFiles/ggml-base.dir/ggml-alloc.c.o
[ 14%] Building CXX object ggml/src/CMakeFiles/ggml-base.dir/ggml-opt.cpp.o
[ 18%] Building CXX object ggml/src/CMakeFiles/ggml-base.dir/ggml-threading.cpp.o
[ 22%] Building C object ggml/src/CMakeFiles/ggml-base.dir/ggml.c.o
[ 25%] Building C object ggml/src/CMakeFiles/ggml-base.dir/ggml-aarch64.c.o
[ 29%] Building C object ggml/src/CMakeFiles/ggml-base.dir/ggml-quants.c.o
[ 33%] Linking CXX static library libcommon-sdl.a
[ 33%] Built target common-sdl
[ 37%] Linking CXX shared library libggml-base.so
[ 37%] Built target ggml-base
[ 44%] Building C object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ggml-cpu.c.o
[ 44%] Building CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/amx/amx.cpp.o
[ 48%] Building C object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ggml-cpu-quants.c.o
[ 55%] Building CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ggml-cpu.cpp.o
[ 55%] Building C object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ggml-cpu-aarch64.c.o
[ 59%] Building CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/amx/mmq.cpp.o
[ 62%] Linking CXX shared library libggml-cpu.so
[ 62%] Built target ggml-cpu
[ 66%] Building CXX object ggml/src/CMakeFiles/ggml.dir/ggml-backend-reg.cpp.o
[ 70%] Linking CXX shared library libggml.so
[ 70%] Built target ggml
[ 74%] Building CXX object src/CMakeFiles/whisper.dir/whisper.cpp.o
[ 77%] Linking CXX shared library libwhisper.so
[ 77%] Built target whisper
[ 81%] Building CXX object examples/CMakeFiles/common.dir/common-ggml.cpp.o
[ 85%] Building CXX object examples/CMakeFiles/common.dir/common.cpp.o
[ 88%] Building CXX object examples/CMakeFiles/common.dir/grammar-parser.cpp.o
[ 92%] Linking CXX static library libcommon.a
[ 92%] Built target common
[ 96%] Building CXX object examples/stream/CMakeFiles/stream.dir/stream.cpp.o
[100%] Linking CXX executable ../../bin/stream
[100%] Built target stream
0 dkg@bob:~/src/whisper/whisper.cpp$ find build/bin/ -ls
 32321789      4 drwxrwxr-x   2 dkg      dkg          4096 Dec 15 14:09 build/bin/
 32323733    396 -rwxrwxr-x   1 dkg      dkg        403264 Dec 15 14:09 build/bin/stream
0 dkg@bob:~/src/whisper/whisper.cpp$ 

@Azkazar, Note that just running cmake -DWHISPER_SDL2=ON . will actually rewrite the top-level Makefile, which might not be what you want. If you've already done that, then you might want to git restore Makefile (from the root of the git repo) to undo those changes.

@ggerganov
Copy link
Owner

I've updated the build instructions for the examples/stream tool:

https://github.com/ggerganov/whisper.cpp/tree/master/examples/stream

@Azkazar
Copy link

Azkazar commented Dec 16, 2024

@ggerganov @dkg

that doesnt work

using windows, cmake 3.31.2 (latest release 2024), git bash

Build log

hp_5C@DESKTOP-B2S5CM7 MINGW64 ~/Documents/agin/whisper.cpp (master)
$ cmake -B build -G "MinGW Makefiles" -DWHISPER_SDL2=ON
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.10 will be removed from a future version of
CMake.

Update the VERSION argument value. Or, use the ... syntax
to tell CMake that the project requires at least but has been updated
to work with policies introduced by or earlier.

-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/ucrt64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/ucrt64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: C:/Program Files/Git/mingw64/bin/git.exe (found version "2.47.1.wi
ndows.1")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- ccache found, compilation results will be cached. Disable with GGML_CCACHE=OF
F.
-- CMAKE_SYSTEM_PROCESSOR: AMD64
-- Including CPU backend
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Adding CPU backend variant ggml-cpu: -march=native
-- SDL2_INCLUDE_DIRS = C:/Users/hp_5C/Documents/installer program codingpenting/
SDL2-2.30.10/cmake/../include
-- SDL2_LIBRARIES = SDL2::SDL2main;SDL2::SDL2
-- Configuring done (6.1s)
-- Generating done (0.3s)
-- Build files have been written to: C:/Users/hp_5C/Documents/agin/whisper.cpp/b
uild

stderr "error" asked to add cstdio in common-sdl.h
hp_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

@ggerganov
Copy link
Owner

Hm, I'm not sure what is the problem. I don't have a Windows machine to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants