NEWS
LinuxCNC 2.5.2 Release
There are no translations available.

LinuxCNC 2.5.2 Update Released (changelog).
 
LinuxCNC 2.5.1 Release
There are no translations available.

LinuxCNC 2.5.1 Update Released (changelog). If the Package Manager does not prompt you to upgrade see this page.

 
LinuxCNC 2.5.0 Release
There are no translations available.

New major release (changelog). See the instructions to update your system from EMC 2.4 to LinuxCNC 2.5.
 
Home Forum HAL HAL Components Questions about using comp

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Questions about using comp

Questions about using comp 12 Jul 2012 15:23 #21852

  • billooms
  • billooms's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 53
  • Karma: 1
I have several questions regarding the proper use of comp for compiling my own components. My component is called keypad.comp and the linesadded to my postgui.hal file are:
loadrt keypad count=1
addf keypad servo-thread

I have the source for linuxcnc downloaded and compiled in /usr/src/build/src. If I add my own component to hal/compoents, I can do a make and it compiles without errors. However, it isn't found when I launch linuxcnc:
keypad: dlopen: /usr/lib/linuxcnc/modules/keypad.so cannot open shared object file: No such file or directory

If I manually copy /usr/src/build/rtlib/keypad.so to /usr/lib/linuxcnc/modules it still is not loaded:
HAL: ERROR: function keypad not found

Also, if I try to keep the keypad.comp in my home directory (instead of copying it to the /usr/src/build/src/hal/components directory), the comp command is not found when I try to use it from the terminal. It exists in the /usr/src/build/bin/ directory and works if I type the full path name. Then in my own directory I do the following (based on HAL Manual V2.5 section 14.13):
/usr/src/build/bin/comp keypad.comp
/usr/src/build/bin/comp --compile keypad.comp
/usr/src/build/bin/comp --install keypad.comp
/usr/src/build/bin/comp --document keypad.comp

No errors, and the keypad.so is copied to /usr/src/build/rtlib but again the component does not load.

There's something obvious that I'm missing in all of this -- any help on what I'm missing?
The administrator has disabled public write access.

Re:Questions about using comp 12 Jul 2012 15:30 #21854

  • andypugh
  • andypugh's Avatar
  • OFFLINE
  • Moderator
  • Posts: 4140
  • Thank you received: 141
  • Karma: 130
billooms wrote:
There's something obvious that I'm missing in all of this -- any help on what I'm missing?
My first guess would be the not-obvious requirement to run the correct environment script.
The run-in-place one will be in linuxcnc-dev/scripts/rip-environment
You can probably also use . ./ linuxcnc-dev/scripts/linuxcnc to setup the environment and start linuxcnc.
The administrator has disabled public write access.

Re:Questions about using comp 12 Jul 2012 15:54 #21855

  • billooms
  • billooms's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 53
  • Karma: 1
Thanks for the quick reply.

I did the rip-environment and now comp is recognized as it should be.

The command "comp --install keypad.comp" builds the .so file in /usr/src/build/rtlib/ but when I launch linuxcnc it still gives the message:
keypad: dlopen: /usr/lib/linuxcnc/modules/keypad.so cannot open shared object file: No such file or directory

Apparently, linuxcnc is looking in /usr/lib/linuxcnc/modules and not looking in /usr/src/build/rtlib.

One more thing (maybe important, maybe not) -- I'm running simulation mode linuxcnc here in my office.
The administrator has disabled public write access.

Re:Questions about using comp 12 Jul 2012 16:02 #21857

  • andypugh
  • andypugh's Avatar
  • OFFLINE
  • Moderator
  • Posts: 4140
  • Thank you received: 141
  • Karma: 130
billooms wrote:
Apparently, linuxcnc is looking in /usr/lib/linuxcnc/modules and not looking in /usr/src/build/rtlib.

Are you starting linuxcnc from the command line, or the GUI?

The GUI will (by default) use the installed version. After a rip-environment the command-line will use the rip-version.

I am surprised that comp doesn't work in the installed environment though. Did you "sudo" the comp --install?

There's little to be lost from copying the .so (actually, I would expect a .ko) from the linuxcnc-dev/src directory to /usr/src/build/rtlib
The administrator has disabled public write access.

Re:Questions about using comp 13 Jul 2012 02:07 #21864

  • ArcEye
  • ArcEye's Avatar
  • OFFLINE
  • Moderator
  • Posts: 1338
  • Thank you received: 103
  • Karma: 129
Hi

As Andy said, suspect you are executing linuxcnc outside the shell environment in which you ran . ./scripts/rip-environment

That first period (.) is crucial and means it persists only within the current shell session.

Even if you launched linuxcnc from the command line in another terminal, it would still default to the installed version.

regards
The administrator has disabled public write access.

Re:Questions about using comp 13 Jul 2012 11:40 #21913

  • billooms
  • billooms's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 53
  • Karma: 1
Andy -- No, I didn't sudo the comp --install. Without the sudo, it did successfully copy the .so to /usr/src/build/rtlib. When I do sudo it, I get the following:
sudo: comp: command not found

In a terminal window I change to directory /usr/src/build and execute the . ./scripts/rip-environment command (with the period). Then from that same terminal window I launch linuxcnc and it finds my component just fine! So I'm back in business for now!

Thank you for your help!
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 0.899 seconds
Powered by Kunena Forum
© 2013 LinuxCNC.org
Joomla! is Free Software released under the GNU General Public License.