[EMC2 Live CD]. If you use this method, you don't need to read the rest of this page; just start Using EMC2. You can also use the CD to Install to CompactFlash.
If all you want to do is run EMC2, you can stop reading this page now! The instructions above give you a standard, released version of EMC2, which is what most users have. It is the version with the best support from manuals, the mailing list, and the IRC channel.
If you want to compile additional components for EMC2, you can stop reading this page now! You do not have to recompile emc2 just to add components. For instructions on adding components, read [How to compile and install a component].
The instructions above give you a standard, released version of EMC2, which is what most users have. It is the version with the best support from manuals, the mailing list, and the IRC channel.
[EMC2 git] repo are automatically built, and are available to be installed. The set of available packages and instructions on how to use them are available here on the [EMC2 buildbot].
? downloaded from the linuxcnc.org website. If you wish to build emc2 from source, follow the steps given below. Indented text that looks
like the text on this lineis text that you type into the terminal or editor window.
First enable the universe repository (for lyx-qt, libpth-dev, and possibly other packages) [as explained here] if it is not already enabled.
You need to add the linuxcnc repository to your /etc/apt/sources.list. You may follow the last part of the [basic instructions] to do this or simply do (the following will also install emc2):
# For Ubuntu Lucid (10.04) wget http://www.linuxcnc.org/lucid/emc2-install.sh chmod 755 emc2-install.sh ./emc2-install.sh
# For Ubuntu Hardy Heron (8.04) wget http://www.linuxcnc.org/hardy/emc2-install.sh chmod 755 emc2-install.sh ./emc2-install.sh
Ubuntu will ask you for your root password in order for the emc2-install.sh script to modify /etc/apt/sources.list and install the new required packages. At this point, you must reboot and select the rtai kernel from the grub bootloader menu. Then, continue with the next step.
sudo apt-get build-dep emc2 sudo apt-get install build-essential autoconfIf you get an error like this one:
Package libpth-dev is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package libpth-dev has no installation candidatethen you have not configured apt correctly and the compilation step will fail.
Git. If you plan to make changes to emc2, it's highly recommended to use this method. With git, you can maintain your changes over time while getting bugfixes and new features. Git also makes it easy to submit your improvements to the linuxcnc.org team for inclusion in future versions of the software.
First, follow the steps above to get the extra packages needed to compile emc.
Before you can get a copy of EMC2 from our git server you will need to install the git program:
sudo apt-get install git-core gitk git-gui
Once you have installed git, you will use one of the following forms of the git clone command:
git clone git://git.linuxcnc.org/git/emc2.git emc2-devThis puts the project in the directory 'emc2-dev'. To put the local copy of the project in a different location, just change the last argument of the 'git clone' command. Git will download about 45MB of data and it takes about 7 minutes to complete. You should only have to do this once.
The commands below generally assume you are inside the emc2-dev directory.
By default, you will get files from "master", which is the name for the branch where new feature development takes place. If you want to track another branch,
git branch --track v2.4_branch origin/v2.4_branch git checkout v2.4_branch(For branches before v2.4_branch, use the form v2_3_branch instead)
To get a particular version of emc, use
git checkout vX.Y.ZFor instance, to get released version 2.4.0, use
git checkout v2.4.0
Note that if you use a tag for a specific release, you will never get any updates since the tag specifies a particular snapshot of the files. Using a branch tag, such as "v2.4_branch", will continue to get changes as long as that branch is being developed.
Git has more instructions, such as how to update your version of emc2 after other developers have made improvements.
git pullIf you have made changes locally, then before doing this step you must "git commit" or "git stash" them. For more information, see Git.
If you do not have a recent EMC install from CD or net on your machine, you might miss some build dependencies (packages needed for a compile, or documentation build).
These make the next step (build) fail during the './configure ..' run.
If this happens, proceed as follows:
$ cd debian $ ./configure -a (if installing simulator use "./configure sim" instead) $ cd .. $ dpkg-checkbuilddeps
Then "apt-get install" each of the missing build dependencies, and your configure should work (the configure script in src this time, not in the debian directory). If installing simulator - don't apt-get install the rtai-modules-x.x.... package.
If you have already installed EMC from the Live CD do not use --prefix/make install. Use the 'run in place' method (the default) instead.
Run these commands in the directory created by git above (usually emc2-dev):
$ cd src $ ./autogen.sh $ ./configure $ make $ make install-menus $ sudo make setuid
the make command may take several minutes to complete.
Offline machines can get autogen & build-essential packages using Synaptic and a thumb drive.
begin ------------------offline machine gets autogen and build-essential pks ------------------- The offline machine wont have autogen nor build-essentials to begin with, so what to do? Use a thumb drive (or similar) and Syanaptic to create 'wget' scripts. Just grabbing files from internet does not work well, you need to accommodate the dependencies for the files you grab. Synaptic can review your system state and build a list of files based on what that state is. The state of your package information can go stale, and you cannot update that information while offline, but the following sequence helped me get the files needed to build emc for an offline system. I used a thumb drive and took advantage of a feature in Synaptic 'File|Generate package download list'. This command creates a shell script file that uses wget for the <b> already selected files</b>. ( the 'already selected files' might be autogen and build-essential for example ). Once this script is generated, it can be placed onto the removable media, taken to a machine that <b>is</b> online, and the packages retrieved to the removable media. Then, the media can be moved back to the offline system, and when running Synaptic again, choose 'Files | Add downloaded packages'. For most folks the default action of installing all files will be whats wanted. (this may not be what you want to do, and you can cancel if thats true, the files will be placed in the system pkg cache for later use ). During the on-line downloads, the wget program may error with a message saying a file is not found. In my case it happened because a file version was no longer available due to a stale package information database. For example, simply changing python-gnome2-extras_2.19.1-0ubuntu7.1_i386.deb to python-gnome2-extras_2.19.1-0ubuntu7.2_i386.deb in the script fixed this for me. So a few stabs at the wget script should get all the files you need for the offline machine. hth tom3p end ------------------offline machine gets autogen and build-essential pks -------------------
$ cd src $ ./autogen.sh $ ./configure --enable-simulator $ make $ make install-menus
the make command may take several minutes to complete.
Alternately, you can install a pre-compiled simulation-only version: download and execute http://linuxcnc.org/lucid/emc2-install-sim.sh (lucid lynx) or http://linuxcnc.org/hardy/emc2-install-sim.sh (hardy heron)
Starting in 2.5 you might need to install additional packages to build documentation, these are *not* installed by "apt-get build-dep emc2":
$ sudo apt-get install asciidoc source-highlight dblatex dvipng
$ . ./scripts/emc-environment $ emcand choose a configuration file from the list, or specify one on the command line:
$ scripts/emc configs/sim/axis.iniIf you get an error like
Realtime system did not loadthen stop the rtai with
$ halcmd unloadrt all $ halcmd stopthen start again. Sometimes the first load will clear up an issue...
If you compile for realtime in a directory tree (git checkout), and then later reconfigure for --enable-simulator, you must do
$ make cleanto get rid of the realtime object files. The same applies when switching from simulation to realtime. This is because "make" doesn't know that you've changed modes. It only sees that the object files are newer than the source, and thinks they don't need to be recompiled.
Another potential problem when switching from realtime to simulation is environment variables. The command
$ . scripts/emc-environmentsets some environment variables in your shell to point to various parts of the run-in-place code. Some of those variables are different for realtime vs. simulation. If you switch modes, you should close the shell you were using, open a new one, and run
$ . scripts/emc-environmentbefore starting EMC from that shell.
The same issues can arise if you have multiple git checkouts and switch between them using the same shell. If you are switching between versions or checkouts, it is best to use one shell for each one.
EMC With Custom Kernel
$ 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
$ sudo apt-get install python-gnome2 python-glade2 python-numpy python-imaging python-xlib python-gtkglext1 python-configobj python-gtksourceview2
If configured to build for the running kernel:
$ debian/configure -r $ dpkg-checkbuilddeps
If configured to build without a realtime kernel (simulator mode):
$ debian/configure sim $ dpkg-checkbuilddeps
The dpkg-checkbuilddeps command should produce no output.
Run debian/configure without any options for usage help.
Debian Lenny Compile RTAI
Debian Lenny Compile LinuxCNC
Debian Etch Compile RTAI
Debian Etch Compile LinuxCNC
Debian Etch Server And Diskless LinuxCNC Thin Clients
Released versions of emc2.2.x and older are available from the [SourceForge download area].
RtaiSteps to build a real-time kernel for your particular Linux distribution. After that, you'll have to figure out the names of the extra packages needed to install and run emc2. As an aid, these are the packages required by the emc2 ubuntu package:
Depends: libatk1.0-0 (>= 1.9.0), libc6 (>= 2.3.4-1), libcairo2 (>= 1.0.2-2), libfontconfig1 (>= 2.3.0), libgcc1 (>= 1:4.0.2), libgl1-mesa | libgl1, libglib2.0-0 (>= 2.10.0), libglu1-mesa | libglu1, libgtk2.0-0 (>= 2.8.0), libice6, libpango1.0-0 (>= 1.12.3), libreadline5 (>= 5.1), libsm6, libstdc++6 (>= 4.0.2-4), libx11-6, libxaw7, libxcursor1 (>> 1.1.2), libxext6, libxfixes3, libxi6, libxinerama1, libxmu6, libxrandr2, libxrender1, libxt6, tcl8.4 (>= 8.4.5), tk8.4 (>= 8.4.5), linux-image-2.6.15-magma, rtai-modules-2.6.15-magma, tcl8.4, tk8.4, libreadline5, python2.4-numarray, python2.4-imaging, python2.4-imaging-tk, python (>= 2.4), python (<< 2.5), emc2, python (<< 2.5), python (>= 2.4), bwidget (>= 1.7), bwidget (<< 1.8), python2.4-tk, python2.4-xml
Build-Depends: debhelper (>> 4.0.0), linux-image-2.6.15-magma, rtai-modules-2.6.15-magma, linux-headers-2.6.15-magma, gcc-4.0, g++, make, libc6-dev, tcl8.4-dev, tk8.4-dev, libgtk2.0-dev, pciutils-dev, libncurses-dev, gettext, libxaw7-dev, libreadline5-dev, lyx-qt, python, tetex-bin, latex2html, python2.4-dev, libglu1-mesa-dev, libgl1-mesa-dev, libgnomeprint2.2-dev, groff, bwidget, tetex-extra
To get your nvidia graphics card working, edit the xorg.conf file in the /etc/X11 directory. At about line 66, in the section "Device", find a line that looks like: Driver "nvidia" , replace nvidia with "nv" or "vesa" (try "nv" first). If you have previously tried to use the nvidia driver, you must remove nvidia-related packages by issuing the following command from a terminal:
sudo apt-get --purge remove nvidia-glx nvidia-settings nvidia-kernel-common
There is at least one report that even when using the open source 'nv' driver, the latency test will show failures.
export SRCPATH=<path to your emc build>
#remove the python modules cd /usr/lib/python2.4/site-packages/ ls $SRCPATH/lib/python | xargs sudo rm -r
sudo rm -r /usr/local/etc/emc2/ /usr/realtime*/modules/emc2/ /usr/local/share/emc/ /usr/local/share/axis/ sudo rm /etc/init.d/realtime
cd /usr/local/bin/ ls $SRCPATH/bin/ | xargs sudo rm sudo rm emc emcmkdesktop halrun
cd /usr/local/lib ls $SRCPATH/lib/ | xargs sudo rm
You may need to apt-get remove --purge emc2 if you installed it "over" the existing install, otherwise you will get the wrong /etc/init.d/realtime script (or no script!)
One way to avoid this predicament is instead of "make install", to use the "checkinstall" program, which monitors the install process and creates a package for you that can easily be uninstalled.