Oracle build auto-detects nasm/yasm (SIMD when present, generic fallback)
Browse files at this commit1db238b50f45feffe4254d3dcf41dcbd9b925736Parent: 6632737- chore
- oracle build auto-detects nasm/yasm (SIMD when present, generic fallback)
1 changed file +13 -4
- scripts/build-aom-oracle.sh +13 -4
scripts/build-aom-oracle.shmodified+13 -4
| @@ -7,9 +7,10 @@ | ||
| 7 | 7 | # started SKIPping, leaving a green-but-vacuous suite. Re-run this whenever |
| 8 | 8 | # `cargo test -p ec-av1` prints "SKIP ...: no aomenc at ...". |
| 9 | 9 | # |
| 10 | -# nasm/yasm are absent on this box, so the build uses AOM_TARGET_CPU=generic | |
| 11 | -# (C only). Decode is normative, so aomdec stays bit-exact; encode is slower. | |
| 12 | -# Install nasm and drop that flag for a faster oracle. | |
| 10 | +# Needs an assembler (nasm or yasm) for the SIMD build. Without one it falls | |
| 11 | +# back to AOM_TARGET_CPU=generic (C only) automatically -- decode is normative | |
| 12 | +# so aomdec stays bit-exact either way, but encode is slower, which matters | |
| 13 | +# because every gate shells out to aomenc 40 times. Install nasm for speed. | |
| 13 | 14 | set -euo pipefail |
| 14 | 15 | |
| 15 | 16 | VERSION="${AOM_VERSION:-v3.13.3}" |
| @@ -21,11 +22,19 @@ if [ ! -d "$SRC/.git" ]; then | ||
| 21 | 22 | git clone --depth 1 --branch "$VERSION" https://aomedia.googlesource.com/aom "$SRC" |
| 22 | 23 | fi |
| 23 | 24 | |
| 25 | +CPU_ARGS=() | |
| 26 | +if [ -n "${AOM_TARGET_CPU:-}" ]; then | |
| 27 | + CPU_ARGS=(-DAOM_TARGET_CPU="$AOM_TARGET_CPU") | |
| 28 | +elif ! command -v nasm >/dev/null && ! command -v yasm >/dev/null; then | |
| 29 | + echo "no nasm/yasm found -- falling back to the C-only (generic) build" >&2 | |
| 30 | + CPU_ARGS=(-DAOM_TARGET_CPU=generic) | |
| 31 | +fi | |
| 32 | + | |
| 24 | 33 | cmake -S "$SRC" -B "$BUILD" -G Ninja \ |
| 25 | 34 | -DCMAKE_BUILD_TYPE=Release \ |
| 26 | 35 | -DENABLE_TESTS=0 -DENABLE_DOCS=0 -DENABLE_EXAMPLES=1 \ |
| 27 | 36 | -DCONFIG_INSPECTION=1 \ |
| 28 | - -DAOM_TARGET_CPU="${AOM_TARGET_CPU:-generic}" | |
| 37 | + "${CPU_ARGS[@]}" | |
| 29 | 38 | ninja -C "$BUILD" aomenc aomdec |
| 30 | 39 | |
| 31 | 40 | echo "oracle ready:" |