I have used Ubuntu 22.04 machine and followed the following instructions
Add Repo for Bazel. If you are using any other OS please follow the documentation
sudo apt install apt-transport-https curl gnupg -y
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor >bazel-archive-keyring.gpg
sudo mv bazel-archive-keyring.gpg /usr/share/keyrings
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/bazel-archive-keyring.gpg] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
Install bazel v5.3.2
apt update
apt install bazel=5.3.2
Lyra codec need pytho3, numpy, and six
apt install python3 python3-pip python3-numpy python3-six unzip zip
Download OracleJDK version 21
wget https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.deb
dpkg -i jdk-21_linux-x64_bin.deb
Download sdkmanager
wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
unzip commandlinetools-linux-11076708_latest.zip
mv cmdline-tools /usr/local/android-cmd
vim /root/.bashrc
export ANDROID_NDK_HOME=$HOME/android/sdk/ndk/21.4.7075529
export ANDROID_HOME=$HOME/android/sdk
export JAVA_HOME=/usr/lib/jvm/jdk-21.0.5-oracle-x64
export PYTHON_BIN_PATH=/usr/bin/python3
/usr/local/android-cmd/bin/sdkmanager --sdk_root=$HOME/android/sdk --list
/usr/local/android-cmd/bin/sdkmanager --sdk_root=$HOME/android/sdk --install "platforms;android-30" "build-tools;30.0.3" "ndk;21.4.7075529"
git clone https://github.com/hamidrhashmi/lyra.git
cd lyra
bazel sync
bazel build -c opt lyra/android_example:lyra_android_lib --config=android_arm64
If you want to create the binaries for Linux
bazel build -c opt lyra/cli_example:encoder_main --config=android_arm64
bazel build -c opt lyra/cli_example:decoder_main --config=android_arm64
Enjoy 😉
No comments:
Post a Comment