compiling kinematics modules

More
16 Apr 2012 14:33 - 16 Apr 2012 14:37 #19239 by mjmb
Since I am learning to work with Linuxcnc and especially with kinematics, I did some little tests with the comp command. I installed Linuxcnc 2.5.0 from the CD and loaded the trivkins module from the git.linuxcnc.org repository. After installing the linuxcnc-dev package, I renamed the existing trivkins.ko to trivkins0.ko and launched the command comp --install trivkins.c.
After that, a new trivkins.ko appeared in /usr/realtime.../modules/linuxcnc, which is working normally. I was surprised though to see that the new version has a filelength of 90175 bytes, while the original one has only 3199 bytes! Is there some reason for this big difference?
Last edit: 16 Apr 2012 14:37 by mjmb.

Please Log in or Create an account to join the conversation.

More
16 Apr 2012 16:25 - 16 Apr 2012 16:27 #19247 by ArcEye
Hi

trivkins.c is a pure C program, not one generated by comp, so not suitable for compiling with comp.

Easiest way to compile it is to compile the 2.5 source, with your trivkins.c substituted for the stock one.

Alternatively dissect the Makefile to get the switches, includes, linkages required.

On my 2.5~pre-xxx, trivkins.ko comes out at 3203 bytes, so god knows what comp included in with it, a complete static library perhaps !

regards
Last edit: 16 Apr 2012 16:27 by ArcEye.

Please Log in or Create an account to join the conversation.

More
16 Apr 2012 16:41 #19249 by andypugh
ArcEye wrote:

trivkins.c is a pure C program, not one generated by comp, so not suitable for compiling with comp.


You can use comp as a simple way to compile and link C-code as well as .comp macro code.

comp is an appropriate way to compile pure-C kinematics modules.

Please Log in or Create an account to join the conversation.

More
17 Apr 2012 08:36 #19300 by ArcEye
OK if you don't mind the bloat.

Ran strip on the 90K module output by comp and got it down to 1.8K but produced
insmod error: invalid module format -1 so obviously not all debugging symbols that comp is adding.

I'll stick with my method of re-compiling within the source tree. :blink:

Please Log in or Create an account to join the conversation.

More
18 Apr 2012 16:40 #19355 by mjmb
I did some more testing and found out that the module length , once loaded with loadrt or by launching linuxcnc, is 1274 bytes for the recompiled version as well as for the original version
So I suppose that the 2 versions are identical

Thanks for your help.

Please Log in or Create an account to join the conversation.

Time to create page: 0.272 seconds
Powered by Kunena Forum