User Tools

Site Tools

A PCRE internal error occured. This might be caused by a faulty plugin

===== Introduction ===== This guide will help you compile and install all the packages needed to use RTAI with Comedi, ScicosLab and qRtaiLab on an Ubuntu Jaunty machine. Always check if newer versions can be found on their websites, and adjust commands as required. ==== Dependencies ==== **General:** <code> sudo apt-get install cvs subversion build-essential </code> **Kernel:** <code> sudo apt-get install kernel-package linux-source libncurses5-dev </code> **RTAI:** <code> sudo apt-get install libtool automake </code> **Comedi-lib:** <code> sudo apt-get install bison flex </code> **Comedi-calibrate:** <code> sudo apt-get install libboost-dev libboost-program-options-dev libgsl0-dev </code> **ScicosLab:** <code> sudo apt-get install libgtk2.0-dev libgail18 gfortran </code> **Qrtailab:** <code> sudo apt-get install libqt4-dev libqwt5-qt4-dev </code> ==== Getting the source code ==== Kernel sources ([]): <code> cd /usr/src sudo wget sudo tar xjvf linux- sudo ln -s linux- linux </code> RTAI ([] cvs-version): <code> cd /usr/src sudo cvs co magma sudo ln -s magma rtai </code> RTAI ([] tar.gz-version). You have to use version 3.7 or newer, because older versions are not compatible with gcc 4.3.3: <code> cd /usr/src sudo wget --no-check-certificate sudo tar xjvf rtai-3.8.tar.bz2 sudo ln -s rtai-3.8 rtai </code> COMEDI ([]): <code> 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 </code> ScicosLab ([]): <code> cd /opt sudo wget </code> QRTAILab ([] svn - version): <code> cd /opt sudo svn co qrtailab </code> or: QRTAILab ([] tar.gz - version): <code> cd /opt sudo wget sudo tar xvzf QRtaiLab-0.1.9.tar.gz </code> ==== Kernel creation ===== === Patching the kernel === Patch the Linux kernel so it will run in real time mode: <code> cd /usr/src/linux sudo su patch -p1 < /usr/src/rtai/base/arch/x86/patches/hal-linux- </code> === Getting your kernel configuration === At first you should find out which architecture are you using: <code> dpkg --print-architecture </code> **For i386:** A sample config-file for i386 is available from [ here]: <code> cd /usr/src/linux sudo wget sudo cp config-2.6.28-rtai_i386 .config </code> But it’s better if you just copy the configuration file from your running kernel: <code> sudo cp /boot/gedit config-`uname -r` .config </code> **For amd64:** Sorry, there is no sample config file. === Kernel configuration === Go ahead and configure your kernel before you compile it: <code> cd /usr/src/linux sudo make menuconfig </code> Run lspci on a separate console window, refer to it to select the appropriate option on the kernel configuration, mostly related to manufacturer (e.g.: SATA Controller from Intel or VIA). Check and change if needed the following points: *Inside Processor type and features: **Symmetric multi-processing support (multiprocessor) **Processor family *Inside Device Drivers: **Network device support -> Ethernet (XXXX Mbit) **Network device support -> Wlan **Graphics support -> /dev/agpgart (AGP Support) **Sound card support -> Advanced Linux Sound Architecture -> PCI sound devices We used a server with two Xeon 1.7 GHz processors, so we checked that: <code> [*] Symmetric multi-processing support </code> and <code> (X) Pentium-4/Celeron(P4-based)/Pentium-4 M/older Xeon </code> looked like this: <code> Processor family (Pentium-4/Celeron(P4-based)/Pentium-4 M/older Xeon </code> === Compiling the kernel === <code> cd /usr/src/linux sudo make-kpkg clean sudo make-kpkg --initrd kernel_image kernel_headers kernel_source </code> === Kernel installation === **i386:** <code> cd /usr/src sudo dpkg -i linux-headers- sudo dpkg -i linux-image- </code> **amd64:** <code> cd /usr/src sudo dpkg -i linux-headers- sudo dpkg -i linux-image- </code> Reboot in the new compiled RTAI kernel. <code> sudo reboot </code> ==== Installing RTAI ==== You need to do this twice do to dependencies. **RTAI #1** <code> cd /usr/src/rtai sudo make menuconfig </code> Be sure that the directories are correct: *Installation: /usr/realtime *Kernel source: /usr/src/linux *Under Machine, choose number of CPUs (check running cat /proc/cpuinfo and verifying how many processors are listed, we chose 2) **Note:** with kernel 2.26.3 it was also required to unselect “In-Kernel C++ Support” under “Add-Ons” **Compile RTAI:** <code> sudo make sudo make install sudo sed -i 's/\(PATH=\"\)/\1\/usr\/realtime\/bin:/' /etc/environment </code> Now run 'export PATH=/usr/realtime/bin:$PATH' for each open shell or do a logout and login. **Test RTAI:** <code> cd /usr/realtime/testsuite/kern/latency ./run </code> Type ctrl-c to stop execution. = Installing Comedi= In order to install Comedi, you need to install Comedilib and Comedi-calibrate. **Comedilib:** <code> cd /opt/comedilib sudo sh sudo ./configure --with-udev-hotplug=/lib --sysconfdir=/etc sudo make sudo make install </code> **Comedi-calibrate:** <code> cd /opt/comedi_calibrate sudo autoreconf -i -B m4 sudo ./configure sudo make sudo make install </code> To calibrate your card, use comedi_calibrate, or comedi_soft_calibrate if you have a M-series NI card. **Comedi:** <code> cd /opt/comedi sudo sh sudo ./configure --with-linuxdir=/usr/src/linux --with-rtaidir=/usr/realtime --enable-pci --disable-pcmcia sudo make sudo make install sudo make dev </code> This is necessary for pcmcia-daq-cards (enable pcmcia in past configure command): <code> sudo su echo 'options comedi comedi_num_legacy_minors=4' > /etc/modprobe.d/comedi exit </code> ==== Installing RTAI + Comedi ==== Now you can go ahead and reinstall RTAI with Comedi support. **RTAI #2** <code> cd /usr/src/rtai sudo make menuconfig </code> Under “Add-Ons”, select: <code> [*] Real Time COMEDI support in user space </code> Menu RTAI-Lab: <code> [*] RTAI Lab </code> Adjust EFLTK installation directory (default is /usr/local). Exit menuconfig and save configuration. Now do: <code> 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 sudo make sudo make install </code> **Test RTAI** Create a shell script <code> cd nano </code> and copy the following with “Crtl+Shift v”: <code> insmod /usr/realtime/modules/rtai_hal.ko insmod /usr/realtime/modules/rtai_lxrt.ko insmod /usr/realtime/modules/rtai_up.ko # or rtai_lxrt.ko insmod /usr/realtime/modules/rtai_fifos.ko insmod /usr/realtime/modules/rtai_sem.ko insmod /usr/realtime/modules/rtai_mbx.ko insmod /usr/realtime/modules/rtai_msg.ko insmod /usr/realtime/modules/rtai_netrpc.ko ThisNode="" insmod /usr/realtime/modules/rtai_shm.ko insmod /usr/realtime/modules/rtai_tasklets.ko modprobe comedi modprobe kcomedilib modprobe comedi_fc modprobe ni_pcimio insmod /usr/realtime/modules/rtai_comedi.ko </code> Close it, make it executable and run it: <code> sudo chmod 777 sudo sh </code> Finally, run the test: <code> cd /usr/realtime/testsuite/kern/latency ./run </code> Type ctrl-c to stop execution. === ScicosLab + RTAI-Lab add-ons === Install ScicosLab: <code> cd /opt sudo dpkg -i /tmp/scicoslab-gtk_4.3-3_i386.jaunty.deb </code> Install RTAI-Lab add-ons as root and as user: <code> cd /usr/local/src/rtai/rtai-lab/scilab/ sudo make install # to install rtmain.c in /usr/realtime/share/rtai/scicos cd ../scicoslab/macros sudo su -c "make install" make user </code> ===== References ===== **RTAI installation:** **RTAI + Kubuntu 9.04 + ScicosLab + Qrtailab:**

installing_rtai_comedi_scicoslab_qrtailab_on_ubuntu_9.04.txt · Last modified: 2017/01/03 21:29 by admin