building linuxcnc-dev on ubuntu 16.04 preempt-rt kernel

13 Apr 2018 04:59 #108931 by thang

Grotius wrote:
If i want to install the latest kernel file combination.. Is it better to do this, or leave it like this?

I have no idea but i think it's ok. When i made this tutorial, it was latest version

Please Log in or Create an account to join the conversation.

13 Apr 2018 14:05 #108946 by JoeHildreth

andypugh wrote:

JoeHildreth wrote: checking for img::png using /usr/bin/tclsh8.4... no
configure: error: Tk img::png not found!
install with "sudo apt-get install libtk-img"
However, libtk-img is installed.

It might be that you have to force a version. I think you can do this in Synaptic.

I have resolved the problem. I had to install the dev files. libtk-img-dev

Thanks Andy.


Please Log in or Create an account to join the conversation.

13 Apr 2018 21:34 - 13 Apr 2018 21:36 #108969 by Grotius

I have much trouble getting Glade working with the needed hal widget's.
I have read in other thread's and tried out most of the examples, Norbert has a nice tutorial. but i had no luck today !!
My error was : cannot find module gtksourceview2.0, but the file is in the system.

Maybe it's handy that an expert can make a little tutorial how we can get Glade working in minutes.
Maybe with a separate download file containing all the dependecies for linuxcnc.

For now i am trying out this tutorial : Complete HOW-TO Linux Mint 18.1 32/64 RTAI or PREEMPT with RIP install or deb
And what i learned about it, building a .deb installation file for kernel is i think a very nice way. I will try this out.
Last edit: 13 Apr 2018 21:36 by Grotius.

Please Log in or Create an account to join the conversation.

15 Apr 2018 23:15 - 16 Apr 2018 02:54 #109105 by Grotius

I have made a autoinstaller for the 64 bit kernel for Ubuntu and Linux Mint. Kernel version is 4.9.47.

This is a handy tool for user's who want to go get a beer while pc is making your RT-kernel.
During installation process, you would be several times asked for a yes, to continue installation. Type "y" and then hit enter.

All the files are automatic downloaded from the internet trough this shell script.
This script I tested on a fresh install Ubuntu 14.04, but can also be used for Linux Mint 18.3.
Put the file in your home directory unpack it, and open terminal in your home directory and command : sudo sh

This auto-installer open´s the menuconfig for your kernel automatic, so you can choose your own kernel configuration.
For your kernel configuration keep following things in mind, select :
- Processor type and features --> Preemtion model --> Fully preemtible kernel
- Power management --> disable suspent to RAM, Hypernation and CPU frequency scaling
- Kernel hacking menu --> IO delay type (no port IO delay)

The auto-installer installs also the grub software you need to select your kernel.

Okey when everything is ready, open your home directory and all the .deb files will install automatic with package manager.
You need to install them piece by piece. It are 5 files in total.

After this type in your terminal : grub-customizer
In the second tap window select your new RT-kernel for boot as first.

I am thinking to expand this auto-installer with linuxcnc.

I hope you like this.
Last edit: 16 Apr 2018 02:54 by Grotius.
The following user(s) said Thank You: mehow

Please Log in or Create an account to join the conversation.

16 Apr 2018 07:03 #109111 by rodw
Good work, very similar to the script I used (originally from PCW). I was going to try this but remembered that I had patched my laptop to the more recent 4.16.2 kernel to pickup on the latest patches for the Microsoft microcode bugs and the latest RT kernel is 4.14

I may roll back my kernel to 4.14 and see how I go when I get a moment. This is on my Lenovo Yoga Pro 2 touchscreen laptop which now dual boots Mint and Windows.

If you have troubles finding the correct settings in xconfig, try menuconfig instead.

Please Log in or Create an account to join the conversation.

16 Apr 2018 19:59 - 16 Apr 2018 21:00 #109139 by Grotius
Hi Rodw,

Thank you for your time.

The past day's i have made 5 or 6 installation's on ubuntu and linux mint.
Now i think... What the hell is going on by the company dassault systems. They are not capable to compile a 32 version for linux.
They put their server's offline in the weekend. So you can not activate your requested product. That issue was very confusing to me to get different linux distribution's fully working.

But in the midweek
you can activate your product. Draftsight works on Ubuntu 64 bit 16.04 and on Linuxmint 64 bit. 18.01 and 18.03

I have tried several installation's with direct install and via .deb packages.

1x ubuntu 14.04 + kernel + linuxcnc
2x linux mint 16.03 + kernel + linuxcnc
1x linux mint 16.01 + kernel + linuxcnc (exact forum example, but difficult to solve. much is changed in time)
2x making .deb packages for kernel and linuxcnc

My conclusion is : the best install is linux mint 14.01, the exact forum example and the kernel download from the reprository of Sebastian. Today you must solve diffucult itemś to get the 14.01 working on linuxcnc .deb install.
The dependencies and modules are the issue's. I know to less to make dependencies my self.
Linux mint version 14.03 is not able to work with .deb install. Please inform the mint platform. The rtai modules are missing. Maybe we must write some new code.

