LinuxCNC Run In Place

From EuSurplusWiki
Jump to: navigation, search


Run in place

We choose run in place method instead a pre-installed version so that is possible to compile custom hal components and to get access to the last features developed on LinuxCNC.

Install git

If it is not already present, you also will need to install git to get the source code of LinuxCNC.

Git is a distributed revision control system with an emphasis on speed, data integrity, and support for distributed, non-linear workflows. Every Git working directory is a full-fledged repository with complete history and full version-tracking capabilities, independent of network access or a central server. [1]

Download the source code of LinuxCNC

Enter the Terminal window ans place the following code:

$ git clone git@github.com:LinuxCNC/linuxcnc.git linuxcnc-dev


This puts the project in the directory 'linuxcnc-dev'. To put the local copy of the project in a different location, just change the last argument of the 'git clone' command. The commands below generally assume you have now changed to the directory created by the git clone command. By default, you will get files from "master", which is the name for the branch where new feature development takes place. [2]

The output of Terminal Window should look like that:

Rip0.png

Next enter in the recently created folder by typing:

$ cd linuxcnc-dev
To follow the master branch
$ git checkout master

To get the latest updates use:

$ git pull

The last two commands wasn't needed since by default we are using the master branch and the files are up to date.

Install the source code of LinuxCNC

Resolving build dependencies

Place the following commands:

$ cd debian
$ ./configure -a
$ cd ..
$ dpkg-checkbuilddeps

The output of Terminal Window should look like that:

Rip1.png

This list is all the packages that it's deeded to install to be able to compile the source code.

It can be installed by using the command:

$ sudo apt-get install "name of the dependency"

In this case, the dependencies names that have to be installed are:

$ sudo apt-get install dvipng

dvipng
texlive-extra-utils
texlive-latex-recommended
texlive-fonts-recommended
imagemagick
texlive-lang-french
texlive-lang-german
texlive-lang-spanish
texlive-lang-polish
tcl8.5-dev
tk8.5-dev
libxaw7-dev
libncurses-dev
libreadline-dev
asciidoc
source-highlight
groff
python-lxml
libglu1-mesa-dev
libgnomeprintui2.2-dev
libboost-python-dev
texlive-lang-cyrillic
libmodbus-dev
libusb-1.0-0-dev
graphviz
inkscape

After all those dependencies are installed, issue the command:

$ dpkg-checkbuilddeps

This should be the terminal output:

Rip2.png

Building LinuxCNC

Run these commands in the linuxcnc-dev

$ cd src
$ ./autogen.sh
$ ./configure

When ./configure command was run, in the end got this error:

Rip3.png

Just follow the instructions and insert the command:

$ sudo apt-get install tclx

And run again:

$ ./configure

If everything goes well the terminal output is:

Rip4.png

Now is time to compile the code:

$ make
$ make install-menus
$ sudo make setuid


Run Linuxcnc (run in place)

Now that LinuxCNC is compiled, its time to run it.

$ . ../scripts/rip-environment
$ linuxcnc

And LinuxCNC should start, in this case we run a simulation configuration (axis_9axis).

Rip5.png

Create a shortcut for configuration

For a run in place configuration, its important to create a launcher to run the configuration files.

On the descktop, press right mouser button and "create launcher"

Createlauncher.png

And then fill the desired fields.

Createlauncher1.png

The important field is the "Command", and should follow the next rule:

"path to run in place LinuxCNC" "path to *.INI configuration file"

In this case

home/machinebuild/linuxcnc-dev/scripts/linuxcnc /home/machinebuild/linuxcnc-dev/configs/sim/axis/axis_9axis.ini

Press create and its done.

Createlauncher2.png


Compile and install components

If you create a component the same must be compiled and installed. In order to do this the following commands should be made.

Browse to the base directory of the linuxcnc installation, normally linuxcnc-dev:

$ cd linuxcnc-dev
$ . ./scripts/rip-enviorment
$ cd configs/YOUR_CONFIG_NAME
$ halcompile --install YOUR_COMPONENT_NAME