Some checks failed
Bindings Tests (Go) / ubuntu-22 (push) Failing after 31s
CI (sycl) / ubuntu-22-cmake-sycl (linux/arm/v7, icx, icpx, ON) (push) Failing after 3s
CI (sycl) / ubuntu-22-cmake-sycl (linux/ppc64le, icx, icpx, ON) (push) Failing after 2s
CI (sycl) / ubuntu-22-cmake-sycl-fp16 (linux/amd64, icx, icpx, ON) (push) Failing after 3s
CI (sycl) / ubuntu-22-cmake-sycl-fp16 (linux/arm/v7, icx, icpx, ON) (push) Failing after 3s
CI (sycl) / ubuntu-22-cmake-sycl-fp16 (linux/arm64, icx, icpx, ON) (push) Failing after 3s
CI (sycl) / ubuntu-22-cmake-sycl-fp16 (linux/ppc64le, icx, icpx, ON) (push) Failing after 3s
CI (vad) / vad (push) Failing after 3s
CI (wasm) / emscripten (Release) (push) Failing after 4s
Bindings Tests (Ruby) / ubuntu-22 (push) Failing after 37s
CI (android) / android (push) Failing after 16s
CI (android) / android_java (push) Failing after 3s
CI (clang) / ubuntu-22-clang (linux/amd64, Debug) (push) Failing after 3s
CI (clang) / ubuntu-22-clang (linux/amd64, Release) (push) Failing after 2s
CI (clang) / ubuntu-22-clang (linux/ppc64le, Debug) (push) Failing after 3s
CI (clang) / ubuntu-22-clang (linux/ppc64le, Release) (push) Failing after 3s
CI (cpu) / ggml-ci-x64-cpu-low-perf (push) Failing after 3s
CI (cpu) / ggml-ci-x64-cpu-high-perf (push) Failing after 2s
CI (gcc) / ubuntu-22-gcc (linux/amd64, Debug) (push) Failing after 3s
CI (gcc) / ubuntu-22-gcc (linux/amd64, Release) (push) Failing after 3s
CI (gcc) / ubuntu-22-gcc (linux/ppc64le, Debug) (push) Failing after 3s
CI (gcc) / ubuntu-22-gcc (linux/ppc64le, Release) (push) Failing after 4s
CI (gcc) / ubuntu-22-gcc-arm-v7 (linux/arm/v7, Debug) (push) Failing after 3s
CI (gcc) / ubuntu-22-gcc-arm-v7 (linux/arm/v7, Release) (push) Failing after 3s
CI (quantize) / quantize (push) Failing after 3s
CI (sanitize) / ubuntu-22-gcc-sanitized (ADDRESS) (push) Failing after 3s
CI (sanitize) / ubuntu-22-gcc-sanitized (THREAD) (push) Failing after 3s
CI (sanitize) / ubuntu-22-gcc-sanitized (UNDEFINED) (push) Failing after 2s
CI (sycl) / ubuntu-22-cmake-sycl (linux/amd64, icx, icpx, ON) (push) Failing after 3s
CI (sycl) / ubuntu-22-cmake-sycl (linux/arm64, icx, icpx, ON) (push) Failing after 3s
Examples WASM / deploy-wasm-github-pages (push) Failing after 3s
Examples Tests / addon_node-ubuntu-22 (20.x) (push) Failing after 3s
Examples Tests / addon_node-ubuntu-22 (22.x) (push) Failing after 2s
CI (coreml) / coreml-base-en (push) Has been cancelled
CI (self-hosted) / gpu-vulkan (push) Has been cancelled
CI (self-hosted) / npu-amd-windows (push) Has been cancelled
CI (self-hosted) / gpu-vulkan-nvidia-cm2 (push) Has been cancelled
CI (clang) / ubuntu-22-clang-arm64 (Debug) (push) Has been cancelled
CI (clang) / ubuntu-22-clang-arm64 (Release) (push) Has been cancelled
CI (self-hosted) / gpu-cuda (push) Has been cancelled
CI (self-hosted) / gpu-vulkan-nvidia-cm (push) Has been cancelled
CI (cpu) / ggml-ci-arm64-cpu-low-perf (push) Has been cancelled
CI (cpu) / ggml-ci-arm64-cpu-high-perf (push) Has been cancelled
CI (cpu) / ggml-ci-arm64-cpu-high-perf-sve (push) Has been cancelled
CI (freebsd) / freeBSD-latest (push) Has been cancelled
CI (self-hosted) / gpu-metal (push) Has been cancelled
CI (gcc) / ubuntu-22-gcc-arm64 (Debug) (push) Has been cancelled
CI (gcc) / ubuntu-22-gcc-arm64 (Release) (push) Has been cancelled
CI (macOS) / macOS-latest (generic/platform=iOS) (push) Has been cancelled
CI (macOS) / macOS-latest (generic/platform=macOS) (push) Has been cancelled
CI (macOS) / macOS-latest (generic/platform=tvOS) (push) Has been cancelled
CI (self-hosted) / npu-amd-linux (push) Has been cancelled
CI (windows) / windows-msys2 (Release, clang, clang-x86_64, CLANG64) (push) Has been cancelled
CI (windows) / windows-msys2 (Release, gcc, ucrt-x86_64, UCRT64) (push) Has been cancelled
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/main-cuda.Dockerfile platform:linux/amd64 runs_on:ubuntu-24.04 tag:main-cuda]) (push) Has been cancelled
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/main-intel.Dockerfile platform:linux/amd64 runs_on:ubuntu-24.04 tag:main-intel]) (push) Has been cancelled
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/main-musa.Dockerfile platform:linux/amd64 runs_on:ubuntu-24.04 tag:main-musa]) (push) Has been cancelled
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/main-vulkan.Dockerfile platform:linux/amd64 runs_on:ubuntu-24.04 tag:main-vulkan]) (push) Has been cancelled
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/main-vulkan.Dockerfile platform:linux/arm64 runs_on:ubuntu-24.04-arm tag:main-vulkan-arm64]) (push) Has been cancelled
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/main.Dockerfile platform:linux/amd64 runs_on:ubuntu-24.04 tag:main]) (push) Has been cancelled
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/main.Dockerfile platform:linux/arm64 runs_on:ubuntu-24.04-arm tag:main-arm64]) (push) Has been cancelled
Mark inactive issues stale / mark-issues (push) Failing after 1s
128 lines
3.6 KiB
CMake
128 lines
3.6 KiB
CMake
# dependencies
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
# third-party
|
|
|
|
if (WHISPER_SDL2)
|
|
# SDL2
|
|
find_package(SDL2 REQUIRED)
|
|
|
|
string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES)
|
|
|
|
message(STATUS "SDL2_INCLUDE_DIRS = ${SDL2_INCLUDE_DIRS}")
|
|
message(STATUS "SDL2_LIBRARIES = ${SDL2_LIBRARIES}")
|
|
endif()
|
|
|
|
# common
|
|
|
|
set(TARGET common)
|
|
|
|
unset(COMMON_EXTRA_LIBS)
|
|
|
|
if (WHISPER_COMMON_FFMPEG)
|
|
# As of cmake 3.27, there is no official cmake support for FindFFmpeg.
|
|
# Consequnelty we added a FindFFmpeg.cmake script the cmake subfolder:
|
|
# whisper.cpp does not need the full ffmpeg libs, just AVFORMAT AVCODEC AVUTIL SWRESAMPLE
|
|
# libswresample performs highly optimized audio resampling, rematrixing and sample format conversion operations
|
|
# libavcodec provides a generic encoding/decoding framework and contains multiple decoders and encoders for audio, video and subtitle streams, and several bitstream filters.
|
|
# libavformat provides a generic framework for multiplexing and demultiplexing (muxing and demuxing) audio, video and subtitle streams.
|
|
find_package(FFmpeg REQUIRED)
|
|
|
|
if (NOT ${FFMPEG_FOUND})
|
|
message(FATAL_ERROR "Cannot find ffmpeg libs/headers")
|
|
endif()
|
|
|
|
message(STATUS "Found ffmpeg libs: ${FFMPEG_LIBRARIES}")
|
|
message(STATUS "Found ffmpeg headers in: ${FFMPEG_INCLUDE_DIRS}")
|
|
message(STATUS "ffmpeg definitions: ${FFMPEG_DEFINITIONS}")
|
|
message(STATUS "Found avformat ${AVFORMAT_VERSION}")
|
|
|
|
include_directories(${FFMPEG_INCLUDE_DIRS})
|
|
add_compile_definitions(WHISPER_COMMON_FFMPEG)
|
|
|
|
list(APPEND COMMON_EXTRA_LIBS ${FFMPEG_LIBRARIES})
|
|
|
|
set(COMMON_SOURCES_FFMPEG ffmpeg-transcode.cpp)
|
|
endif()
|
|
|
|
|
|
add_library(${TARGET} STATIC
|
|
common.h
|
|
common.cpp
|
|
common-ggml.h
|
|
common-ggml.cpp
|
|
common-whisper.h
|
|
common-whisper.cpp
|
|
grammar-parser.h
|
|
grammar-parser.cpp
|
|
${COMMON_SOURCES_FFMPEG}
|
|
)
|
|
|
|
include(DefaultTargetOptions)
|
|
|
|
target_link_libraries(${TARGET} PRIVATE whisper ${COMMON_EXTRA_LIBS} ${CMAKE_DL_LIBS})
|
|
|
|
set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
set_target_properties(${TARGET} PROPERTIES FOLDER "libs")
|
|
|
|
if (WHISPER_SDL2)
|
|
# common-sdl
|
|
|
|
set(TARGET common-sdl)
|
|
|
|
add_library(${TARGET} STATIC
|
|
common-sdl.h
|
|
common-sdl.cpp
|
|
)
|
|
|
|
include(DefaultTargetOptions)
|
|
|
|
target_include_directories(${TARGET} PUBLIC ${SDL2_INCLUDE_DIRS})
|
|
target_link_libraries (${TARGET} PRIVATE ${SDL2_LIBRARIES})
|
|
|
|
set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
set_target_properties(${TARGET} PROPERTIES FOLDER "libs")
|
|
endif()
|
|
|
|
# add json lib
|
|
add_library(json_cpp INTERFACE)
|
|
target_include_directories(json_cpp INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
# examples
|
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
if (EMSCRIPTEN)
|
|
add_subdirectory(whisper.wasm)
|
|
add_subdirectory(stream.wasm)
|
|
add_subdirectory(command.wasm)
|
|
add_subdirectory(bench.wasm)
|
|
add_subdirectory(wchess)
|
|
elseif(CMAKE_JS_VERSION)
|
|
add_subdirectory(addon.node)
|
|
else()
|
|
add_subdirectory(cli)
|
|
add_subdirectory(bench)
|
|
add_subdirectory(server)
|
|
add_subdirectory(quantize)
|
|
add_subdirectory(vad-speech-segments)
|
|
add_subdirectory(parakeet-cli)
|
|
add_subdirectory(parakeet-quantize)
|
|
if (WHISPER_SDL2)
|
|
add_subdirectory(stream)
|
|
add_subdirectory(command)
|
|
add_subdirectory(talk-llama)
|
|
add_subdirectory(lsp)
|
|
if (GGML_SYCL)
|
|
add_subdirectory(sycl)
|
|
endif()
|
|
endif (WHISPER_SDL2)
|
|
|
|
add_subdirectory(deprecation-warning)
|
|
endif()
|
|
|
|
if (WHISPER_SDL2)
|
|
add_subdirectory(wchess)
|
|
endif (WHISPER_SDL2)
|