LinuxCNC can now be run under the Xenomai and RT_PREEMPT kernels as well as RTAI. This work however has not been integrated and packaged yet, so some assembly is required. This wiki page is meant as a temporary guideline until the code is merged and installation can proceed through normal package installation.
As of now, the following platforms are supported:
For the ARM platform, there's one choice only.
As for PC/X86 platforms the rule of thumb is: Xenomai will give better real time performance, and RT_PREEMPT will be easier to be upgrade downstream. If you use a soft stepper configuration, I'd suggest trying with Xenomai first.
I assume the machine is running either Ubuntu 10.04 LTS or Ubuntu Precise (12.04) fresh install which did not have LinuxCNC installed or built on it before; if you are using an install which already has been used to compile LinuxCNC before, most of the prerequisite packages are likely installed already; see under 'Installing LinuxCNC' below.
Steps for other distros should be very similar.
This post might be useful: http://www.anderswallin.net/2012/12/linuxcnc-on-ubuntu-12-04lts/ - note some package names have been update since.
Fetch the Xenomai 3.2.21 operating system and support packages:
$ cd /tmp $ wget http://static.mah.priv.at/public/xenomai-debs/linux-headers-3.2.21-xenomai+_0.2_i386.deb $ wget http://static.mah.priv.at/public/xenomai-debs/linux-image-3.2.21-xenomai+_0.2_i386.deb $ wget http://static.mah.priv.at/public/xenomai-debs/libxenomai1_2.6.1_i386.deb $ wget http://static.mah.priv.at/public/xenomai-debs/libxenomai-dev_2.6.1_i386.deb $ wget http://static.mah.priv.at/public/xenomai-debs/xenomai-runtime_2.6.1_i386.deb
Install them:
$ sudo dpkg -i *.deb
Excecute this command to rebuild the initrd image - in theory this should happen automatically during the previous step, in practice the 10.04 dpkg command forgets to do it:
$ sudo update-initramfs -c -k 3.2.21-xenomai+
make sure it will show up as a GRUB-entry when booting:
$ sudo update-grub
Now reboot - the Xenomai-3.2.1 kernel should now show up in the grub menu.
login, and run this command to verify the Xenomai kernel is running:
$ dmesg | grep Xenomai
The output should look like so:
[ 2.826169] I-pipe: head domain Xenomai registered. [ 2.912094] Xenomai: hal/i386 started. [ 3.184246] Xenomai: scheduling class idle registered. [ 3.241571] Xenomai: scheduling class rt registered. [ 3.290277] Xenomai: real-time nucleus v2.6.1 (Light Years Away) loaded. [ 3.317241] Xenomai: debug mode enabled. [ 3.414937] Xenomai: starting native API services. [ 3.458010] Xenomai: starting POSIX services. [ 3.518369] Xenomai: starting RTDM services.
If it doesnt, you likely started the wrong kernel from grub.
In case you are running on a pristine Ubuntu 10.04LTS or 12.04 install which hasnt seen any LinuxCNC installation or build of LinuxCNC from a git repository, the following steps are needed:
Install git tools:
$ sudo apt-get install git-core git-gui
Install the development branch from Michael's git repository:
$ git clone git://git.mah.priv.at/emc2-dev.git linuxcnc-rtos
This puts the project in the directory 'linuxcnc-rtos'. To put the local copy of the project in a different location, just change the last argument of the 'git clone' command. You should only have to do this once.
The commands below generally assume you have now changed to the directory created by the git clone command, so cd into it:
$ cd linuxcnc-rtos
By default, you will get files from "master", which is not what we want - there are two possible branches to choose from:
rtos-integration-preview3 - this is based on v2.5_branch rtos-integration-preview3-merged-into-master - this should track current master functionality very closely.
Decide which one you want, and check it out - we assume rtos-integration-preview3 for this example:
$ git branch --track rtos-integration-preview3 origin/rtos-integration-preview3 $ git checkout rtos-integration-preview3
Install the build dependencies:
This installs the xenomai system on top of which a recently available version of LinuxCNC can be built. There are probably many ways to now obtain the tools/dependencies that are required. I used the following:
sudo apt-get install synaptic sudo apt-get install git Now using synaptic, install the following packages (I found these are required for a minimal linuxcnc build): build-essential autoconf libpth-dev libglib2.0-dev libgtk2.0-dev tcl-dev tk-dev bwidget libreadline-dev python-tk python-dev libgl1-mesa-dev libglu1-mesa-dev libxmu-dev Get Michael's version of LinuxCNC that can be compiled for Xenomai: git clone git://git.mah.priv.at/emc2-dev emc2-dev cd emc2-dev git branch --track rtos origin/rtos-integration-preview1 git checkout rtos Configure and build for Xenomai: cd src ./configure --with-threads=xenomai-user --enable-run-in-place make sudo make setuid Test: . ./scripts/rip-environment latency-test