Skip to content
Closed
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
6 changes: 6 additions & 0 deletions docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ adapters and separate `riva_server` executable are needed.

The preset selects which components and ggml backend are compiled.

On x86_64 hosts, CPU presets disable ggml's native-architecture optimization
by default so portable artifacts do not require instruction sets from the build
host. On other architectures, the preset keeps ggml's normal defaults so that
architecture-specific kernels remain available. Pass `-DGGML_NATIVE=ON` or
`-DGGML_NATIVE=OFF` explicitly when the target requires a different choice.

Additional CMake definitions can follow the preset:

```bash
Expand Down
17 changes: 16 additions & 1 deletion scripts/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,19 @@ if [ "${#missing[@]}" -ne 0 ]; then
exit 1
fi

cmake --preset "$PRESET" "$@"
case "$PRESET" in
cpu-*)
case "$(uname -m)" in
x86_64|amd64)
ggml_native="$(cmake_bool_override GGML_NATIVE OFF "$@")"
cmake --preset "$PRESET" "-DGGML_NATIVE=$ggml_native" "$@"
;;
*)
cmake --preset "$PRESET" "$@"
;;
esac
;;
*)
cmake --preset "$PRESET" "$@"
;;
esac