Other distrubtion's have various issues.
In ubuntu 16.04 you can install a up to date rt .deb kernel, you can not install the linux.deb files... Also glade widget's problem not solved. You can only compile the kernel and linuxcnc, then itś working. but glade problem not solved....

So now i think. I got linuxmint working on 64 bit. with linuxcnc working. both on .deb install. So that is the most orginal way to
get 64 bit systems to work. I think thankś to Sebastian. He has made this possible. I will compile the man 9 pages some day.
I started the linux mint application with linuxcnc on .deb install. but it is not good !! I will use 2 pc's on a system for now.

What are the benefits of the linuxcncsvr "server program" ? Norbert can see the actual users. but what is module exactly?

I will try to make a clone file of hard disk. To put on ftp server. Or a ready iso file with linux mint and linuxcnc prefixed. I must find out the easest way of installing a system without complaints.
Last edit: 16 Apr 2018 21:00 by Grotius.

Please Log in or Create an account to join the conversation.

16 Apr 2018 22:22 #109144 by rodw
I actually tried the 4.14 kernel last night but I lost support for my Displayport monitor on my Toshiba Dynadock so I'll stick to 4.16 for now. I'm not worried about that becasue this laptop does not have a network port so I'll only ever run sims on it.

For those following, its not hard to change the attached script to install and patch a different kernel. You just need to poke around in the repositories referred to in the wget statements in If you want to install the PREEMPT_RT, make sure you choose a version that has a RT patch as there is not one released for every kernel version.

Once you decide on a version just update the scripts to replace the existing references something like this:
sudo apt-get install devscripts build-essential imagemagick texlive-font-utils tcl8.6-dev tk8.6-dev libxaw7-dev libncurses-dev libreadline-gplv2-dev dblatex groff python-dev python-tk libglu1-mesa-dev libgtk2.0-dev asciidoc source-highlight libboost-python-dev texlive-lang-cyrillic debhelper texlive-lang-french texlive-lang-spanish texlive-lang-german libmodbus-dev dvipng libusb-1.0-0-dev graphviz inkscape python-numpy python-imaging-tk python-gtkglext1 tclreadline blt bwidget libtk-img tclx libudev-dev gstreamer0.10-plugins-base python-vte libqt4-dev libssl-dev texlive-lang-polish w3c-linkchecker libxenomai-dev git python-pil.imagetk


tar -xpf linux-4.14.34.tar.gz
gunzip patch-4.14.34-rt27.patch.gz

cp patch-4.14.34-rt27.patch linux-4.14.34
cd linux-4.14.34
cat patch-4.14.34-rt27.patch | patch -p1
make xconfig

make -j2 deb-pkg

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer

I would not recommend trying this version becasue it is too close to the bleeding edge. From version 4.15, the kernel includes protection from the Spectre and Meltdown vulnerabilities which is the only reason why I've chosen to run the latest kernel on this machine.

Finally, if you just want to be able to change your kernel at will and not use the PREMPT_RT kernel, there is a cool tool called ukuu that you can install with apt-get. It allows you to chose any kernel and install it. sooo easy!

Please Log in or Create an account to join the conversation.

18 Apr 2018 14:56 - 18 Apr 2018 15:00 #109257 by Grotius
Hi Rodw,

What do i have to do, to make a rt patch off the latest kernel release? For example i want to make a rt kernel of :
Is it difficult to do?

At the moment i am understanding only the rt patches will be usable on real machines and you must check the rt project directory to
find this out.

Did you read the man pages 9 about the kernels? This section is not available by default.
Last edit: 18 Apr 2018 15:00 by Grotius.

Please Log in or Create an account to join the conversation.

18 Apr 2018 20:13 #109265 by rodw
I think the correct process is to look at the patches and choose a kernel version that has an available RT patch. Eventually the Linux RT Kernel team will release a version that includes support for Spectre and Meltdown protection (eg 4.15 and above). I understand this might introduce a performance hit on hardware as the vulnerability is in the Intel CPU architecture. I don't know if it would be a good idea to use it for a cnc machine.

Also its not a good idea to go too close to the latest bleeding edge of Linux development as there could be stability issues. When I built my machine Mint 18.1 was available but on PCW's advice I installed 17.3 because of some compatibility issues.

Whilst I try hard, I'm very much a linux novice.

Please Log in or Create an account to join the conversation.

18 Apr 2018 20:57 #109270 by Grotius
Hi Rodw,

I have a difficult issue. When trying to make a .deb linuxcnc install, i get this error. I get this unment build deps even when
i use an other kernel version.
grotius-root@grotius-cnc-machines:~/linuxcnc-dev$ dpkg-checkbuilddeps
dpkg-checkbuilddeps: error: Unmet build dependencies: rtai-modules-4.14.34-rt27 | rtai-modules-4.14.34-rt27
grotius-root@grotius-cnc-machines:~/linuxcnc-dev$ uname -r

Please Log in or Create an account to join the conversation.

Time to create page: 0.099 seconds
Powered by Kunena Forum