Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build on Android #1174

Open
1 of 2 tasks
thedataking opened this issue Jun 4, 2024 · 2 comments
Open
1 of 2 tasks

Build on Android #1174

thedataking opened this issue Jun 4, 2024 · 2 comments
Assignees
Labels
low priority Issues that we would like to address at some point in the future testing

Comments

@thedataking
Copy link
Collaborator

thedataking commented Jun 4, 2024

Required to quantify performance impact on phones. Scoped to aarch64 for now.

  • provision and build in CI
  • provision emulator and test the binaries we produce
@thedataking thedataking added testing low priority Issues that we would like to address at some point in the future labels Jun 4, 2024
@thedataking thedataking self-assigned this Jun 4, 2024
@thedataking
Copy link
Collaborator Author

thedataking commented Jun 21, 2024

Prerequisites:

  • Fixes on perl/build-on-android branch.
  • Rust build needs NDK 25 or later (I tested with 26.3.11579264 downloaded from this page).

Building dav1d (adjust paths as necessary):

PATH=$HOME/android_sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/linux-x86_64/bin/:$PATH \
meson build --buildtype release \
            --werror \
            --libdir lib \
            --prefix "$(pwd)/build/dav1d_install" \
            --cross-file package/crossfiles/aarch64-android.meson \
            -Ddefault_library=both \
            -Dtrim_dsp=false \
            -Dtest_rust=false

NOTE: only pass -Dtest_rust=false if building the C version from the rav1d repo. See #825 for details.

Building rav1d:

PATH="$HOME/android_sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH" \
    RUSTFLAGS="-C linker=aarch64-linux-android26-clang -L $HOME/android_sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/linux-x86_64/lib/clang/17/lib/linux/aarch64 -L $HOME/android_sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/26" \
    AR=llvm-ar \
    CC=aarch64-linux-android26-clang \
    cargo build --target aarch64-linux-android --release

@thedataking
Copy link
Collaborator Author

Commands to build with NDK 2.7 RC:

PATH=$HOME/android_sdk/ndk/27.0.11902837/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH \
meson build --buildtype release \
            --werror \
            --libdir lib \
            --prefix "$(pwd)/build/dav1d_install" \
            --cross-file package/crossfiles/aarch64-android.meson \
            -Ddefault_library=both \
            -Dtrim_dsp=false \
            -Dtest_rust=false
PATH=$HOME/android_sdk/ndk/27.0.11902837/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH \
RUSTFLAGS="-C linker=aarch64-linux-android27-clang -L $HOME/android_sdk/ndk/27.0.11902837/toolchains/llvm/prebuilt/linux-x86_64/lib/clang/17/lib/linux/aarch64 -L $HOME/android_sdk/ndk/27.0.11902837/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/27" \
    AR=llvm-ar \
    CC=aarch64-linux-android27-clang \
    cargo build --target aarch64-linux-android --release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low priority Issues that we would like to address at some point in the future testing
Projects
None yet
Development

No branches or pull requests

1 participant