http://linuxcnc.org/hardy/emc2-install.sh
Then follow the instructions on [Installing EMC2]. If you use this method, you don't need to read the rest of this page; just start Using EMC2.
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].
If you have already installed Ubuntu 6.06 "Dapper Drake", you can install emc2 without reinstalling your whole system. Simply download and run the installation script:
http://linuxcnc.org/dapper/emc2-install.sh
Then follow the instructions on [Installing EMC2]. If you use this method, you don't need to read the rest of this page; just start Using EMC2.
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].
If you want to compile emc2 yourself, or wish to install on a different distribution than Ubuntu, continue reading. First, the instructions for compiling the "git" version on Ubuntu are explained. Then, pointers to information about other Linux distributions and other ways of getting the source are given.
If you have all ready installed EMC from the Live CD use only --enable-run-in-place option with ./configure or uninstall EMC first
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 Hardy Heron (8.04) wget http://www.linuxcnc.org/hardy/emc2-install.sh chmod 755 emc2-install.sh ./emc2-install.sh
# For Ubuntu Dapper Drake (6.06) wget http://www.linuxcnc.org/dapper/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.
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 37MB 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.3.0, use
git checkout v2.3.0
Note that if you use an 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 pull --rebaseIf you have made changes locally, then before doing this step you must "git commit" or "git stash" them. For more information, see Git.
$ 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
If you have already installed EMC from the Live CD use only --enable-run-in-place option with ./configure or uninstall EMC first.
(If you uninstall the CD version of EMC you will lose the Applications - CNC menu and the items under it.)
Run these commands in the directory created by git above (usually emc2-dev):
$ cd src $ ./autogen.sh $ ./configure --enable-run-in-place $ make $ sudo make setuid
the make command may take several minutes to complete.
$ cd src $ ./autogen.sh $ ./configure --enable-run-in-place --enable-simulator $ make
the make command may take several minutes to complete.
$ cd src $ ./autogen.sh $ ./configure --enable-run-in-place --enable-build-documentation $ make $ sudo make setuid
When I ran this with 2.4 pre I was missing the package dvipng. I just used the synaptic package manager to install them.
or to just create the PDF documents and no HTML documents
$ ./configure --enable-run-in-place --enable-build-documentation=pdf $ make
the make command may take several minutes to complete.
$ . ../scripts/emc-environment $ emcand choose a configuration file from the list, or specify one on the command line:
$ scripts/emc configs/sim/sim.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.
$ su - # apt-get install build-essential fakeroot git-core gitk git-gui libgtk2.0-dev libgnomeprintui2.2-dev \
tk8.4-dev python2.4-dev python-numarray-ext libpth-dev bwidget xlibmesa-gl-dev \
xlibmesa-glu-dev libreadline5-dev libxmu-dev python2.4-tk # exit
Get the source code for emc 2.2.0 or newer using any method described above.
Configure and build:
$ cd emc2-trunk/src $ ./autogen.sh ;# (not required on v2_3_branch and earlier) $ ./configure --enable-simulator --enable-run-in-place --with-python=/usr/bin/python2.4 $ make
If all looks well, test drive it:
$ ../scripts/emc ../configs/sim/axis.ini
It appears that Debian Sarge does not have python2.4-numarray-ext or python2.4-imaging-tk. Without these packages, at least the "image-to-gcode" filter program will not work.
Released versions of emc2.2.x and older are available from the [SourceForge download area].
You can install emc2 packages offline, provided that you have access to a machine on the internet at some point, such as at a web-cafe for example. The variable $USBKEY should point at the location of your transfer media on both computers, for example:
export DISK = /media/usbdisk
First, make sure the file /etc/apt/sources.list on the connected machine contains the emc2 repository. This is normally done by running the "install.sh" script at the top of this page. Then get the repository information describing what files are available:
sudo apt-get update cd / tar -Pzcf $DISK/lists.tgz /var/lib/apt/lists
the file "lists.tgz" is fairly hefty - around 10-20MB usually. now expand it to the right location in the offline computer:
cd / sudo tar -zxf $DISK/lists.tgz
now it's time to get the list of packages the offline computer needs to run emc2. (on the machine without internet):
apt-get -y -qq --print-uris install emc2 | awk '{print $1}' | sed "s/'//g" > package_list
You can also add the packages needed to compile emc2 to this list, like so:
apt-get -y -qq --print-uris build-dep emc2 | awk '{print $1}' | sed "s/'//g" >> package_list
apt-get -y -qq --print-uris install build-essential | awk '{print $1}' | sed "s/'//g" >> package_list
now transfer the file "package_list" to the machine with the internet connection and issue the command:
cd $DISK; wget -i package_list
This should download all of the packages needed to run (and compile) emc2. You can then install them on the offline computer simply with:
sudo dpkg -i $DISK/*.deb
you can copy the RIP directory to the thumb drive, move it to the machine w/o network and use it (cant build but can run)
trick 1: copying the directory wont get you the symlinks (esp in ~/yourRIP/lib )
so tar the whole thing up tar cvvf myrip.tar ~/myripdir/
cp the tar to the thumb drive cp myrip.tar /media/mythumb
umount the drive after write is done sudo umount /media/mythumb
remove the drive and insert into net-less machine
cp the tar to the net-less box
untar it tar xvf myrip.tar
trick 2: the permissions wont be right yet
cd to the src dir cd ~/myrip/src
run this cmd left over from other machine's build sudo make setuid
should be good to go
cd .. ( or cd ~/myrip )
. scripts/emc-environment
emc
should be running the copied rip now
variation: substitute using a LAN if you can (got network but not Internet... still need to tar it up for symlink copying )
However, emc2 should work with the realtime kernels in each of these older distributions. Many userspace components may be needed, specifically including GNU Make 3.80 or newer. The package names listed below may be helpful in determining the requirements.
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
ubuntu@ubuntu-laptop:~$ sudo apt-get update
[sudo] password for ubuntu: type_your_password Ign cdrom://Ubuntu? 8.04 _Hardy Heron_ - Release i386 (20080423) hardy/main Translation-ru Ign cdrom://Ubuntu? 8.04 _Hardy Heron_ - Release i386 (20080423) hardy/restricted Translation-ru Получено:1 http://ru.archive.ubuntu.com hardy Release.gpg [189B] Получено:2 http://ru.archive.ubuntu.com hardy/main Translation-ru [33,6kB] Получено:3 http://ru.archive.ubuntu.com hardy/universe Translation-ru [59,3kB] Получено:4 http://ru.archive.ubuntu.com hardy/universe Translation-ru [59,3kB] Получено:5 http://ru.archive.ubuntu.com hardy/multiverse Translation-ru [955B] Получено:6 http://ru.archive.ubuntu.com hardy Release [65,9kB] Получено:7 http://ru.archive.ubuntu.com hardy/main Packages [1178kB] Получено:8 http://ru.archive.ubuntu.com hardy/main Sources [338kB] Получено:9 http://ru.archive.ubuntu.com hardy/restricted Sources [1488B] Получено:10 http://ru.archive.ubuntu.com hardy/universe Packages [4293kB] Получено:11 http://ru.archive.ubuntu.com hardy/universe Sources [1323kB] Получено:12 http://ru.archive.ubuntu.com hardy/multiverse Packages [179kB] Получено:13 http://ru.archive.ubuntu.com hardy/multiverse Sources [60,9kB] Получено 7534kB за 27min27s (4572B/c) Чтение списков пакетов... Готово
On 8.04, type (use `Tab' button for auto-completition of the package names):
ubuntu@ubuntu-laptop:~$ sudo apt-get install python2.5-dev python-imaging-tk tk8.4-dev bwidget libreadline-dev gettext libglib2.0-dev mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev xorg-dev build-essential
(On 9.04, just use `python2.6-dev' package -- version `2.6' instead of `2.5'.)
Now, from withing the `src' subdirectory of the emc2 source package (for example, I have just unpacked the `emc2_2.3.1.tar.gz' into `Home' directory and renamed it as `emc2-2.3.1--1'), in Terminal, type `./configure --enable-run-in-place --enable-simulator && make':
ubuntu@ubuntu-laptop:~/emc2-2.3.1--1/src$./configure --enable-run-in-place --enable-simulator && make
(You can type `./configure --help' to view all the options.)
Then `cd ..' to move into upper diectory and `scripts/emc' to run the program.
If for example you have installed a proprietary ATI driver and AXIS interface to the program runs but graphical window is `kind of in a shadow' until you drag the cursor withing this window, append the `/etc/X11/xorg.conf' file with following lines to disable effects as compiz and others:
Section "Extensions" Option "Composite" "disable" EndSection?
You can do it with a command like `sudo gedit /etc/X11/xorg.conf' or `sudo nano /etc/X11/xorg.conf', the latter one can be used in terminal. Now restart the Gnome Desktop Manager in Ubuntu with `sudo /etc/init.d/gdm restart' or KDE Desktop Manager in Kubuntu with `sudo /etc/init.d/kdm restart' for changes to be in effect. If all you have now is only a terminal, not GUI, use `nano' text editor to edit this `xorg.conf' file.
If everything seems to be in order and that graphical window in AXIS interface to EMC2 program works just fine, this particular words about compiling EMC2 in a simulator mode were probably useful to you. Remember, that `build-essential' package can be installed from the installation CD and it makes it possible to compile programs. `Xorg-dev' package installs fonts and other stuff; `tk8.4-dev' also installs `tcl8.4-dev'. This choice of pakages can be wrong or right, but it seems everything altogether works, and you can view or visualize G-Code with EMC2 on a laptop while working in a non-realtime mode in your favorite version of the Linux Ubuntu.
Download emc 2.2.0 or later from any source described above.
Enable the Universe and Multiverse repositories. Install the packages required to build and run emc2 (run "debian/configure sim", then refer to the file debian/control for the required packages).
Configure and build:
$ cd emc2.2/src $ ./autogen.sh ;# (not required on v2_3_branch and earlier) $ ./configure --enable-simulator --enable-run-in-place $ make
If all looks well, test drive it:
$ ../scripts/emc ../configs/sim/axis.ini
.deb package support has been added, though this does not include extras like menu items. Follow the usual "debian/configure sim; dpkg-buildpackage" procedure to build a debian package.
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
um, i guess that's everything. 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.