LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

Adapting LinuxCNC configure to multiple realtime environments

The current configuration options for LinuxCNC regarding 'real time environments' are:

I believe the underlying assumptions at the time were:

Several options for realtime Linux have appeared since, which are:

These two platforms provide new options:

Also, given reasonable latency of one of the user RT process schemes, it becomes entirely feasible to use user-mode device drivers.

It should be obvious that these new options cannot be consistently adressed with the current configuration assumptions. Realtime does not imply kernel threads exclusively anymore, and User process mode does not imply 'useless so no drivers' please. Also, user RT modules will do I/O, hence rtapi_app needs to be setuid root in this case.

As work progresses on different branches in parallel, configuration problems will likely be solved ad-hoc (ad-hack?) and conflicts will arise during merge, also with the consequence of an even more incoherent set of options.

The configuration options have been changed as

(for now, this only applies to http://git.mah.priv.at/gitweb/emc2-dev.git/shortlog/refs/heads/integration-configuration-dev as it is not merged yet):

--with-realtime will be deprecated in its current form, and replaced by:

--with-threads=<arg>, arg being one of:

Build system: there are two styles, 'kbuild' (kernel modules) and 'user-dso' (userland shared objects). The thread style implies a build system: posix, xenomai-user, rt-preempt-user imply 'user-dso', the others imply 'kbuild'.

Building hardware drivers can be controlled with --enable-drivers. It is default 'yes' except for --with-threads=posix. Some hardware drivers will build as kernel modules only, some as user shared objects, some may build as both; in that case the Submakefile needs to test for BUILD_SYS having the proper value.

The cpp symbols 'SIM', 'SIMULATOR', and 'RTAPI_SIM' have been removed as they do not make sense any more. A simulator configuration is '--with-threads=posix', which is now implied by --enable-simulator.

The shell/Makefile? variables are:

THREADS= one of: posix, rt-preempt-user,rt-preempt-kernel, xenomai-user, xenomai-kernel, rtai


BUILD_SYSTEM=kbuild or user-dso

THREADS is reflected in config.h as one of the following defined:







BUILD_DRIVERS is conditionally defined in config.h too.

BUILD_SYSTEM is reflected in config.h as either




The experimental usermode parport driver from master: src/hal/simdrivers has been integrated into the main hal_parport.c/.h code using conditionals from above.

Make setuid:

this has been adapted to take care of the case 'threads=posix and drivers enabled', which requires rtapi_app to be setuid root.

Michael Haberler

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions
Last edited October 27, 2012 8:07 am by MichaelHaberler (diff)
Published under a Creative Commons License