Help using comp

More
10 Sep 2012 19:45 #24133 by dond3
Help using comp was created by dond3
I have a file named "con.comp" It has been copied to "/usr/realtime*/modules/linuxcnc/". When I try to
create a component using:

sudo comp --compile con.comp
sudo comp --install con.comp

all I get is a regular linux executable file, no extension.
Same with:

sudo comp --compile --userspace con.comp
sudo comp --install --userspace con.comp

Adding a .ko extension does not help.

When I run "halrun", "loadrt con" it isn't found.

linuxcnc.dev is installed.

What the heck am I doing wrong?

Thanks, Don

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

More
10 Sep 2012 21:47 - 10 Sep 2012 21:50 #24138 by BigJohnT
Replied by BigJohnT on topic Re:Help using comp
Place your comp file in a directory under home then run sudo comp --install from a terminal. The --install part puts the executable in the correct place. Also there is no --userspace switch you have to put that option in the comp file.

John
Last edit: 10 Sep 2012 21:50 by BigJohnT.

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

More
10 Sep 2012 22:46 #24140 by dond3
Replied by dond3 on topic Re:Help using comp
Thank you John, I'll try that.

I do appreciate your help.

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

More
10 Sep 2012 23:09 #24141 by BigJohnT
Replied by BigJohnT on topic Re:Help using comp
This is how you put an option like userspace.

linuxcnc.org/docs/html/hal/comp.html#_options
...
function _;
option userspace yes;
...

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

More
11 Sep 2012 01:24 #24143 by dond3
Replied by dond3 on topic Re:Help using comp
Hello John,

After compiling from a directory under /home/don/, the file compiles and is installed as a regular linux
executable in "/usr/bin/"

Still no joy using "halcmd: loadrt con"

reinstalled linuxcnc.dev.

My system is:

ubuntu-10.04
linuxcnc-2.5.1
realtime-2.6.32-122-rtai

All of which seems to be up-to-date.

Thanks again, Don

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

More
11 Sep 2012 06:39 #24149 by andypugh
Replied by andypugh on topic Re:Help using comp
dond3 wrote:

After compiling from a directory under /home/don/, the file compiles and is installed as a regular linux
executable in "/usr/bin/"
Still no joy using "halcmd: loadrt con"

Who is the owner of the file? I wonder if it needs a setuid root?

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

More
11 Sep 2012 06:59 #24151 by cncbasher
Replied by cncbasher on topic Re:Help using comp
are you able to post your comp file , perhaps we are missing something obvious

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

More
11 Sep 2012 08:07 - 11 Sep 2012 14:15 #24154 by ArcEye
Replied by ArcEye on topic Re:Help using comp
Hi

A userspace module is a normal linux executable to all intents, except that if you tried to run it as such it would error unless there was a running linuxcnc.

A realtime module is a kernel module and has the extension .ko

If you intend it to be a realtime module, perhaps you have omitted the function(_); declaration or similar and comp has compiled a userspace one instead.

Would beg the question of why you tried compiling it with
sudo comp --compile --userspace con.comp
sudo comp --install --userspace con.comp

however.

Why it is installing in /usr/bin is unknown if a rt mod.

You don't actually have to install it anywhere so long as the loadusr (not loadrt) command has a full path specified to it.

As cncbasher says, we need your .comp file

regards
Last edit: 11 Sep 2012 14:15 by ArcEye.

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

More
11 Sep 2012 12:47 #24160 by dond3
Replied by dond3 on topic Re:Help using comp
Hi ArcEye,

You caught me! It's your "serialcon.comp" from your pendant post. I see "userspace is declar4d in the file,
so "--userspace" is not needed when installing.

This is such a great project, I thought I would try it! Everything is working but this. I am the owner of this
file on my system.

Maybe something got trashed during the download so here is what I have:

File Attachment:

File Name: serialcon.comp
File Size:8 KB
Attachments:

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

More
11 Sep 2012 14:13 - 11 Sep 2012 14:25 #24161 by ArcEye
Replied by ArcEye on topic Re:Help using comp
Hi

I ran a diff on your file and mine and aside from the header text missing, there are spurious characters in yours that come from the forum, that have cut and pasted into the file.
It gets excited by anything that looks like an escape sequences or HTML tags and sometimes substitutes rubbish, I should have attached a download, I will do that shortly.

The attached zip contains serialcon.comp and a compiled binary of it built under 10.04, so should run on your machine.
The binary permissions are set to 100755 so it should be able to be executed by anyone

Now that we know what you are compiling, there is nothing wrong with it going into /usr/bin, thats where mine lives on the $PATH where it can just be loaded by name.

It is loaded with loadusr -W serialcon somewhere at the top of your hal file and then net the pins at the end to make doubly sure that the pins have been created by then.

regards

File Attachment:

File Name: serialcon.zip
File Size:8 KB
Attachments:
Last edit: 11 Sep 2012 14:25 by ArcEye.

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

Time to create page: 0.106 seconds
Powered by Kunena Forum