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

by admin on June 15, 2009

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:

YouTube Preview Image

VN:F [1.7.9_1023]
Rating: 8.8/10 (6 votes cast)
How to install RTAI, ComediLib in Ubuntu 8.10, Ubuntu 9.048.8106

Popularity: 64% [?]

Related posts:

  1. Real-Time Application Interface: RTAI 3.7.1 available Today, I get email from RTAI mailing list that they announce RTAI 3.7.1 to all users and developers which are using RTAI for their system. The RTAI 3.7.1 release is available at <https://www.rtai.org/RTAI/rtai-3.7.1.tar.bz2> It contains: - Substantial updates to RTAI-Lab (Roberto Bucher): - A better support to install different versions of Scilab: scilab-4.12, scicoslab-4.3 and scilab-5.1.1 - Addition of [...]...
  2. Howto Install and setup TFTPD in Ubuntu workstation I was doing my own project using TMS320DM355 EVM with MontaVista realtime Linux is installed some months ago.  At that time, I search in Google many times but I didn’t get success to install TFTP. Finally, I found out one great tutorial about that. In my system, I use TFTP protocol to download Linux kernel, U-boot [...]...
  3. Howto install Vietnamese Input Method Scim-Unikey on Ubuntu Hi everyone, Today, I would like to introduce the Vietnamese input method in Ubuntu. Scim-Unikey is the most stable package for typing Vietnamese characters, by combining the advantages of Smart Character  Input Method (SCIM) and the most famous Vietnam input method Unikey. Scim-Unikey now is maintained by Ubuntu-VN and Vietnamese Ubuntu Community. If you want to learn Vietnamese [...]...
  4. How to install Picasa in Ubuntu Homepage: http://picasa.google.com Today, I am going to upload my pictures from last party, I suddenly remember a such powerful and great image management: Picasa from Google. Actually, I love Google products because of their simple characteristics. Picasa application can run cross-platform on Linux and Windows OS as well. In Windows, it use this one also. Now Picasa [...]...
  5. How to install Ubuntu 9.04 on notebook MSI VX600 It is my first and new notebook with special specification: Intel Core 2 Duo Processor 2.0 GHz SIS 672DX+SIS 968 Chipse 15.4? 1280×800 WXGA Display ATi Mobility Radeon HD3410 Graphic Card  512MB 4GB DDR2 533/667Mhz Memory 10/100Mbps LAN 802.11 b/g, 802.11 b/g/n WLAN 250 GB HDD Physical Dimension: 358 x 259 x 27-33mm It have arrived in the yesterday afternoon after finish working in [...]...
  6. How to install ATI Graphic driver for Ubuntu 9.04 Image via Wikipedia How to install ATI package for Ubuntu system is the controversial issue in the Ubuntu community, but just little people have been success to install ATI driver. Drivers which are from Ubuntu resposities don’t support full function for example: dual monitor in Ubuntu 9.04 In this post How to install Ubuntu 9.04 on notebook [...]...

{ 14 comments… read them below or add one }

Med June 25, 2009 at 9:34 pm

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.

UN:F [1.7.9_1023]
Rating: 0 (from 0 votes)

Reply

admin June 26, 2009 at 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,

UA:F [1.7.9_1023]
Rating: 0 (from 0 votes)

Reply

Vu Nguyen July 21, 2009 at 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 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.

UN:F [1.7.9_1023]
Rating: 0 (from 0 votes)

Reply

admin July 25, 2009 at 5:57 pm

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,

UA:F [1.7.9_1023]
Rating: 0 (from 0 votes)

Reply

Kim July 24, 2009 at 9:30 pm

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.

UN:F [1.7.9_1023]
Rating: 0 (from 0 votes)

Reply

admin July 25, 2009 at 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,

UA:F [1.7.9_1023]
Rating: 0 (from 0 votes)

Reply

siddeeq August 30, 2009 at 9:25 pm

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

UN:F [1.7.9_1023]
Rating: 0 (from 0 votes)

Reply

admin August 31, 2009 at 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,

UA:F [1.7.9_1023]
Rating: 0 (from 0 votes)

Reply

siddeeq August 30, 2009 at 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

UN:F [1.7.9_1023]
Rating: 0 (from 0 votes)

Reply

siddeeq September 1, 2009 at 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

UN:F [1.7.9_1023]
Rating: 0 (from 0 votes)

Reply

siddeeq September 11, 2009 at 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

UN:F [1.7.9_1023]
Rating: 0 (from 0 votes)

Reply

Paul December 16, 2009 at 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.

UN:F [1.7.9_1023]
Rating: 0 (from 0 votes)

Reply

admin December 25, 2009 at 10:23 am

Hi Paul,

You can follow this help to fix your issue.

Best regards,

UA:F [1.7.9_1023]
Rating: 0 (from 0 votes)

Reply

Mohamed Abuthahir January 10, 2010 at 8:44 pm

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

Reply

Leave a Comment