# Installing and Building the Right whisper.cpp

##### Cloning the Github repository locally

```
cd ~
git clone https://github.com/ggerganov/whisper.cpp
```

##### Build additional libraries

```
sudo apt install -y libsdl2-dev
```

##### Building `whisper-stream`

The `-j2` flag limits parallel build jobs to 2. Using `-j4` or higher may cause the Pi to crash due to memory exhaustion.

```
cd ~/whisper.cpp
rm -rf build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DWHISPER_SDL2=ON
cmake --build build --target whisper-stream -- -j2
```