From c464c134109fe0f6f16ae2447fa1ef262e410195 Mon Sep 17 00:00:00 2001 From: Levon Date: Wed, 21 Feb 2024 17:10:59 -0600 Subject: [PATCH] stuff --- scripts/build.sh | 23 +++++++++++++++++------ scripts/install_deps.sh | 2 +- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 90403fc..8099d47 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -18,6 +18,17 @@ git clone https://github.com/Netflix/vmaf "$VMAF_DIR" --depth 1 git clone https://code.videolan.org/videolan/dav1d.git "$DAV1D_DIR" --depth 1 git clone https://gitlab.xiph.org/xiph/opus.git "$OPUS_DIR" --depth 1 +ARCH=$(arch) +EXTRA_C_FLAGS="" +if [[ "$ARCH" == "x86_64" ]] +then + EXTRA_C_FLAGS="-march=native -mtune=native" +elif [[ "$ARCH" == "aarch64" ]] +then + EXTRA_C_FLAGS="-mcpu=native" +fi +echo "EXTRA_C_FLAGS: $EXTRA_C_FLAGS" + # build svt-av1 cd "$SVT_DIR/" || exit git pull @@ -25,8 +36,8 @@ rm -rf build mkdir build cd build || exit make clean -cmake .. -DCMAKE_BUILD_TYPE=Release -DSVT_AV1_LTO=ON -DNATIVE=ON \ - -DCMAKE_C_FLAGS="-flto -O2 -mcpu=native" || exit +cmake .. -DCMAKE_BUILD_TYPE=Release -DSVT_AV1_LTO=ON \ + -DCMAKE_C_FLAGS="-O2 $EXTRA_C_FLAGS" || exit make -j "$(nproc)" || exit sudo make install || exit @@ -49,8 +60,8 @@ cd "$AOM_DIR/" || exit git pull mkdir build cd build || exit -cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON\ - -DCMAKE_C_FLAGS="-flto -O2 -mcpu=native" || exit +cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_C_FLAGS="-flto -O2 $EXTRA_C_FLAGS" || exit make -j "$(nproc)" || exit sudo make install || exit @@ -94,8 +105,8 @@ make clean ./configure --enable-libsvtav1 --enable-librav1e \ --enable-libaom --enable-libvmaf \ --enable-libdav1d --enable-libopus \ - --extra-cflags="-mcpu=native" \ - --extra-cxxflags="-mcpu=native" || exit + --extra-cflags="$EXTRA_C_FLAGS" \ + --extra-cxxflags="$EXTRA_C_FLAGS" || exit make -j "$(nproc)" || exit sudo make install || exit diff --git a/scripts/install_deps.sh b/scripts/install_deps.sh index 00c6523..cb78ca1 100755 --- a/scripts/install_deps.sh +++ b/scripts/install_deps.sh @@ -8,7 +8,7 @@ sudo "$PKG_MNG" install autoconf automake build-essential cmake git-core \ libass-dev libfreetype6-dev libsdl2-dev libtool libva-dev libvdpau-dev \ libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config \ texinfo wget zlib1g-dev nasm yasm libssl-dev time python3 meson ninja-build\ - doxygen xxd jq lshw gnuplot python3-pip curl -y || exit 1 + doxygen xxd jq lshw gnuplot python3-pip curl clang -y || exit 1 curl https://sh.rustup.rs -sSf | sh -s -- -y source "$HOME/.cargo/env"