Build LinuxCNC

The below is based on the fact we're currently using Debian version 12 Bookworm

Dependencies

# First install some dependencies
apt install build-essential devscripts gdebi debhelper dh-python libudev-dev autoconf automake bwidget \
intltool libboost-python-dev libepoxy-dev libgl1-mesa-dev libglu1-mesa-dev libgtk2.0-dev libgtk-3-dev libmodbus-dev \
libxmu-dev netcat-openbsd po4a python3-dev python3-tk python3-xlib tcl8.6-dev tclx tk8.6-dev yapps2 \
asciidoc dblatex docbook-xsl dvipng groff imagemagick inkscape python3-lxml source-highlight w3c-linkchecker xsltproc \
texlive-extra-utils texlive-font-utils texlive-fonts-recommended texlive-lang-cyrillic \
texlive-lang-french texlive-lang-german texlive-lang-polish texlive-lang-spanish texlive-xetex \
texlive-latex-recommended asciidoc-dblatex texlive-lang-european \
desktop-file-utils libusb-1.0-0-dev fonts-dejavu graphviz libeditreadline-dev

# Make sure the system is updated
apt update
apt upgrade
apt dist-upgrade
apt autoremove

At this point it's probably best to close / re-open the ssh session
to get python to show up in the path

Build Sources

First download the sources

git clone https://github.com/LinuxCNC/linuxcnc.git build
cd build

# Switch to the 2.9 branch
git checkout 2.9

Next to build the deb files

# run debian configure without docs
debian/configure uspace no-docs

# check for any unmet depends
dpkg-checkbuilddeps

# Build the deb
debuild -uc -us

Running Tests

To run tests

source ./scripts/rip-environment
./scripts/runtests

Running from Source

To Run from source

source ./scripts/rip-environment
./scripts/latency-histogram --nobase --sbinsize 1000 --show

Install Debs

If you want to install the generated debs

# gdebi allows us to more easily install deb files
apt install gdebi

# If you want to remove the existing installed linuxcnc
apt remove linuxcnc-uspace

# install deb files
gdebi linuxcnc-uspace_2.9.0~pre1_arm64.deb linuxcnc-uspace-dev_2.9.0~pre1_armhf.deb linuxcnc-uspace-dbgsym_2.9.0~pre1_armhf.deb