l 内核2.6.38.8
1.安装必须包
sudo apt-get install fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge
sudo apt-get build-dep linux
sudo apt-get install git-core libncurses5 libncurses5-dev binutils-dev libelf-dev asciidoc xmlto
2. 编译内核
tar jxvf linux-2.6.38.8.tar.bz2
tar jxvf rtai-3.9.tar.bz2
cd /usr/src/linux-2.6.38.8/
patch -p1 < ../rtai-3.9/base/arch/x86/patches/hal-linux-2.6.38.8-x86-2.11-02.patch
make mrproper
make menuconfig
// 具体配置见另外的文章
http://blog.csdn.net/hf024_rita/article/details/8026262make
make modules
make modules_install
make install
mkinitramfs -o initrd.img-2.6.38.8rtai-1 /lib/modules/2.6.38.8rtai-1
cp initrd.img-2.6.38.8rtai-1 /boot
sudo update-grub2
sudo reboot //重启前,确定grub配置文件中的GRUB_HIDDEN_TIMEOUT!=0,否则编译的内核有不错误是,启动不了
l RTAI
安装 rtai:
cd /usr/src
cd rtai-3.9
make menuconfig
配置如下:
----------------------------------------------------------
In the menu "General" set the rtai-path (/usr/realtime) and the path to the kernel sources (/usr/src/linux-2.6.38.8)
.--------------------------------------------------------
make
make install
export PATH=/usr/realtime/bin:$PATH
cd /usr/realtime/testsuite/kern/latency
./run
l EMC2
安装emc2:
wget http://www.linuxcnc.org/lucid/emc2-install.sh
chmod 755 emc2-install.sh
./emc2-install.sh
sudo apt-get build-dep emc2
sudo apt-get install build-essential autoconf
sudo apt-get install git-core gitk git-gui
git clone git://git.linuxcnc.org/git/emc2.git emc2-dev
cd emc2-dev
cd src
./autogen.sh
./configure --enable-simulator
make
make install-menus
. ./rip-environment
./linuxcnc
安装中(./configure --enable-simulator )遇到的问题:
问题1:
checking libgl1-mesa-dri workaround... test for libgl1-mesa-dri workaround failed, please file a bug
原因:缺少库 libgl1-mesa-dri
解决办法:
sudo apt-get install libpth-dev tcl8.5-dev tk8.5-dev bwidget libxaw7-dev libreadline5-dev python-dev libglu1-mesa-dev libxinerama-dev autoconf python-tk libglib2.0-dev libxft-dev gettext
问题2:
configure: error: GTK2 missing. Install it or specify --disable-gtk to skip the parts of emc2 that depend on GTK
解决:
apt-get install glade libglade2-dev
问题3:
checking whether the Boost::Python headers are available... no
configure: error: boost::python is required to build LinuxCNC
解决:
sudo apt-get install python-gnome2 python-glade2 python-numpy python-imaging python-xlib python-gtkglext1 python-configobj python-gtksourceview2
sudo apt-get install libboost-python-dev