此文简要介绍,如何从源码安装linuxCNC。原因是在使用LinuxCNC时,发现没有halcompile命令,不了解如何生成module,loadrt加载模块的过程,所以从源码安装,再分析。
为测试方便,源码安装再虚拟机vmware上。
安装过程:
1、按照上一篇的博客,安装前7步。
2、获取实时核的头文件
sudo apt-get install linux-headers-3.4-9-rtai-686-pae
3、安装自动生成配置文件相关内容的包
sudo apt-get install autoconf automake libtool
4、尝试编译
git clone git://github.com/linuxcnc/linuxcnc.git linuxcnc-dev
cd linuxcnc-dev/src
./autogen.sh
生成配置文件
5、检测编译环境
./configure --with-realtime=uspace
6、安装依赖 http://www.linuxcnc.org/docs/devel/html/code/building-linuxcnc.html#Satisfying-Build-Dependencies
sudo apt-get install python-support libudev-dev libgnomeprintui2.2-dev rtai-modules-3.4-9-rtai-686-pae libxenomai-dev tcl8.5-dev tk8.5-dev libreadline-gplv2-dev asciidoc dblatex docbook-xsl dvipng graphviz groff imagemagick inkscape python-lxml source-highlight texlive-extra-utils texlive-font-utils texlive-fonts-recommended texlive-lang-cyrillic texlive-lang-french texlive-lang-german texlive-lang-polish texlive-lang-spanish texlive-latex-recommended w3c-linkchecker xsltproc python-dev python-tk libxmu-dev libglu1-mesa-dev libgl1-mesa-dev libgtk2.0-dev gettext intltool libboost-python-dev libmodbus-dev libusb-1.0-0-dev yapps2
7、编译之前再次安装依赖项,根据提示安装。
依赖安装完成后的界面:
8、编译和测试,使用了下面的命令
当然最后的halcompile也能使用。
参考:
http://www.linuxcnc.org/docs/devel/html/code/building-linuxcnc.html
http://www.linuxcnc.org/docs/devel/html/code/building-linuxcnc.html#Satisfying-Build-Dependencies