How to install RTAI, ComediLib in Ubuntu 8.10, Ubuntu 9.04

Last several months ago, I have done to install RTAI, ComediLib in Ubuntu 8.04. Actually, I have spent a lot of time to config Ubuntu system. It faces a lot of problems but finally it has finished.

Now new RTAI package version 3.7 which supports Linux kernel 2.6.28 has been released with a lot of features:

  • support for m68knommu (NEW) (Valentin Pavlyuchenko)
  • upgraded ARM (Torsten Koschorrek)
  • lots of RTAI-Lab upgrades (Roberto Bucher; note that RTAI now integrates to Scilab 5.1
  • multi port serial driver with shared interrupts (Renato Castello)
  • rt_poll on mbx and sems
  • SMP locks as for Linux ticket way
  • RTDM support upgrade
  • improved watch dog
  • revised COMEDI support, async services and insn list work now
  • revised Linux sync-async servers
  • Linux support up to 2.6.28
  • netrpc 32/64 bits inter operation
  • shortened locking and timer replay in scheduler
  • upgraded TLSF mem allocator
  • rtai-py (python support)
  • more so called “minor fixes”

Now I base on this tutorials from QRtaiLab, I hope it is better tutorial for Ubuntu 8.04 and Ubuntu 9.10. QRtaiLab is a QT based application, it is better than XRtaiLab. You can see the comparision here.


UBUNTU 8.10 (works also on 9.04)

  • general:
    sudo apt-get install cvs subversion build-essential
  • kernel:
    sudo apt-get install kernel-package linux-source libncurses5-dev
  • rtai:
    sudo apt-get install libtool automake
  • comedi-lib:
    sudo apt-get install bison flex
  • comedi-calibrate:
    sudo apt-get install libboost-dev libboost-program-options-dev libgsl0-dev
  • scilab 4.1.2:
    sudo apt-get install gfortran sablotron tcl8.5-dev tk8.5-dev xaw3dg-dev libpvm3 pvm-dev libgtkhtml2-dev libzvt-dev libvte-dev
  • qrtailab:
    sudo apt-get install libqt4-dev libqwt5-qt4-dev



cd /usr/src
sudo wget
sudo tar xjvf linux-
sudo ln -s linux- linux

RTAI ( (cvs-Version)

cd /opt
sudo cvs co magma
sudo ln -s magma rtai

RTAI ( (tar.gz-Version)

You have to use a Version of 3.7 or newer, because older version are not compatible with gcc 4.3.3!

cd /opt
sudo wget –no-check-certificate
sudo tar xjvf rtai-3.7.tar.bz2
sudo ln -s rtai-3.7 rtai


cd /opt
sudo cvs -d login
sudo cvs -d co comedi
sudo cvs -d co comedilib
sudo cvs -d co comedi_calibrate
sudo cvs -d co comedi-nonfree-firmware

Scilab 4.1.2 (

cd /opt
sudo wget
sudo wget

QRTAILab ( (svn – version)

cd /opt
sudo svn co qrtailab

QRTAILab ( (tar.gz – version)

cd /opt
sudo wget
sudo tar xvzf QRtaiLab-0.1.6.tar.gz



PATCH Linux Kernel

cd /usr/src/linux
sudo su
patch -p1 < /opt/rtai/base/arch/x86/patches/hal-linux-

Configure Kernel

At first you should find out your architecture:

dpkg –print-architecture

for i386:

A sample config-file for i386 is available from here

cd /usr/src/linux
sudo wget
sudo cp config-2.6.28-rtai_i386 .config

for amd64:

cd /opt sudo tar xvzf scilab-4.1.2-src.tar.gz sudo unzip sudo mv man-eng-scilab-4.1.2 scilab-4.1.2/man/eng/ cd scilab-4.1.2 sudo ./configure --with-gfortran --with-tk --with-gtk2 sudo make all sudo ln -s /opt/scilab-4.1.2/bin/scilab /usr/local/bin/scilab


If you use a tar.gz-version please replace qrtailab with qrtailab-x.x.x (x.x.x is the number of your installed version )

cd /opt/qrtailab

Edit qrtailab.config and replace ‘/usr/include/qwt/’ with ‘/usr/include/qwt-qt4/’ and ‘-lqwt’ with ‘-lqwt-qt4′. Here is my qrtailab.config content:

# library path
DEPENDPATH += . /usr/local/qwt-5.2.0-svn/lib
INCLUDEPATH += . /usr/realtime/include /usr/include/qwt-qt4/
LIBS +=  -lqwt-qt4
#CONFIG += debug
# do same tests

#CONFIG += QRLtests

Now we are going to compile QRtaiLab:

sudo qmake-qt4
sudo make
sudo make install

It is demo running RTAI, QRtaiLab on Ubuntu 8.04 I did before:

YouTube Preview Image

{ 24 comments… add one }

  • Med June 25, 2009, 9:34 pm

    this tutorial is very interesting, thank you very much :)

    I have just 2 comments :

    1- you have forgotten to add ‘sudo ./configure’ to COMEDI installation:

    cd /opt/comedi
    sudo sh
    sudo ./configure –with-linuxdir=/usr/src/linux –with-rtaidir=/usr/realtime
    ** sudo ./configure **
    sudo make
    sudo make install
    sudo make dev

    2 – we have to change ‘–’ by ‘–’ (for example in: sudo ./configure “–”with-gfortran “–”with-tk –with-gtk2) so we can’t just make copy/paste to execute commands.

    • admin June 26, 2009, 8:28 am

      Dear Med,

      Thanks for your comment. I am going to install RTAI and Comedi on Ubuntu 9.04 and I will check it again and correct it later :) . But I think we don’t need the command sudo ./configure because we did it before it with some parameters: sudo ./configure –with-linuxdir=/usr/src/linux –with-rtaidir=/usr/realtime

      Best regards,

  • Vu Nguyen July 21, 2009, 9:21 pm

    Hi guys,

    I am new to Ubuntu and RTAI. Could you tell me how to check if RTAI has been installed successfully?

    I use Ubuntu 9.04 and install RTAI following the guidance above. I faced some errors in the steps of RTAI #1, RTAI #2 and QRTAILAB with “make” and “make install”.

    Finally the kernel has been changed to But I don’t know how to test if it works correctly.

    Maybe I have to use Ubuntu 8.10.

    Thanks a lot.

  • Kim July 24, 2009, 9:30 pm


    i have installed RTAI 3.7, without Comedi,Scilab and QRtailab, following your instructions above . But i faced a serious error below when i tried to run the test in /usr/realtime/testsuite/user/latency/run:

    insmod: error inserting ‘usr/realtime/modules/rtai_hal.ko’:
    -1 Unknown symbol in module

    It seems that the insmod don’t recognize those symbols of rtai.

    I have tried to find solutions on:

    which ask me to do:
    $ sudo nano -w /boot/grub/menu.lst

    and find the kernel line for the realtime kernel. Add “lapic” to the end of it and reboot, then run the tests again. For example:

    kernel /boot/vmlinuz-2.6.22-realtime root=UUID=45d21232-cf0d-cc3d-87ce-8453214d7a6f ro quiet splash vga=794 lapic

    And it didn’t work neither. And i have tried others suggestions which lead to the same error.

    I wonder if there’s a problem of compatibility between the latest Ubuntu, Kernel and the rtai.

    So i would like to know whether there’s some propositions to resolve my problems.

    Thanks a lot.

    • admin July 25, 2009, 5:54 pm

      Hi Kim,

      I have many experiences with compiling RTAI on Ubuntu. About kernel compatibility, it should be same between RTAI patch and Ubuntu version. You can find Ubuntu version by typing this command: uname -a.

      Several months ago I fail one time when I am trying to install RTAI on Ubuntu 9.04, and I went back to Ubuntu 8.04 Hardy and I got successes by following this tutorial: How-to Install RTAI in Ubuntu Hardy .

      You can try with Ubuntu 9.04 if it still doesn’t work, you should use Ubuntu 8.04 or maybe Ubuntu 8.10. But I think that you can do with Ubuntu 9.04 because RTAI 3.7.1 supports Linux kernel up to Linux-2.6.29.

      Best regards,

  • siddeeq August 30, 2009, 9:25 pm


    thank’s alot for this page, it is help me alot.
    i install ubuntu 8.10 and follow the previous steps all work done ok untile the step
    RTAI #2
    when i enter the instruction

    sudo cp /opt/comedi/include/linux/comedi.h /usr/local/include/
    sudo cp /opt/comedi/include/linux/comedilib.h /usr/local/include/
    sudo ln -s /usr/local/include/comedi.h /usr/local/include/linux/comedi.h
    sudo ln -s /usr/local/include/comedilib.h /usr/local/include/linux/comedilib.h
    cd /opt/rtai
    sudo make menuconfig
    Under “Add-Ons”, select “Real Time COMEDI support in user space”
    sudo ./configure
    sudo make

    the following error was happend
    ../../../base/include/asm/rtai_leds.h: In function ‘leds_parport_func’:
    ../../../base/include/asm/rtai_leds.h:27: warning: implicit declaration of function ‘outb’
    make[4]: *** [services.lo] Error 1
    make[4]: Leaving directory `/opt/magma/base/sched/liblxrt’
    make[3]: *** [all-recursive] Error 1
    make[3]: Leaving directory `/opt/magma/base/sched’
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory `/opt/magma/base’
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/opt/magma’
    make: *** [all] Error 2

    i try with ubuntu 9.04 and the same error like the previous on was happend

    • admin August 31, 2009, 8:58 am

      Dear siddeeq,

      You can follow other tutorial to install RTAI: How-to Install RTAI in Ubuntu Hardy. It works for me, even in Ubuntu 9.04 (my friend tested).

      I didn’t find solution for your error, because it didn’t display clear error, just server.lo, error 1.

      Best regards,

  • siddeeq August 30, 2009, 9:29 pm

    i hope you help me because i need it very much
    NOTE: i use Toshiba labtop OR P4 i386 Desktop
    thanks alot

  • siddeeq September 1, 2009, 7:08 pm

    Dear admin

    i am very happy because i find this site and thank you very much for your help, i will try follow the tutorial you give it to me and i will back to you if there any problem because i am beginner in RTAI and i need to make “Real Time Netwok between Windows & Linux”.
    any advice?!!

    thank’s alot

  • siddeeq September 11, 2009, 5:35 pm

    Dear admin
    thank you for your help, i need a simple example how to run rtai because i try to run many exampls and get some error i can not run any program error in insmod or in include file’s and other. did you have any paper or simple program with steps of compile and runing the program. thank you

  • Paul December 16, 2009, 10:00 am

    Hi admin,

    I am trying to install RTAI on Intel Centrino Core Duo PC, but running Ubuntu 9.04 over VMWare (a virtual machine). After the first instalation, sudo reboot, my machine does not reboot, sending “Gave up waiting for root device”.
    Alert! /dev/disk/by-uuid/…. does not exist. Dropping to a shell!
    Any advice?
    Thanks on advance.

    • admin December 25, 2009, 10:23 am

      Hi Paul,

      You can follow this help to fix your issue.

      Best regards,

  • Mohamed Abuthahir January 10, 2010, 8:44 pm


    I followed ur above steps to install rtai with Ubuntu 9.04 everthing fine till the end without any error.

    But how i know rtai is patch with my new custom kernel and how can i boot with the new kernel

  • arslan March 11, 2010, 12:09 am

    hi.pls help me i want to install rtai-lab for my project.i install ubuntu 9.10 but this tutorial just for 8.10 or 9.04 i want to now this tutorial work on ubuntu 9.10 or not?

    well i install but i got many errors. so pls help me.

  • arslan March 11, 2010, 12:11 am

    and pls respos me quickly.

  • Vu Nguyen May 14, 2010, 11:13 pm

    Hi NHB,

    I followed the tut in and successfully installed RTAI 3.8 in Ubuntu 9.04. No error occurs. However, after the step of rebooting, I no longer can connect to the Internet. Do you have any ideas on this?

    Thank you,

    Vu Nguyen

    • Dee July 6, 2010, 12:03 am

      Hi Vu Nguyen,

      I am also facing this problem, my internet is also stopped working after insalling RTAI3.7 in Ubuntu 8.04.. I would appreciate if you could tell me any way to fix this problem.


  • Vu Nguyen May 21, 2010, 5:26 am

    Hi arslan, I have not tried to install RTAI with Ubuntu 9.10; I think you should use 9.04.

    I followed this link
    and installed RTAI 3.8 with Ubuntu 9.04 successfully.

    Remember to download the file rtai-3.8.tar.bz2 from “”, and QRtaiLab 0.1.12 from I did not use cvs except for comedi related downloads.

    My only problem is that I cannot connect to the Internet anymore after installing RTAI.

    Have fun,

    • admin May 27, 2010, 9:40 pm

      Thank Vu Nguyen, I will try to build and use RTAI but not now, since I am busy doing something else.

      Wish to discuss with you more about that :)

  • Ajith May 26, 2010, 1:56 am

    Dear Admin/Siddeeq,

    I got the same error . Did you find any solution for that? I would be grateful if any one can help me on this.
    Thanks in advance,
    ../../../base/include/asm/rtai_leds.h: In function ‘leds_parport_func’:
    ../../../base/include/asm/rtai_leds.h:27: warning: implicit declaration of function ‘outb’
    make[4]: *** [services.lo] Error 1
    make[4]: Leaving directory `/opt/magma/base/sched/liblxrt’
    make[3]: *** [all-recursive] Error 1
    make[3]: Leaving directory `/opt/magma/base/sched’
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory `/opt/magma/base’
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/opt/magma’
    make: *** [all] Error 2

  • Daniel June 4, 2010, 9:12 pm

    maybe –disable-leds would help you skip that? But then you know… leds will be disabled. Some examples might not work. Also I’m not sure about magma. Is it stable branch? Maybe you would be better off with vulcano (experimental) branch that has all the new stuff in. Or just use 3.8 version announced on

  • Gorkhaan June 6, 2010, 5:23 am

    Same error…

  • Schedule October 30, 2010, 9:39 am

    Best you should make changes to the page subject How to install RTAI, ComediLib in Ubuntu 8.10, Ubuntu 9.04 to something more specific for your content you make. I liked the the writing withal.


Leave a Comment