linuxcnc on arch

More
30 Nov 2017 20:56 #102545 by Pumuckl
Pumuckl created the topic: linuxcnc on arch
Hey guys,

I have some old epia bords lying around that I want to use for linuxcnc. I did install the weezy image and am getting latencies <10us but everything else is just far too slow. That's why I want to try arch because only stuff I turn on or install is on by default.

So here is what I did and where I am atm:

Getting Linuxcnc to compile:
Fresh install of the latest arch base and devel packages, twm, git and wget. Got linuxcnc from git://github.com/linuxcnc/linuxcnc.git and installed all the needed packages from the official or aur repository. Check that everything is installed by compiling without realtime and testing. axis works, gmoccapy is missing some stuff, but no problem for now.

Getting RTAI:
Got RTAI from here: github.com/NTULINUX/RTAI . The latest supported kernel is 3.16.47. so downgraded my kernel, and kernel headers to 3.4.1 to have a startingpoint for the 3.16.47 kernel config. Booted the new (old) kernel got the official 3.16.47 kernel and created a .config with localmodconfig. Changed my cpu, compiled, installed and checked if everything works.
Then I basically followed the instructions in README.INSTALL. Patched the kernel (there are 7 numbered patches, did apply one after the other) compiled it, installed it rebooted, compiled RTAI and installed.

Compiling Linuxcnc with RTAI support:
Now I am stuck. When I run ./configure --with-realtime=/usr/realtime/ I get errors that adeos, rtai_hal and other files are not found and also an error that sys/io.h is present but cannot be compiled. You can find the output below.

...so now to my questions:
What RTAI is the right one? The ntulinux one or the fcuzzocrea one?
Is there any special options I have to set when compiling the kernel, RTAI or linuxcnc?
Did I do anything completely wrong?

Best regards,
Christian.
Script started on 2017-11-30 21:40:06+0100
sh-4.4$ ./configure --with-realtime=/usr/realtime/
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking boost/lockfree/queue.hpp usability... yes
checking boost/lockfree/queue.hpp presence... yes
checking for boost/lockfree/queue.hpp... yes
checking whether g++ supports C++11 features by default... yes
checking build toplevel... /home/christian/git/linuxcnc-dev
checking installation prefix... run in place
checking for grep... (cached) /usr/bin/grep
checking for egrep... (cached) /usr/bin/grep -E
checking for pkg-config... /usr/bin/pkg-config
checking for rtai-config... /usr/realtime/bin/rtai-config
checking for xeno-config... none
checking for realtime API(s) to use... /usr/realtime/bin/rtai-config
checking for location of kernel headers... using value from RTS: /usr/src/linux
checking for cc version... found gcc in rtai-config
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for usability of linux/hidraw.h... yes
checking for libmodbus3... yes - version 3.1.4
checking for libusb-1.0... yes
checking for kernel version string... 3.16.47-RTAI
#define __GCC_ASM_FLAG_OUTPUTS__ 1
checking for kernel module extension... Usage rtai-config OPTIONS
Options:
	--help
	--version
	--cc
	--cxx
	--arch
	--subarch
	--prefix
	--config
	--module-cflags
	--module-cxxflags
	--module-ext
	--lxrt-cflags
	--lxrt-ldflags
	--linux-dir
	--linux-version
	--module-dir
	--library-dir
	--posix-wrap
checking kernel build system... normal
checking for module installation directory... configuring for run-in-place
/home/christian/git/linuxcnc-dev/rtlib
checking for glib... yes - 2.54.0
checking for GTK 2.4.0 or above... yes - 2.24.31
checking for libgnomeprintui-2.2... no -- printing from classicladder will not be possible
checking whether make sets $(MAKE)... yes
checking for ranlib... ranlib
checking for ar... /usr/bin/ar
checking for install... /usr/bin/install
checking for sed... /usr/bin/sed
checking for ps... /usr/bin/ps
checking for kill... /usr/bin/kill
checking for whoami... /usr/bin/whoami
checking for awk... /usr/bin/awk
checking for insmod... /usr/bin/insmod
checking for rmmod... /usr/bin/rmmod
checking for lsmod... /usr/bin/lsmod
checking for pidof... /usr/bin/pidof
checking for ipcs... /usr/bin/ipcs
checking for fuser... /usr/bin/fuser
checking for mandb... /usr/bin/mandb
checking for python... /usr/bin/python
checking whether to build documentation... no
checking for adeos... find: paths must precede expression: rtai-config
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
not found
checking for rtai_hal... find: paths must precede expression: rtai-config
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
not found
checking for rtai_ksched... find: paths must precede expression: rtai-config
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
not found
checking for rtai_sched... find: paths must precede expression: rtai-config
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
not found
checking for rtai_fifos... find: paths must precede expression: rtai-config
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
not found
checking for rtai_sem... find: paths must precede expression: rtai-config
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
not found
checking for rtai_math... find: paths must precede expression: rtai-config
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
not found
checking sys/io.h usability... no
checking sys/io.h presence... yes
configure: WARNING: sys/io.h: present but cannot be compiled
configure: WARNING: sys/io.h:     check for missing prerequisite headers?
configure: WARNING: sys/io.h: see the Autoconf documentation
configure: WARNING: sys/io.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/io.h: proceeding with the compiler's result
configure: WARNING:     ## --------------------------------------------------- ##
configure: WARNING:     ## Report this to emc-developers@lists.sourceforge.net ##
configure: WARNING:     ## --------------------------------------------------- ##
checking for sys/io.h... no
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... no
checking for semtimedop... no
checking for sincos function... no
checking for __sincos... no
checking for optreset... no
checking for library containing dlopen... no
configure: error: not found
sh-4.4$ exit
exit

