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

Add meson build support for wrapdb #1455

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/bench/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
benchmark(
'bench',
executable('bench', 'bench.cpp', dependencies: [whisper_dep]),
workdir: meson.project_source_root(),
)
10 changes: 10 additions & 0 deletions examples/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
subdir('bench')

# common_lib = library(
# 'common_lib',
# 'common-ggml.cpp',
# dependencies: [whisper_dep],
# )

# common_dep = declare_dependency(link_with: common_lib)

55 changes: 55 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
project('whisper.cpp', ['cpp', 'c'], version: '1.5.0')

cc = meson.get_compiler('c')

if build_machine.system() == 'linux'
add_project_arguments('-D_GNU_SOURCE', language: 'c')
endif

math = cc.find_library('m', required: true)
threads = dependency('threads')

if not get_option('no_avx')
add_project_arguments('-mavx', language: 'c')
endif

if not get_option('no_avx2')
add_project_arguments('-mavx2', language: 'c')
endif

if not get_option('no_fma')
add_project_arguments('-mfma', language: 'c')
endif

if not get_option('no_f16C')
add_project_arguments('-mf16c', language: 'c')
endif

ggml_lib = library(
'ggml',
'ggml.c',
'ggml-alloc.c',
'ggml-backend.c',
'ggml-quants.c',
dependencies: [math, threads],
)
ggml_dep = declare_dependency(
dependencies: [math, threads],
include_directories: '.',
link_with: ggml_lib,
)

whisper_lib = library(
'whisper',
'whisper.cpp',
dependencies: [ggml_dep],
)
whisper_dep = declare_dependency(
include_directories: '.',
dependencies: [ggml_dep],
link_with: whisper_lib,
)

if get_option('build_examples')
subdir('examples')
endif
10 changes: 10 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
option('no_avx', type: 'boolean', value: false, description: 'Disable AVX')
option('no_avx2', type: 'boolean', value: false, description: 'Disable AVX2')
option('no_fma', type: 'boolean', value: false, description: 'Disable FMA')
option('no_f16C', type: 'boolean', value: false, description: 'Disable F16c')
option(
'build_examples',
type: 'boolean',
value: false,
description: 'Build examples',
)
Loading