litongjava / whisper-cpp-server

whisper-cpp-serve Real-time speech recognition and c+ of OpenAI's Whisper model in C/C++
MIT License
36 stars 6 forks source link

Cannot build on Apple #2

Closed christianwengert closed 10 months ago

christianwengert commented 10 months ago

Hi I would love to try this out, but if I do the following

git clone https://github.com/litongjava/whisper-cpp-server
cmake .

I get

CMake Error at CMakeLists.txt:11 (find_package):
  Could not find a package configuration file provided by "libuv" with any of
  the following names:

    libuvConfig.cmake
    libuv-config.cmake

  Add the installation prefix of "libuv" to CMAKE_PREFIX_PATH or set
  "libuv_DIR" to a directory containing one of the above files.  If "libuv"
  provides a separate development package or SDK, be sure it has been
  installed.

Even though I have installed libuv:

brew install libuv

Do you have any idea how to get past thgis problem?

litongjava commented 10 months ago

vcpkg install

On Mon, Dec 4, 2023, 5:32 AM christianwengert @.***> wrote:

Hi I would love to try this out, but if I do the following

git clone https://github.com/litongjava/whisper-cpp-server cmake .

I get

CMake Error at CMakeLists.txt:11 (find_package): Could not find a package configuration file provided by "libuv" with any of the following names:

libuvConfig.cmake
libuv-config.cmake

Add the installation prefix of "libuv" to CMAKE_PREFIX_PATH or set "libuv_DIR" to a directory containing one of the above files. If "libuv" provides a separate development package or SDK, be sure it has been installed.

Even though I have installed libuv:

brew install libuv

Do you have any idea how to get past thgis problem?

— Reply to this email directly, view it on GitHub https://github.com/litongjava/whisper-cpp-server/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHSKMPMFRDGES3PSRMJ5SITYHXUJDAVCNFSM6AAAAABAGFQ4L2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGAZDIMJTGYYDQNA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

litongjava commented 10 months ago

How to build it

build with cmake and vcpkg

export VCPKG_HOME=/Users/ping/vcpkg
cmake -B cmake-build-release -DCMAKE_TOOLCHAIN_FILE=$VCPKG_HOME/scripts/buildsystems/vcpkg.cmake
cmake --build cmake-build-release --config Release -- -j 12
cp ./ggml-metal.metal cmake-build-release 

run with simplest

./cmake-build-release/simplest -m models/ggml-base.en.bin test.wav

run with http-server

./cmake-build-release/whisper_http_server_base_httplib -m models/ggml-base.en.bin 

run with websocket-server

./cmake-build-release/whisper_server_base_on_uwebsockets -m models/ggml-base.en.bin

copy command

mkdir bin
cp ./ggml-metal.metal bin
cp ./cmake-build-release/simplest bin
cp ./cmake-build-release/whisper_http_server_base_httplib bin 
cp ./cmake-build-release/whisper_server_base_on_uwebsockets bin
litongjava commented 10 months ago

After executing cmake -B cmake-build-release -DCMAKE_TOOLCHAIN_FILE=$VCPKG_HOME/scripts/buildsystems/vcpkg. cmake automatically executes the vcpkg install

christianwengert commented 10 months ago

Ok, thanks. I got it working, I also had to replace the path to your /Users/ directory with my installation