Script done on 2017-11-30 21:40:51+0100
More
01 Dec 2017 19:55 #102572 by ozzyrob
ozzyrob replied the topic: linuxcnc on arch
I've always used the rtai patch from here: (Have it used for when building LFS & BLFS to run Linuxcnc & even slackware)
www.rtai.org/

rtai-5.0 will patch:
3.10.32
3.14.44
4.1.18
4.4.43

Finding which version will patch which kernel is a case of downloading the files and working through them.
More
02 Dec 2017 14:13 #102596 by Pumuckl
Pumuckl replied the topic: linuxcnc on arch
...so this would be the other one github.com/fcuzzocrea/RTAI
I did go for the NTULINUX one because it claims to be made for linuxcnc and also because the last commits are not as old. ...but what do I know, I am rather new to linuxcnc :D I will give it a shot next time. Maybe Alec is also active on the forum here...

When you did compile the Kernel and the RTAI modules, did you use any configuration options aside from the processor type?
More
02 Dec 2017 19:22 #102605 by ozzyrob
ozzyrob replied the topic: linuxcnc on arch
Your best bet would be to load up an official image and grab the kernel config from that and have a good look at that. It was over a year ago since I did the compilation and things are a but fuzzy. There are some bits about disabling certain pieces of power management IRC.

To be perfectly honest if your latencies are below 10us you're set, they are pretty good figures for software step generation. When you say everything is far too slow, if what way do you mean ?

I'd run the official image and get to know more about how everything works together, the time spent trying to get linuxcnc working on arch, and I'm not taking anything away from that journey, would be better spent learning how everything fits together.

I'm running a Beaglebone Black, using Machinekit (tho I really do wish there was a port of Linuxcnc to that platform), and that has been put down for it not having "great graphics" but it does the job quite well, yeah sure it may take an extra couple of seconds to get Machinekit opened, once it's running I have no issue.

It's not as if you are going to be watching youtube, chatting on Skype, and having 29 spreadsheets open whilst running gcode. Linuxcnc is just for running a cnc machine, if it does that well that's all you really need. Unless of course you want/need it for tasks other that running a cnc machine.

There is a good thread relating to installing Linuxcnc on Mint:
forum.linuxcnc.org/9-installing-linuxcnc...h-rip-install-or-deb

Whilst not particular to your journey it does have some great info regarding the dependencies needed to compile and lots of extra goodies. The wiki, tho some areas are a little outdated, is a great source of info. I'd also suggest browsing through the forum, there is a wealth of info to be had, a lot of times you'll come across some real gems, some things you haven't even thought of.

Good luck and when you do get everything going, don't be shy about asking questions, be sure to document and share your experiences.

I've found this, (in case you haven't seen it yet, maybe of some help (although just for simulator):
aur.archlinux.org/packages/linuxcnc-sim/
More
03 Dec 2017 10:36 - 03 Dec 2017 10:47 #102612 by Pumuckl
Pumuckl replied the topic: linuxcnc on arch
...and here I go again...
:angry: just pressed AltGr + m to write 'micro's and that ******* edge browser reloaded the page :angry:

...anyways, there is 2 main reasons for arch and a custom kernel:
The first one is that even though i turned most stuff that I could find off in that wheezy image the system gets busy from time to time and does things on the hdd. Also the UI is somewhat unresponsive (but ok). It becomes just a problem when I touch off a tool or the workpiece.
The other one is the CPU. It is a VIA C7. Before playing with arch I did try antix with the preempt kernel. As far as I can remember I just had to compile the kernel and could install everything else from pre-built packages. Configuring the kernel for my hardware was a huge improvement regarding the UI and the overall look and feel but latencies were in the 20us range. Also Antix would do stuff on my hdd from time to time and I could not figure out why...

I know about the linuxcnc-sim aur package, I did try it (it kind of works) and it helped when figuring out all the dependencies. But id won't help me when I try to compile linuxcnc for that RTAI kernel, which is my actual problem...

Thanks also for linking that Mint thread. I glanced over it real quick and I guess that will be my reading for tonight.
Also pulling the kernel configuration from the wheezy image is a good idea!

If I can make everything work, I will report it here.

P.s. If i can use these boards with good latency for linuxcnc I could justify why I stored them for almost 10 years :)
Last Edit: 03 Dec 2017 10:47 by Pumuckl.
More
03 Dec 2017 23:29 - 03 Dec 2017 23:42 #102636 by ozzyrob
ozzyrob replied the topic: linuxcnc on arch
You should have no probs using one of the rtai packages from www.rtai.org

Mounting filesystems with noatime can reduce disk access, might be an option if you haven't already tried it.
www.howtoforge.com/reducing-disk-io-by-m...titions-with-noatime
Last Edit: 03 Dec 2017 23:42 by ozzyrob.
Moderators: ArcEye
Time to create page: 0.114 seconds
Powered by Kunena Forum