RealTime suite‎ > ‎

Machine setup

Step 1 - Prepare your machine
  • Perform a clean installation of Ubuntu 10.04 x86 and apply all available updates.
  • From now on, all commands that follow a white dot have to be typed in a terminal window (follow the rule that for each dot corresponds one command on a single line).
  • Get the following packages:
    • sudo apt-get install cvs subversion build-essential libtool automake libncurses5-dev bison flex libboost-dev libboost-program-options-dev libgsl0-dev gfortran sablotron tcl8.5-dev tk8.5-dev xaw3dg-dev libpvm3 pvm-dev libgtkhtml2-dev libvte-dev ocaml-native-compilers libqt4-dev libqwt5-qt4-dev xfonts-100dpi xfonts-75dpi ssh
  • If you don’t already have it get realtimesuite archive, then extract it:
    • sudo wget http://sourceforge.net/projects/rtaixml/files/realtimesuite/1.2/realtimesuite-1.2.tar.gz/download
    • sudo mv download /usr/src/realtimesuite-1.2.tar.gz
    • cd /usr/src
    • sudo tar -xvzf realtimesuite-1.2.tar.gz
  • Ensure that /usr/src folder contains at least the following subfolders: ‘boot’, ‘comedi’, ‘comedi_calibrate’, ‘comedilib’, ‘comedi-nonfree-firmware’, ‘ede’, ‘efltk’, ‘jrtailab’, ‘kernel’  ‘qrtailab’, ‘rtai’, ‘rtaixml’, ‘scicoslab’.
  • Install EFLTK library:
    • cd /usr/src/efltk
    • sudo autoconf
    • sudo ./configure --disable-mysql --disable-unixODBC
    • sudo ./emake
    • sudo ./emake install
    • sudo gedit /etc/ld.so.conf

Add a line with the path /usr/local/lib and save.

    • sudo /sbin/ldconfig


Step 2 - RTAI Patched Kernel
  • Install patched kernel:
    • cd /usr/src/kernel
    • sudo gdebi linux-headers-rtai_all.deb
    • sudo gdebi linux-image-rtai.deb
    • ls
  • Check for any other .deb in the folder and install it.
  • Check contents of src folder:
    • cd /usr/src
    • ls
  • Find version of rtai kernel folder in the form
    linux-headers-x.x.x-x-rtai (e.g. linux-headers-2.6.32-122-rtai)
    and make symbolic link (remember to replace version number):
    • sudo ln -s linux-headers-2.6.32-122-rtai linux
  • Reboot in the new Kernel:
    • sudo reboot
  • After reboot, check if patched kernel is running:
    • uname -r


Step 3 - First RTAI Installation
  • Install Comedilib:
    • cd /usr/src/comedilib
    • sudo sh autogen.sh
    • sudo ./configure --sysconfdir=/etc
    • sudo make
    • sudo make install
    • sudo make dev
  • Check the number of CPUs available on your machine:
    • cat /proc/cpuinfo | grep processor | wc -l
  • Enter RTAI compiling options:
    • cd /usr/src/rtai
    • sudo make menuconfig
  • Under Machine, set the number of CPUs that you previously found.
  • Exit Configuration, choosing ‘Yes’ when prompted to apply changes.
  • Compile and install RTAI:
    • sudo make
    • sudo make install
    • sudo sed -i 's/\(PATH=\"\)/\1\/usr\/realtime\/bin:/' /etc/environment
  • Edit grub:
    • sudo gedit /etc/default/grub
  • Change GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to GRUB_CMDLINE_LINUX_DEFAULT="quiet splash lapic"
  • Update grub:
    • sudo update-grub
  • Reboot the system.
  • After reboot, set RTAI kernel modules to be loaded at system startup:
    • cd /usr/src/boot
    • sudo cp rtailab /etc/init.d/
    • sudo chmod a+x /etc/init.d/rtailab
    • sudo update-rc.d rtailab defaults
  • Now load RTAI kernel modules without Comedi:
    • sudo /etc/init.d/rtailab preload


