- Posts: 337
- Thank you received: 0
Need help trying to build and install custom components
3 years 5 months ago #270454
by JPL
Need help trying to build and install custom components was created by JPL
Well, I have linuxcnc-uspace-dev installed (2.8.4)
I can also see that halcompile is 'trying' to do something
BUT
I just can't find on my computer the linuxcnc/src/hal/components folder where I should place my .comp file
(feeling dumb)
Ref; Doc "The Hal components Generator" section 12 : "Place the .comp file in the source directory linuxcnc/src/hal/components ..."
What am I missing???
I can also see that halcompile is 'trying' to do something
BUT
I just can't find on my computer the linuxcnc/src/hal/components folder where I should place my .comp file
(feeling dumb)
Ref; Doc "The Hal components Generator" section 12 : "Place the .comp file in the source directory linuxcnc/src/hal/components ..."
What am I missing???
Please Log in to join the conversation.
3 years 5 months ago #270455
by Aciera
Replied by Aciera on topic Need help trying to build and install custom components
you need to point 'halcompile' to the component file:
halcompile --install <your_path>/<your_comp>.comp
halcompile --install <your_path>/<your_comp>.comp
Please Log in to join the conversation.
3 years 5 months ago #270456
by JPL
Replied by JPL on topic Need help trying to build and install custom components
halcompile itself appear to work but I always get some error.
With this test component
I get
With this test component
Code:
component test "This is a test component";
pin in bit testinbit;
pin in s32 testins32;
pin out bit testoutbit;
pin out s32 testouts32;
param rw s32 testrwparam = 0;
// internal variables
variable bool testbool = false;
variable float testfloat = 0;
variable int progress_level = 0;
function _;
author "ArcEye ";
license "GPL";
;;
FUNCTION(_)
{
switch (progress_level)
{
case 0:
break;
default:
rtapi_print_msg(RTAPI_MSG_ERR, "Unknown state");
break;
}
}
I get
Code:
jpl@jpl:~/linuxcnc$ halcompile --install test.comp
Compiling realtime test.c
Linking test.so
cp test.so /usr/lib/linuxcnc/modules/
cp: cannot create regular file '/usr/lib/linuxcnc/modules/test.so': Permission denied
make: *** [/usr/share/linuxcnc/Makefile.modinc:105: install] Error 1
Please Log in to join the conversation.
3 years 5 months ago #270457
by JPL
Replied by JPL on topic Need help trying to build and install custom components
Now, with something with some #includes like this
I get
Code:
...
#include "motion.h"
#include "homing.h"
...
I get
Code:
jpl@jpl:~/linuxcnc$ halcompile --install u3000homecomp.comp
Compiling realtime u3000homecomp.c
u3000homecomp.comp:60:10: fatal error: homing.h: No such file or directory
compilation terminated.
make: *** [/usr/share/linuxcnc/Makefile.modinc:115: u3000homecomp.o] Error 1
Please Log in to join the conversation.
3 years 5 months ago #270458
by JPL
Replied by JPL on topic Need help trying to build and install custom components
Ok, For the 'test.comp' this is working with sudo halcompile.
Does that make sense?
Code:
jpl@jpl:~/linuxcnc/src/hal/components$ sudo halcompile --install test.comp
[sudo] password for jpl:
Compiling realtime test.c
Linking test.so
cp test.so /usr/lib/linuxcnc/modules/
Does that make sense?
Please Log in to join the conversation.
3 years 5 months ago #270459
by JPL
Replied by JPL on topic Need help trying to build and install custom components
But for the u3000homecomp.comp I still have an error related to the include files
Code:
jpl@jpl:~/linuxcnc/src/hal/components$ sudo halcompile --install u3000homecomp.comp
Compiling realtime u3000homecomp.c
u3000homecomp.comp:60:10: fatal error: homing.h: No such file or directory
compilation terminated.
make: *** [/usr/share/linuxcnc/Makefile.modinc:115: u3000homecomp.o] Error 1
Please Log in to join the conversation.
3 years 5 months ago #270461
by Aciera
Replied by Aciera on topic Need help trying to build and install custom components
Not sure, I only work with rip installations. We need somebody who is more familiar with your situation.
Please Log in to join the conversation.
3 years 5 months ago #270462
by JPL
Replied by JPL on topic Need help trying to build and install custom components
Do you think I need a RIP install to build components?
I just can't find anywhere where it is saying that but looking at my folders it seems that I'm in fact missing a few things... For example I have motion.h in my /usr/include/linuxcnc/ folder but homing.h is definitively not there.
I just can't find anywhere where it is saying that but looking at my folders it seems that I'm in fact missing a few things... For example I have motion.h in my /usr/include/linuxcnc/ folder but homing.h is definitively not there.
Please Log in to join the conversation.
3 years 5 months ago #270465
by rodw
Replied by rodw on topic Need help trying to build and install custom components
If you have a deb install, you need to use sudo so it can copy the executable into the system folders a user does not have write access to.
you just need to install the linuxcnc-uspace-dev package which it sounds like you have done.
But a deb install does not install the source. You would need to run a RIP build if you are compiling internal stuff like a homecomp to access the source. You can do this even if you have a deb install.
you just need to install the linuxcnc-uspace-dev package which it sounds like you have done.
But a deb install does not install the source. You would need to run a RIP build if you are compiling internal stuff like a homecomp to access the source. You can do this even if you have a deb install.
Please Log in to join the conversation.
3 years 5 months ago #270466
by JPL
Can you provide some pointers about how to do this with a deb install?
Replied by JPL on topic Need help trying to build and install custom components
Yes, that appear to be the case about sudo , also linuxcnc-uspace-dev is installed and halcompile appear to work too.If you have a deb install, you need to use sudo so it can copy the executable into the system folders a user does not have write access to. you just need to install the linuxcnc-uspace-dev package which it sounds like you have done.
Which certainly explain the problem I have about the includes filesBut a deb install does not install the source.
You would need to run a RIP build if you are compiling internal stuff like a homecomp to access the source. You can do this even if you have a deb install.
Can you provide some pointers about how to do this with a deb install?
Please Log in to join the conversation.
Time to create page: 2.839 seconds
