-
Notifications
You must be signed in to change notification settings - Fork 7
Building LinuxCNC From Source
These are the steps to build a Run-In-Place (RIP) version of LinuxCNC from source. This is the best way to try out the LinuxCNC development branches as it does not effect any installed version of LinuxCNC. RIP also makes it very easy to rebuild LinuxCNC to include any modifications to the source. If you have modified a file, simply run make in the src directory to compile the changes. Only the modified files will be re-compiled, so it should make fast allowing for rapid iteration of changes.
If you do not already have git, install it by saying
$ sudo apt-get install git
Open a terminal where you would like to build LinuxCNC. I use ~/sources, to keep things neat, but you can put it wherever you like. Then clone the LinuxCNC repository by saying
$ git clone https://github.com/LinuxCNC/linuxcnc.git linuxcnc-dev
Then enter the new directory
$ cd linuxcnc-dev
The default branch is master (2.8~pre). To build another branch you have to switch to it. For example, to build current stable (2.7) you would first fetch (download) and then switch to the 2.7 branch by saying
$ git fetch origin 2.7
$ git checkout 2.7
Next configure how the code should be compiled. You should configure for uspace when compiling for vanilla and Preempt-RT kernels, if you are running an RTAI kernel than use -r instead.
$ cd debian
$ ./configure uspace
$ cd ..
$ dpkg-checkbuilddeps
Copy/paste each of the build deps then install with
$ sudo apt-get install <dep-name>
Check deps again
$ dpkg-checkbuilddeps
Repeat until all of the dependencies are installed
$ cd src
$ ./autogen.sh
$ ./configure
$ make -j4
Allow access to hardware
$ sudo make setuid
$ . ../scripts/rip-environment
You need to run this each time you open a new terminal.
$ linuxcnc
LinuxCNC will print the version that is running, check that it is what you expected.