Need help trying to build and install custom components
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 or Create an account to join the conversation.
halcompile --install <your_path>/<your_comp>.comp
Please Log in or Create an account to join the conversation.
With this test component
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
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 or Create an account to join the conversation.
...
#include "motion.h"
#include "homing.h"
...
I get
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 or Create an account to join the conversation.
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 or Create an account to join the conversation.
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 or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
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 or Create an account to join the conversation.
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 or Create an account to join the conversation.
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 or Create an account to join the conversation.