Compiling Kicad on Debian Bookworm

This is an updated blog post from the 08-05-2025, to ensure that you can enjoy to compile the latest version of Kicad and its dependencies.

With my new hobby, there came the desire to learn to build and design my own PCB. With that in mind, I began to use the open source ecad solution Kicad. Now I became interested in participating in this project, but, to compile the code you have endure a few challenges - you know, collecting the dependencies,installing them, choose the right branch whiche compiles down and so on. Here I want to show you my experience with that.

First, clone the gitlab repository:

git clone https://gitlab.com/kicad/code/kicad.git
git checkout 9.0

Then, you need to install a couple of dependencies I list them in a hopefully complete list

sudo apt-get install cmake libgl-dev libglew-dev libcurl4-openssl-dev ngspice xfonts-scalable libocct-data-exchange-dev \
libocct-draw-dev libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev \
libocct-visualization-dev protobuf-compiler libprotobuf-dev swig python3 python3-pip libwxgtk3.0-gtk3-dev \
unixodbc unixodbc-dev libsecret1 libgl-dev libglu1-mesa-dev freeglut3-dev libglew-dev libglm-dev libnng-dev

First building protobuff (we use the tagged version, to prevents issues with Abseil and utf8_range )

# Install build tools
sudo apt install cmake git g++ autoconf automake libtool curl make unzip
# Clone and build Protobuf
cd software
git clone https://github.com/protocolbuffers/protobuf.git
cd ./protobuf
git fetch --tags
git checkout v21.12
# Clean old builds
rm -rf build CMakeCache.txt
mkdir build && cd build
cmake .. \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_INSTALL_PREFIX=/opt/protobuf \
  -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
  -Dprotobuf_BUILD_TESTS=OFF
make -j8
sudo make install

Now you are finally ready to build Kicad itself…​

git clone https://gitlab.com/kicad/code/kicad.git
git checkout 8.0
mkdir -p build/release
cd build/release
cmake ../.. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/kicad \
-DUSE_GLEW=ON \
-DGLEW_INCLUDE_DIR=/usr/include/GL \
-DGLEW_LIBRARY=/usr/lib/x86_64-linux-gnu/libGLEW.so \
-DGLU_LIBRARY=/usr/lib/x86_64-linux-gnu/libGLU.so \
-DOPENGL_gl_LIBRARY=/usr/lib/x86_64-linux-gnu/libGL.so \
-DOPENGL_INCLUDE_DIR=/usr/include/GL
make -j8
sudo make install
Last update: May 8, 2025