mirror of
https://github.com/chidiwilliams/buzz.git
synced 2026-03-17 16:10:08 +01:00
Linux build adjustments
This commit is contained in:
parent
a1373a7604
commit
71b6bf43b0
1 changed files with 35 additions and 19 deletions
54
Makefile
54
Makefile
|
|
@ -80,33 +80,45 @@ ifeq ($(OS), Windows_NT)
|
|||
cmake --build whisper.cpp/build -j --config Release --verbose
|
||||
|
||||
cp whisper.cpp/build/bin/Release/whisper-server.exe buzz/
|
||||
else
|
||||
endif
|
||||
|
||||
ifeq ($(shell uname -s), Linux)
|
||||
# Build Whisper for CPU
|
||||
-rm -rf whisper.cpp/build || true
|
||||
-mkdir -p buzz/whisper_cpp
|
||||
cmake -S whisper.cpp -B whisper.cpp/build/ -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_RPATH='$$ORIGIN' -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
|
||||
cmake --build whisper.cpp/build -j --config Release --verbose
|
||||
cp whisper.cpp/build/bin/Release/whisper$(LIBEXT) buzz/whisper_cpp || true
|
||||
cp whisper.cpp/build/bin/Release/ggml$(LIBEXT) buzz/whisper_cpp || true
|
||||
cp whisper.cpp/build/bin/Release/ggml-base$(LIBEXT) buzz/whisper_cpp || true
|
||||
cp whisper.cpp/build/bin/Release/ggml-cpu$(LIBEXT) buzz/whisper_cpp || true
|
||||
cp whisper.cpp/build/src/libwhisper.so buzz/whisper_cpp/libwhisper.so || true
|
||||
cp whisper.cpp/build/ggml/src/libggml.so buzz/whisper_cpp || true
|
||||
cp whisper.cpp/build/ggml/src/libggml-base.so buzz/whisper_cpp || true
|
||||
cp whisper.cpp/build/ggml/src/libggml-cpu.so buzz/whisper_cpp || true
|
||||
|
||||
# Build Whisper for Vulkan
|
||||
ifeq ($(shell uname -s), Linux)
|
||||
rm -rf whisper.cpp/build || true
|
||||
-mkdir -p buzz/whisper_cpp_vulkan
|
||||
cmake -S whisper.cpp -B whisper.cpp/build/ -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_RPATH='$$ORIGIN' -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DGGML_VULKAN=1
|
||||
cmake --build whisper.cpp/build -j --config Release --verbose
|
||||
cp whisper.cpp/build/bin/Release/whisper$(LIBEXT) buzz/whisper_cpp_vulkan/whisper-vulkan$(LIBEXT) || true
|
||||
cp whisper.cpp/build/bin/Release/ggml$(LIBEXT) buzz/whisper_cpp_vulkan || true
|
||||
cp whisper.cpp/build/bin/Release/ggml-base$(LIBEXT) buzz/whisper_cpp_vulkan || true
|
||||
cp whisper.cpp/build/bin/Release/ggml-cpu$(LIBEXT) buzz/whisper_cpp_vulkan || true
|
||||
cp whisper.cpp/build/bin/Release/ggml-vulkan/libggml-vulkan$(LIBEXT) buzz/whisper_cpp_vulkan || true
|
||||
endif
|
||||
rm -rf whisper.cpp/build || true
|
||||
-mkdir -p buzz/whisper_cpp_vulkan
|
||||
cmake -S whisper.cpp -B whisper.cpp/build/ -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_RPATH='$$ORIGIN' -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DGGML_VULKAN=1
|
||||
cmake --build whisper.cpp/build -j --config Release --verbose
|
||||
cp whisper.cpp/build/src/libwhisper.so buzz/whisper_cpp_vulkan/whisper-vulkan.so || true
|
||||
cp whisper.cpp/build/ggml/src/libggml.so buzz/whisper_cpp_vulkan || true
|
||||
cp whisper.cpp/build/ggml/src/libggml-base.so buzz/whisper_cpp_vulkan || true
|
||||
cp whisper.cpp/build/ggml/src/libggml-cpu.so buzz/whisper_cpp_vulkan || true
|
||||
cp whisper.cpp/build/ggml/src/ggml-vulkan/libggml-vulkan.so buzz/whisper_cpp_vulkan || true
|
||||
endif
|
||||
# Build on Macs
|
||||
ifeq ($(shell uname -s), Darwin)
|
||||
|
||||
# Build Whisper for CPU
|
||||
-rm -rf whisper.cpp/build || true
|
||||
-mkdir -p buzz/whisper_cpp
|
||||
cmake -S whisper.cpp -B whisper.cpp/build/ -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_RPATH='$$ORIGIN' -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
|
||||
cmake --build whisper.cpp/build -j --config Release --verbose
|
||||
cp whisper.cpp/build/src/libwhisper.so.1.7.5 buzz/whisper_cpp/libwhisper.so || true
|
||||
cp whisper.cpp/build/ggml/src/libggml.so buzz/whisper_cpp || true
|
||||
cp whisper.cpp/build/ggml/src/libggml-base.so buzz/whisper_cpp || true
|
||||
cp whisper.cpp/build/ggml/src/libggml-cpu.so buzz/whisper_cpp || true
|
||||
|
||||
# Build CoreML support on ARM Macs
|
||||
ifeq ($(shell uname -m), arm64)
|
||||
ifeq ($(shell uname -s), Darwin)
|
||||
rm -rf whisper.cpp/build || true
|
||||
mkdir -p buzz/whisper_cpp_coreml
|
||||
cmake -S whisper.cpp -B whisper.cpp/build/ -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_RPATH='$$ORIGIN' -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DWHISPER_COREML=1
|
||||
|
|
@ -119,12 +131,16 @@ endif
|
|||
buzz/whisper_cpp.py: buzz/whisper_cpp translation_mo
|
||||
ifeq ($(OS), Windows_NT)
|
||||
cd buzz && ctypesgen ../whisper.cpp/include/whisper.h -I../whisper.cpp/ggml/include -lwhisper -o ./whisper_cpp/whisper_cpp.py
|
||||
else
|
||||
endif
|
||||
|
||||
ifeq ($(shell uname -s), Linux)
|
||||
cd buzz && ctypesgen ../whisper.cpp/include/whisper.h -I../whisper.cpp/ggml/include -lwhisper -o ./whisper_cpp/whisper_cpp.py
|
||||
cd buzz && ctypesgen ../whisper.cpp/include/whisper.h -I../whisper.cpp/ggml/include -lwhisper-vulkan -o ./whisper_cpp_vulkan/whisper_cpp_vulkan.py
|
||||
endif
|
||||
ifeq ($(shell uname -m), arm64)
|
||||
|
||||
ifeq ($(shell uname -s), Darwin)
|
||||
cd buzz && ctypesgen ../whisper.cpp/include/whisper.h -I../whisper.cpp/ggml/include -lwhisper -o ./whisper_cpp/whisper_cpp.py
|
||||
ifeq ($(shell uname -m), arm64)
|
||||
cd buzz && ctypesgen ../whisper.cpp/include/whisper.h -I../whisper.cpp/ggml/include -lwhisper-coreml -o ./whisper_cpp_coreml/whisper_cpp_coreml.py
|
||||
endif
|
||||
endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue