Skip to content

Instantly share code, notes, and snippets.

@Namburger
Last active November 19, 2023 09:23
Show Gist options
  • Save Namburger/82e86f2d3514288aa46c9183fc53c809 to your computer and use it in GitHub Desktop.
Save Namburger/82e86f2d3514288aa46c9183fc53c809 to your computer and use it in GitHub Desktop.
installing libbrosa on the Coral Dev Board
I got librosa working on the Dev Board running Mendel Day (4.0).
Some steps may not be necessary at later OS release.
1) Preparations:
The Dev Board may not have enough storage, so I suggest first to add an sdcard (I have a 16GB card), than mount it:
mkdir /home/mendel/sdcard
sudo mount /dev/mmcblk1p1 /home/mendel/sdcard
With extra storage now, we can add some swap which may be necessary for the build:
sudo fallocate -l 2G /swapfile
sudo dd if=/dev/zero of=/swapfile bs=1024 count=2097152
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
Install some dependencies:
sudo apt-get install libssl-dev
sudo apt install python3-dev
sudo apt install git
pip3 install Cython --user
Install cmake:
wget https://github.com/Kitware/CMake/releases/download/v3.17.0/cmake-3.17.0.tar.gz
tar xvf cmake-3.17.0.tar.gz
rm cmake-3.17.0.tar.gz
cd cmake-3.17.0/
./configure
make
sudo make install
2) Build some dependencies:
librosa depends on libllvmlite and an updated version of tbb, so we'll need to tackle those first:
Unfortunately, none of these libraries really has prebuilt packages for aarch64 or for some reasons
I just couldn't get it to install, so I had to build everything from scratch!
Build & install TBB:
sudo apt install libffi-dev
git clone https://github.com/wjakob/tbb.git
mkdir build && cd build
cmake ..
make
sudo make install
Build & install llvmlite
sudo apt install libllvm7:arm64 llvm llvm-7 llvm-7-dev llvm-7-runtime llvm-runtime python3-llvmlite
git clone https://github.com/numba/llvmlite.git
export LLVM_CONFIG=/usr/lib/llvm-7/bin/llvm-config
python3 setup.py build
3) Finally build and install librosa:
wget https://github.com/librosa/librosa/archive/0.7.2.tar.gz
tar -xvf 0.7.2.tar.gz librosa-0.7.2/
cd librosa-0.7.2/
python3 setup.py install
Huge thanks to llvm and librosa team for the help:
https://github.com/librosa/librosa/issues/1116
https://github.com/numba/llvmlite/issues/588
@Path-A
Copy link

Path-A commented May 26, 2022

Currently working instructions from a fresh Mendel Eagle 5.3 image:

sudo apt-get install python3-scipy 
sudo apt-get install python3-sklearn
sudo apt-get install llvm
sudo apt-get install llvm-7-dev
LLVM_CONFIG=/usr/bin/llvm-config sudo pip3 install llvmlite==0.32.0
sudo apt-get install libatlas3-base
sudo apt-get install python3-dev
sudo pip3 install numba==0.49
sudo pip3 install librosa==0.8.1

There's been some significant aarch64 support added since you've made your instructions! Thanks for being a pioneer.

@ajay78123
Copy link

does coral board support whisper and torch i am getting error while installing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment