LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

This worked for me and there are surely things to improve. None of the other ways I found on the web and in this wiki worked anymore with a recent Gentoo distribution since I tried in 2016. So I made this stuff now - December 2017 on a Thinkpad T43p (2GHz, 1GB RAM, Parport, ATI, 1600x1200). If you are not familiar with Gentoo you better take the standart Ubuntu based distribution. There you can remove the blinky stuff too and get it run with 256MB RAM. (I've done that but had to recompile kernel, rtai and emc as they where not compatible to my P III CPU as they where built for machines with lapic(s) and I only had a apic - so my hope to just drop in Ubuntu based LinuxCNC CD and use it was dissappointed and my hate to Ubuntu grew stronger. Well I guess LinuxCNC not running on pre SMP Processors should be fixed.)

As the performance differences between preemptrt, rtai and xenomai are small and the preemptrt kernel is easy to build I used this way.


1. Emerge preemptrt sources
2. Build the PreempRT kernel
3. Emerge LinuxCNC
5. More resources
6. Contact to the author of this manual

1. Emerge preemptrt sources

you can skip this and the following step if you just want to simulate machining on your Gentoo system

 emerge -av sys-kernel/rt-sources

2. Build the PreempRT? kernel

cd to the directory where the rt-sources got installed /usr/src/linux-[versionnumber]-rt[revision], e.g.

 cd /usr/src/linux-4.13.13-rt5

copy .config of a working kernel to this directory

 cp ../linux/.config .


 make oldconfig

answer the stuff and enable all the things needed for realtime make sure your .config contains

build the kernel

 make all

install the modules

 make modules_install

copy the bzImage to /boot and make grub or whatever you use find it

reboot the new kernel and make sure it works

update the link to the kernel source where linux-4.13.13-rt5 has to be set according to the Version you use e.g.

 cd /usr/src && rm linux && ln -s linux-4.13.13-rt5 linux

3. Emerge LinuxCNC

Download upload:linuxcnc-ebuilds-2.7.11.tar.xz

cd to /usr/local and untar the Download there

 cd /usr/local && tar Jxvf /PATH/TO/THE/DOWNLOAD/linuxcnc-ebuilds-2.7.11.tar.xz

make sure your make.conf contains a line like


if you need modbus (If you don't know what it is, you don't need it.) for your machine add the useflag to linuxcnc e.g. add the following line to /usr/portage/package.use or a file in /usr/portage/package.use/

 sci-misc/linuxcnc modbus

add the following line to your /etc/portage/make.conf You should remove this line when you are done. Anyways I couldn't find a way to get the ebuild preventing portage from bzip2ing the minimal sample files and this is a problem as the linuxcncgui is making heavy use of them and can't read them when they are zipped.


unmask sci-misc/linuxcnc and depencies and emerge

  emerge -av sci-misc/linuxcnc

if you forgot to unmask something the latter command will ask you to do this automatic. You can let it do that. It will not write the changes to the real files yet. You can use

interactive to make those changes real. Be carefull, with this tool. Be patient and don't mix commands with - with numbers e.g. -1 is not the same as 1 !

read the messages I've put in the ebuild.

when you're done remember the make.conf line

good luck


get rid of the make.conf line change
useflag for installing the whole documentation

5. More resources

I knew the stuff when I wrote this manual here and the ebuilds. It's mostly obsolete for use but maybe helpfull for improve the ebuild.

The zugaina link gave me preview to linuxcnc 2.8_pre I don't remember what it was but somehow it didn't work on my machine when I tried it, but looks interesting.

6. Contact to the author of this manual

If you have any suggestions, questions or improvements you can reach me via my mail form: http://reiseradgabel.de/english/mail (This gives me less spam as putting my email address here.) Please keep in mind that generic LinuxCNC questions are better addressed somewhere else.

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions
Last edited December 18, 2017 6:52 pm by Reiseradgabel (diff)
Published under a Creative Commons License