2008年4月5日星期六

EMC2 安装说明

emc2/docs/INSTALL

正式安装
-----------------

在标准的 Linux 操作系统上,按下面的过程编译安装:

从顶录录进入到源文件目录:

cd src

在源文件目录中,构建安装EMC2:

./configure
make clean
make
sudo make install

然后输入emc来运行它。

测试安装
-------

如果你想在安装前测试它,或者你担心它会覆盖了已安装好的,可用此方法来测试
你将使用 Run-In-Place (RIP)方式安装:

从顶目录进入到源文件夹:

cd src

在源文件夹中,用(RIP)方式编译安装:

./configure --enable-run-in-place
make clean
make
sudo make setuid

然后返回顶文件夹中,输入下行去运行EMC2:

scripts/emc


详细描述
====================


执行脚本
===============

本软件的运行脚本是 emc ,在安装好的系统上输入 ‘emc’ 来运行。
在 Run-In-Place 方式安装的系统上,(例刚从 CVS 仓库中下载测试),
测运行它要输入路径:
emc2/scripts/emc
如果你刚从CVS中下载,则没有‘scripts/emc’文件,只compilation有‘scripts/emc.in’。
配置程序将跟据它来生成‘scripts/emc’,其实它只是修改其中的某些默认值(文件夹、路径等)。



配置脚本
================

配置脚本‘configure’通过测试而设定适当的值来用于编译安装,它把这些值新建在 ‘Makefile.inc’ 文件中。
然后,它创建‘config.status’脚本,用于以后重建当前的配置文件,
‘config.cache’缓存了测试结果,可更快地重建配置,
‘config.log’记录测试日志(主要用于调试‘configure’)

‘configure.ini’文件用于‘autoconf’程序来创建‘configure’脚本,如果你要用‘autoconf’程序,改变或重建一个新的版本,只需要‘configure.in’文件。

下面简单介绍编译本软件的方法:

1. `cd' 进行到源文件夹中,输入 `./configure' 将根据你的环境进行配置, 如果你用的是
‘csh’ 解析器,你需要输入 `sh ./configure' 即用‘sh’替代‘csh’。

‘configure' 需要花一些时间,运行时,它会输出所检查内容的信息。

2. 输入‘make’开始编译软件。

3. 输入 ‘scripts/emc’测试本软件 。


编译及选项
=====================

有些平台的编译器和链接器需要一些罕见的参数,而‘configure’并不知道需要这些参数,
所以你要在环境变量中设定好这初始参数。 例如用 Bourne-compatible 编译器,你需要用
下面的命令:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure

或者用系统提供的‘env’命令,如下:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure


功能参数
=================
EMC 只有在 Real-Time (实时)系统上,才能控制操作硬件。 要么用 RTLinux 要么用 RTAI.
如果没有安装,EMC 就不能控制任何机器,请安装好其中的一个,(顺便共享一下过程给其他人)

不管怎样,EMC 也可以在没有 RT(实时)的系统中测试, 这需要用模拟模式, 它不需要控制硬件。
你需要用 '--enable-simulator' 选项来启用模拟模式。

如果在你的 /usr/src 中有多个 RTAI 或 RTLinux 版本,你要用下面的参数来选定正确的一个:

./configure --with-rtai=/usr/src/rtai-24.1.12

如果你仅想在此地测试(不安装),请用下面的参数:
--enable-run-in-place 在当前文件夹中运行(不安装到系统)


如果你不需要生成用文档,请用下面的参数:
--disable-build-documentation 不自动构建文档

configure 还可接受其它参数。 用 --help 获取参数清单.

--with-realtime= RTAI 或 RTLINUX 的安装目录
--enable-simulator 启动模拟器
--with-module-dir= 内核模块目录
--with-gtk_ver= GTK 版本
--with-kbuild= Specify if your kernel uses kbuild or not
--with-rmmod=
rmmod variant
--with-insmod= insmod variant
--with-python= Specify the Python interpreter
--with-tclConfig= Specify the path to tclConfig
--with-tkConfig= Specify the path to tkConfig
--with-x use the X Window System
--with-locale-dir=DIR Location of the locale file(s)
DATADIR/locale


控制参数
==================

`configure' 要用下面参数来控制它的动作

`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.

`--help'
简单显示 ‘configure’的所有参数

`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).

`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.

`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.


翻译:gnix_oag
Email:gnix.oag@gmail.com

2 条评论:

michaeljun 说...

高教授你好,我已经安装了Ubuntu8.04环境下EMC2,但是在网上查了很久,都没能找到这个软件的使用方法,还有可导入什么样的代码文件,和怎样导入,请高教授看到留言后能在空闲时间给予解答,谢谢了!

michaeljun 说...

我将每天定时来浏览贵博客,希望高教授能提供更多的信息,再次谢过了!