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.
Packages:
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
Sources
LINUX (kernel.org)
cd /usr/src
sudo wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.28.7.tar.bz2
sudo tar xjvf linux-2.6.28.7.tar.bz2
sudo ln -s linux-2.6.28.7 linux
RTAI (https://www.rtai.org) (cvs-Version)
cd /opt
sudo cvs -d:pserver:anonymous@cvs.gna.org:/cvs/rtai co magma
sudo ln -s magma rtai
RTAI (https://www.rtai.org) (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 https://www.rtai.org/RTAI/rtai-3.7.tar.bz2
sudo tar xjvf rtai-3.7.tar.bz2
sudo ln -s rtai-3.7 rtai
COMEDI (www.comedi.org)
cd /opt
sudo cvs -d :pserver:anonymous@cvs.comedi.org:/cvs/comedi login
sudo cvs -d :pserver:anonymous@cvs.comedi.org:/cvs/comedi co comedi
sudo cvs -d :pserver:anonymous@cvs.comedi.org:/cvs/comedi co comedilib
sudo cvs -d :pserver:anonymous@cvs.comedi.org:/cvs/comedi co comedi_calibrate
sudo cvs -d :pserver:anonymous@cvs.comedi.org:/cvs/comedi co comedi-nonfree-firmware
Scilab 4.1.2 (www.scilab.org)
cd /opt
sudo wget http://www.scilab.org/download/4.1.2/scilab-4.1.2-src.tar.gz
sudo wget http://www.scilab.org/download/4.1.2/man-eng-scilab-4.1.2.zip
QRTAILab (www.qrtailab.sf.net) (svn – version)
cd /opt
sudo svn co https://qrtailab.svn.sourceforge.net/svnroot/qrtailab/trunk qrtailab
QRTAILab (www.qrtailab.sf.net) (tar.gz – version)
cd /opt
sudo wget http://downloads.sourceforge.net/qrtailab/QRtaiLab-0.1.6.tar.gz
sudo tar xvzf QRtaiLab-0.1.6.tar.gz
Installation
Kernel
PATCH Linux Kernel
cd /usr/src/linux
sudo su
patch -p1 < /opt/rtai/base/arch/x86/patches/hal-linux-2.6.28.7-x86-2.2.06.patch
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 http://hart.sourceforge.net/files/config-2.6.28-rtai_i386
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 man-eng-scilab-4.1.2.zip 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
QRTAILAB
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:
How to install RTAI, ComediLib in Ubuntu 8.10, Ubuntu 9.04,



{ 24 comments… read them below or add one }
HI,
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:
**************************************
COMEDI
cd /opt/comedi
sudo sh autogen.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.
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,
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 2.6.28.13-generic has been changed to 2.6.28.7-rtai. But I don’t know how to test if it works correctly.
Maybe I have to use Ubuntu 8.10.
Thanks a lot.
Hi Vu Nguyen,
You can follow this tutorial and find meaning of testing RTAI: https://www.rtai.org/RTAILAB/RTAI-Lab-tutorial.pdf or read RTAI manual
Best regards,
Hi,
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:
http://www.britishideas.com/tag/ubuntu/
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.
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,
hi,
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
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,
i hope you help me because i need it very much
NOTE: i use Toshiba labtop OR P4 i386 Desktop
thanks alot
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
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
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.
Hi Paul,
You can follow this help to fix your issue.
Best regards,
Hi,
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
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.
and pls respos me quickly.
Hi NHB,
I followed the tut in http://qrtailab.sourceforge.net/rtai_installation.html 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
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.
Thanks,
Dee
Hi arslan, I have not tried to install RTAI with Ubuntu 9.10; I think you should use 9.04.
I followed this link
http://qrtailab.sourceforge.net/rtai_installation.html
and installed RTAI 3.8 with Ubuntu 9.04 successfully.
Remember to download the file rtai-3.8.tar.bz2 from “https://www.rtai.org/RTAI/”, and QRtaiLab 0.1.12 from http://qrtailab.sourceforge.net/downloads.html. 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,
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
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,
Ajith
*********Error*******
../../../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
Ajith,
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 http://www.rtai.org.
Same error…
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.