Step 4 - Comedi Installation
  • Create directory:
    • sudo mkdir /usr/local/include/linux
  • Install Comedi:
    • cd /usr/src/comedi
    • sudo sh autogen.sh
    • sudo ./configure --with-linuxdir=/usr/src/linux --with-rtaidir=/usr/realtime
    • sudo make
    • sudo make install
    • sudo depmod -a
    • sudo make dev
    • sudo ldconfig
  • Install Comedi Calibrate:
    • cd /usr/src/comedi_calibrate
    • sudo autoreconf -i -B m4
    • sudo ./configure
    • sudo make
    • sudo make install


Step 5 - Second RTAI Installation
  • Copy and link the following files:
    • sudo cp /usr/src/comedi/include/linux/comedi.h /usr/local/include/
    • sudo cp /usr/src/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
  • Enter RTAI compiling options:
    • cd /usr/src/rtai
    • sudo make menuconfig
  • Under Addons, select ‘Real Time COMEDI support in user space’ (by pressing spacebar).
  • Under RTAI Lab, select ‘RTAI Lab’.
  • Exit and save configuration.
  • Install RTAI:
    • sudo make
    • sudo make install
    • sudo cp /usr/src/comedilib/include/comedilib.h /usr/local/include/
  • Navigate with your web browser to http://www.comedi.org/hardware.html and find your DAQ hardware in the list; take note of name under “Driver” column.
  • Edit rtailab startup file with driver for your DAQ board:
    • sudo gedit /etc/init.d/rtailab
  • Replace driver on lines 33 and 55 with the one you found on Comedi website. Save and close.
  • Reboot system.


Step 6 - Scicoslab Installation
  • Navigate with File Browser to /usr/src/scicoslab
  • Right-click on ‘scicoslab.deb’ and select ‘Open with GDebi’.
  • Install package.
  • Repeat for ‘tkdnd1_1.0-1_i386.lucid.deb’.
  • Add RTAI toolbox and palette to Scicoslab:
    • sudo ln -s /usr/realtime/bin/rtai-config /usr/local/bin
    • cd /usr/src/rtai/rtai-lab/scicoslab/macros/
    • sudo make install
    • make user
  • Navigate with File browser to /usr/lib and check scicoslab-gtk folder name. Then make symbolic link accordingly:
    • cd /usr/local/bin
    • sudo ln -s /usr/lib/scicoslab-gtk-4.x/bin/scilab scilab
  • Start Scicoslab as root and check the presence of toolboxes->RTAI in the upper menu:
    • sudo scicoslab


Step 7 - QRTAILab Installation
  • Install QRTAILab:
    • cd /usr/src/qrtailab/qrtailab
    • sudo qmake-qt4
    • sudo make
    • sudo make install


Step 8 - RTAI-XML Installation
  • Install RTAI-XML (pay attention to terminal outputs, you’ll get useful informations on how to use it):
    • cd /usr/src/rtaixml
    • sudo make all
    • sudo make install
  • Set RTAI-XML modules to be loaded at system startup:
    • sudo cp /usr/src/boot/rtaixml /etc/init.d/
    • sudo chmod a+x /etc/init.d/rtaixml
    • sudo update-rc.d rtaixml defaults
  • Start RTAI-XML modules:
    • sudo /etc/init.d/rtaixml start


Step 9 - Set up jRTAI-Lab for remote control
  • The following instructions are for Ubuntu 10.04, though you can easily run jRTAI-Lab on any OS that supports Sun Java Virtual Machine 6.
  • Install JVM6:
    • sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
    • sudo apt-get update
    • sudo apt-get install sun-java6-jre
  • Allow execution of jRTAI-Lab and run it:
    • sudo chmod a+x /usr/src/jrtailab/jRtaiLab.jar
    • java -jar /usr/src/jrtailab/jRtaiLab.jar


Congratulations, you’re done!

Comments