32 lines
886 B
Bash
Executable File
32 lines
886 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build kazeia_speaker_encode (Qwen3-TTS ECAPA-TDNN speaker encoder en ggml C++).
|
|
# Statique contre les libs Kazeia-Engine principales (ql/ggml, qualcomm fork).
|
|
set -euo pipefail
|
|
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
NDK="${ANDROID_NDK_ROOT:-/opt/Kazeia/android-ndk-r27d}"
|
|
CXX="$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android31-clang++"
|
|
|
|
JNI="$HERE/jni"
|
|
INC="$HERE/include"
|
|
LIB="$HERE/lib"
|
|
OUT="$HERE/b-jni/kazeia_speaker_encode"
|
|
|
|
mkdir -p "$HERE/b-jni"
|
|
|
|
CFLAGS=(
|
|
-std=c++17 -O3 -fPIE
|
|
-march=armv8.6-a+i8mm+bf16+dotprod+fp16
|
|
-Wno-unused-parameter -Wno-unused-variable -Wno-sign-compare
|
|
)
|
|
INCS=( -I"$INC" )
|
|
LIBS=(
|
|
"$JNI/speaker_encoder.cpp"
|
|
-L"$LIB" -lggml -lggml-base -lggml-cpu
|
|
-Wl,-rpath,'$ORIGIN'
|
|
-llog -ldl -lm
|
|
)
|
|
|
|
echo "== building $OUT =="
|
|
"$CXX" "${CFLAGS[@]}" "${INCS[@]}" "${LIBS[@]}" -o "$OUT"
|
|
ls -la "$OUT"
|