Discussion:
Linuxcnc Crosscompile for ARM
Hofer Andreas
2013-08-19 09:50:07 UTC
Permalink
Hi,

is it possible to to compile linuxcnc on a x86 host platform for an ARM
Target platform?
I have installed the codesourcery toolchain.
Crosscompiling some Hello World application for ARM ist no problem, but
when i do this on linuxcnc there come some errors.

1.) sh autogen.sh
2.) ./ configure --with-threads=rt-preempt-user
--> Error:
"checking for RT dir... configure: error: RT not found. Specify:
--with-realtime=<path>
or use
--enable-simulator
to build without a realtime system."

I think here the script is searching the actual kernel, but on my host
machine i have no rt-kernel installed.

When i give the path from kernel source like,
$ ./configure --with-realtime=
/media/Datas/ARM-Kernel/panda-linux-3.8.13-rt/

Also a error occurs like:
"checking for RT dir... configure: error: You must supply a path for
--with-realtime.
"

If there any way to give the configure script the target rt-kernel source?

I think when i have the right configuration, i can compile with:
sudo make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi

thx
andi
Michael Haberler
2013-08-19 11:50:45 UTC
Permalink
Hallo Andreas
Post by Hofer Andreas
Hi,
is it possible to to compile linuxcnc on a x86 host platform for an ARM
Target platform?
I have installed the codesourcery toolchain.
Crosscompiling some Hello World application for ARM ist no problem, but
when i do this on linuxcnc there come some errors.
I dont know which branch you started from; please use https://github.com/mhaberler/linuxcnc/tree/unified-build-candidate-2

then proceed like so

sh autogen.sh
./configure --with-rt-preempt --with-platform=beaglebone

You do not need a reference to kernel source with any of the userland threads builds (xenomai, rt-preempt, posix).
Post by Hofer Andreas
1.) sh autogen.sh
2.) ./ configure --with-threads=rt-preempt-user
--with-realtime=<path>
or use
--enable-simulator
to build without a realtime system."
I think here the script is searching the actual kernel, but on my host
machine i have no rt-kernel installed.
some time ago it did. Not any more.
Post by Hofer Andreas
When i give the path from kernel source like,
$ ./configure --with-realtime=
/media/Datas/ARM-Kernel/panda-linux-3.8.13-rt/
"checking for RT dir... configure: error: You must supply a path for
--with-realtime.
"
If there any way to give the configure script the target rt-kernel source?
sudo make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi
That's a good question - I would be interested in cross-building too since building on-target is pretty lame

The compiler aint enough, you need a filesystem with the target prerequisite packages installed; no idea how to do that


- Michael
Post by Hofer Andreas
thx
andi
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Emc-developers mailing list
https://lists.sourceforge.net/lists/listinfo/emc-developers
Charles Steinkuehler
2013-08-19 11:53:42 UTC
Permalink
Post by Hofer Andreas
Hi,
is it possible to to compile linuxcnc on a x86 host platform for an ARM
Target platform?
Yes, it is possible to compile LinuxCNC for the ARM on an x86 platform.

I do this when building the MachineKit images from scratch, which
happens on an x86 system. You can find the build scripts (based on
Robert C. Nelson's excellent work) on github:

https://github.com/cdsteinkuehler/omap-image-builder

Basically, an ARM root filesystem is built on the x86 system, and you
chroot into that in order to compile. The fact that all the executable
files in the chroot are for the ARM instead of the x86 is handled by
transparent qemu system emulation. The "magic bit" is copying the qemu
static emulation into /usr/bin on the chroot image:

https://github.com/cdsteinkuehler/omap-image-builder/blob/master/scripts/chroot.sh#L136

...once you do this, you can chroot into the ARM root filesystem on your
x86 machine and uname -a will tell you you're running an ARM CPU!
Post by Hofer Andreas
I have installed the codesourcery toolchain.
Crosscompiling some Hello World application for ARM ist no problem, but
when i do this on linuxcnc there come some errors.
Cross-compiling is another thing entirely. You will probably have to
seriously work on the LinuxCNC build scripts if you want to be able to
actually cross-compile (ie: build with native x86 tools, but generate
ARM executable code).
--
Charles Steinkuehler
charles-***@public.gmane.org
Hofer Andreas
2013-08-19 15:25:36 UTC
Permalink
Hi,

thanks for your answers,
I will try to compile in the arm system emulation..

thx
andi
Post by Charles Steinkuehler
Post by Hofer Andreas
Hi,
is it possible to to compile linuxcnc on a x86 host platform for an ARM
Target platform?
Yes, it is possible to compile LinuxCNC for the ARM on an x86 platform.
I do this when building the MachineKit images from scratch, which
happens on an x86 system. You can find the build scripts (based on
https://github.com/cdsteinkuehler/omap-image-builder
Basically, an ARM root filesystem is built on the x86 system, and you
chroot into that in order to compile. The fact that all the executable
files in the chroot are for the ARM instead of the x86 is handled by
transparent qemu system emulation. The "magic bit" is copying the qemu
https://github.com/cdsteinkuehler/omap-image-builder/blob/master/scripts/chroot.sh#L136
...once you do this, you can chroot into the ARM root filesystem on your
x86 machine and uname -a will tell you you're running an ARM CPU!
Post by Hofer Andreas
I have installed the codesourcery toolchain.
Crosscompiling some Hello World application for ARM ist no problem, but
when i do this on linuxcnc there come some errors.
Cross-compiling is another thing entirely. You will probably have to
seriously work on the LinuxCNC build scripts if you want to be able to
actually cross-compile (ie: build with native x86 tools, but generate
ARM executable code).
Loading...