------------------------------------------------ Precision MicroControl Corp. Motion Control API for GNU/Linux INSTALL File $Id: INSTALL 436 2008-04-07 23:19:13Z brian $ ------------------------------------------------ Portions of this file are Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Portions of this file Copyright (C) 2005-2008 by Precision MicroControl Corp. INSTALL for the Motion Control API ================================== The simple case --------------- > ./configure > make > su > make install > /sbin/ldconfig > /sbin/service mcapi start (or /etc/init.d/mcapi start) > exit Note that the default install to directory for the MCAPI libraries is /usr/local/lib. You may need to add this path to the configuration for the dynamic linker (/etc/ld.so.conf) before running ldconfig. Alternatively you may change the installation paths with command line options to configure (see below). Test by typing 'dcxctrl' at the command prompt and when the dcxctrl prompt appears (a '>') type ve and hit return to get the controller version information. Exit dcxctrl by typing CTRL+] (just like telnet) to return to dcxctrl command mode and then type exit. If the device driver loads successfully (i.e. a motion control card is detected), the driver will create several files in the /proc filesystem under: /proc/drivers/mcapi Cat'ing the file /proc/drivers/mcapi/version will return information about the driver version, build date, etc., cat'ing the file /proc/drivers/mcapi/controllers/0 returns info about the first motion controller, etc. Ubuntu Notes ------------ Beginning with version 4.1.0 the MCAPI scripts should be Ubuntu firendly. To build the base libraries you will need C++ support: sudo apt-get install g++ If you prefer to use the redhat style "service" script to start and stop the driver (as opposed to referencing /etc/init.d/mcapi directly): sudo apt-get install sysvconfig Finally, to build the graphical sample gcdemo you will need the gnome development libraries: sudo apt-get install gnome-devel Other Kernels ------------- To build the device driver for a kernel other than the kernel that is currently running cd to the driver source directory and run make manually, specifying the desired kernel version as the value of the KVERSION macro: make KVERSION=2.6.20-1.2316.fc5 The kernel version string should match the format used by `uname -r` and the development headers must by installed for that kernel (look in /usr/src/kernels for installed kernels). To remove the MCAPI ------------------- > su > make uninstall > ldconfig > exit Documentation ------------- A preliminary version of html-based documentation has been included for Linux users in this release. Linux users will need to have the doxygen utility installed (available pre-packaged for most distros) and should run the following command in the mcapi library folder: > cd src/core_libs/mcapi > doxygen doxygen.conf This is a work in progress, but is already fairly complete. Eventually this is intended to be used as online help on all platforms. The output will be located in src/core_libs/docs/mcapi. Samples ======= The dcxctrl terminal interface program is built and installed by the default build above (dcxctrl is needed by the mcapi service startup script to load the motion controller's firmware). The other samples - gcdemo and console - may be built by running make in the source folder of the sample. Console demonstrates a simple command line application in C, and gcdemo provides a more elaborate gui application (gcdemo requires gnome & gtk). Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. For Redhat systems you may want to use `--prefix=/usr' to more closely match the Redhat defaults. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--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. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details.