How to compile Google/Lyra v1 Codec ?

I have used Ubuntu 22.04 machine and followed the following instructions


Install bazel

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

Install Python

Lyra codec need pytho3, numpy, and six

apt install python3 python3-pip python3-numpy python3-six unzip zip

Install JDK

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

Install Android Command Line Tools

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


Set Envoirnmnet Variables

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


Download Android SDK/NDK

/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"


Download Lyra

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

How to compile and run a next application ?

Install nodejs Use  this  link for further reading curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash nvm inst...