okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-mmq-default-off: build the engine without llama.cpp's MMQ kernels by default (-DSTRATA_MMQ=ON keeps the old path; linux-aarch64 unchanged)5649b9e52

main
1.1 KiB21 linesraw
1# packaging/engine_targets.sh - the engine targets a configured build tree has (sourced, POSIX sh).
2#
3#   targets=$(engine_targets <cmake> <build dir>)
4#   "$cmake" --build "$build" --target $targets ...
5#
6# Prints "strata strata_kq" when the tree has the strata_kq target (libstrata_kq.so, the K-quant prompt kernels of a build with
7# llama.cpp's MMQ, -DSTRATA_MMQ=ON) and "strata" when it has not (STRATA_MMQ=OFF, the default). The build tree is asked
8# (a dry run of strata_kq), not the configure line: whether strata_kq exists also depends on STRATA_MMQ_KQUANTS and on defaults
9# the line need not name. Any other failure of the dry run stops the build instead of leaving the library out.
10engine_targets() {
11  if _et_probe=$("$1" --build "$2" --target strata_kq -- -n 2>&1); then
12    echo "strata strata_kq"
13    return 0
14  fi
15  case "$_et_probe" in
16    *"unknown target 'strata_kq'"*|*"No rule to make target"*strata_kq*) echo "strata" ;;
17    *) printf '%s\n' "$_et_probe" >&2
18       echo "engine_targets.sh: cannot tell whether the build tree $2 has the strata_kq target" >&2
19       return 1 ;;
20  esac
21}