48 lines
1.7 KiB
Bash
Executable File
48 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Rebuild de tts_pipeline pour la tablette (arm64-v8a, API 31, NDK r27d).
|
|
# Reproduit le binaire dist/b-jni/tts_pipeline avec les sources actuelles
|
|
# (cp_inference.cpp avec KV cache + tts_pipeline.cpp avec switch KZTTS_CP_CACHE).
|
|
#
|
|
# Pas via CMake parce que dist/CMakeLists.txt ne couvre que libkazeia_engine.so :
|
|
# l'ancien binaire avait été buildé à la main, on reste cohérent avec ça.
|
|
set -euo pipefail
|
|
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
NDK_ROOT="${ANDROID_NDK_ROOT:-/opt/Kazeia/android-ndk-r27d}"
|
|
CXX="$NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android31-clang++"
|
|
[ -x "$CXX" ] || { echo "clang++ introuvable: $CXX"; exit 1; }
|
|
|
|
JNI="$HERE/jni"
|
|
INC="$HERE/include"
|
|
LIB="$HERE/lib"
|
|
OUT="$HERE/b-jni/tts_pipeline"
|
|
DECODER_DIR="/opt/Kazeia/kazeia-tts-decoder-ggml"
|
|
DECODER_INC="$DECODER_DIR/src"
|
|
DECODER_A="$DECODER_DIR/build-android-engine/libqwen3tts-decoder.a"
|
|
[ -f "$DECODER_A" ] || { echo "libqwen3tts-decoder.a absent: $DECODER_A"; exit 1; }
|
|
|
|
mkdir -p "$HERE/b-jni"
|
|
|
|
# -DGGML_USE_HEXAGON pas requis ici, on linke juste la lib ggml dynamique du dist/lib.
|
|
# -O3 + i8mm/bf16/dotprod/fp16 = baseline Snapdragon 8 Elite (cf CLAUDE.md).
|
|
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" -I"$DECODER_INC" )
|
|
LIBS=(
|
|
"$JNI/tts_pipeline.cpp"
|
|
"$JNI/cp_inference.cpp"
|
|
"$JNI/sampler.cpp"
|
|
"$JNI/kazeia_text_tokenizer.cpp"
|
|
"$DECODER_A"
|
|
-L"$LIB" -lllama -lggml -lggml-base -lggml-cpu
|
|
-Wl,-rpath,'$ORIGIN'
|
|
-llog -ldl -lm
|
|
)
|
|
|
|
echo "== building tts_pipeline =="
|
|
"$CXX" "${CFLAGS[@]}" "${INCS[@]}" "${LIBS[@]}" -o "$OUT"
|
|
echo "== built: $OUT =="
|
|
ls -la "$OUT"
|