Editing userspace components
28 Sep 2020 03:13 #184093
by Uthayne
Editing userspace components was created by Uthayne
I'm trying to edit the xhc-whb04b-6 userspace component that is shipped with 2.9.
Should it be as simple as making the edits to the .cc files, going back to /src/ folder and running make again to compile the changes?
I'm able to pull down a new linuxcnc-dev folder and make changes to the user_comp before I run ./autogen.sh , ./configure --with-realtime=uspace , make , and sudo make setuid for the first time. However, anytime after this was initially ran it will not recognize changes and recompile.
I've tried to make clean and make again, but it doesn't seem to help.
Is there something I'm missing?
Should it be as simple as making the edits to the .cc files, going back to /src/ folder and running make again to compile the changes?
I'm able to pull down a new linuxcnc-dev folder and make changes to the user_comp before I run ./autogen.sh , ./configure --with-realtime=uspace , make , and sudo make setuid for the first time. However, anytime after this was initially ran it will not recognize changes and recompile.
I've tried to make clean and make again, but it doesn't seem to help.
Is there something I'm missing?
Please Log in or Create an account to join the conversation.
28 Sep 2020 04:57 #184104
by rodw
Replied by rodw on topic Editing userspace components
What happens if you just:
make , and sudo make setuid?
I never go back to do the ./configure step and it always seems to build OK
make , and sudo make setuid?
I never go back to do the ./configure step and it always seems to build OK
Please Log in or Create an account to join the conversation.
- BeagleBrainz
- Offline
- User is blocked
Less
More
- Posts: 1437
- Thank you received: 570
28 Sep 2020 05:31 #184105
by BeagleBrainz
Replied by BeagleBrainz on topic Editing userspace components
So after making changes and second time, what messages are you getting after running make clean then make ?
I tried a couple of things
just touch * in the xhc-whb04b-6
running make again remade everything in that dir & sudo make setuid the xhc-whb04b-6 lib was rebuilt and installed with a new time stamp
then I just edited one file in that directory, & running make & sudo make setuid installed a new xhc-whb04b-6 with a new time stamp.
I tried a couple of things
just touch * in the xhc-whb04b-6
running make again remade everything in that dir & sudo make setuid the xhc-whb04b-6 lib was rebuilt and installed with a new time stamp
then I just edited one file in that directory, & running make & sudo make setuid installed a new xhc-whb04b-6 with a new time stamp.
Please Log in or Create an account to join the conversation.
28 Sep 2020 13:15 #184167
by Uthayne
Replied by Uthayne on topic Editing userspace components
So I wrote out all of the below before figuring it out myself. Keeping it all here for others.
Edit: Turns out that since I was using Chrome remote desktop, it would open up a secondary desktop instead of the main session. This caused some of the source files (hal.cc for one) to remained opened in the editor in a different session. The compiler was still pulling at these versions. It was extra problematic when I was trying to work back and forth on both linuxcnc and machinekit versions, as they are slightly different. I was alerted to this when I opened up hal.cc and the editor said it was already opened (in a different desktop session). I overwrote the changes and it compiled successfully. This was definitely a head scratcher because nothing made sense with the different references to different codebases when I knew I was no longer compiling against them.
Original:
Ok, so I believe that make is behaving more like I imagined it would this morning, yet I am still having dependency issues.
Here is the output after editing a file (pendant.cc) and running make in /src/:
It recognized changes in pendant.cc and is attempting to recompile. It complains about undefined references though. There are two versions of the xhc-whb04b-6 driver that I have been messing around with, the one that has been precompiled with 2.8/2.9 linuxcnc and one that is delivered with machinekit. The one currently built in to linuxcnc is forked from the machinekit driver.
I can prove that the "undefined references" it is complaining about are indeed within the hal.cc file that should also be compiled alongside.
Snippet of the hal.cc file showing that these references do in fact, exist.
And to make sure everything has been checked, the Makefile in /src/ definitely points to the correct folder:
Edit: Turns out that since I was using Chrome remote desktop, it would open up a secondary desktop instead of the main session. This caused some of the source files (hal.cc for one) to remained opened in the editor in a different session. The compiler was still pulling at these versions. It was extra problematic when I was trying to work back and forth on both linuxcnc and machinekit versions, as they are slightly different. I was alerted to this when I opened up hal.cc and the editor said it was already opened (in a different desktop session). I overwrote the changes and it compiled successfully. This was definitely a head scratcher because nothing made sense with the different references to different codebases when I knew I was no longer compiling against them.
Original:
Ok, so I believe that make is behaving more like I imagined it would this morning, yet I am still having dependency issues.
Here is the output after editing a file (pendant.cc) and running make in /src/:
Warning: Spoiler!
bryan@bryan-linux ~/linuxcnc-dev2/src $ make
Reading 200/200 dependency files
Done reading dependencies
Reading 215/215 realtime dependency files
Done reading realtime dependencies
Compiling hal/user_comps/xhc-whb04b-6/pendant.cc
Linking xhc-whb04b-6
objects/hal/user_comps/xhc-whb04b-6/pendant.o: In function `XhcWhb04b6::Pendant::onJogDialEvent(XhcWhb04b6::HandWheelCounters const&, signed char)':
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1462: undefined reference to `XhcWhb04b6::Hal::toggleSpindleOverrideIncrease()'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1473: undefined reference to `XhcWhb04b6::Hal::toggleFeedrateIncrease()'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1466: undefined reference to `XhcWhb04b6::Hal::toggleSpindleOverrideDecrease()'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1477: undefined reference to `XhcWhb04b6::Hal::toggleFeedrateDecrease()'
objects/hal/user_comps/xhc-whb04b-6/pendant.o: In function `XhcWhb04b6::Pendant::onButtonReleasedEvent(XhcWhb04b6::MetaButtonCodes const&)':
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1318: undefined reference to `XhcWhb04b6::Hal::toggleMistOnOff(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1195: undefined reference to `XhcWhb04b6::Hal::setSpindleOverrideMinus(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1190: undefined reference to `XhcWhb04b6::Hal::setSpindleOverridePlus(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1205: undefined reference to `XhcWhb04b6::Hal::setMachineHomingAll(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1235: undefined reference to `XhcWhb04b6::Hal::setConMode(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1265: undefined reference to `XhcWhb04b6::Hal::toggleLubeOnOff(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1312: undefined reference to `XhcWhb04b6::Hal::toggleFloodOnOff(bool)'
objects/hal/user_comps/xhc-whb04b-6/pendant.o: In function `XhcWhb04b6::Pendant::dispatchActiveFeedToHal(XhcWhb04b6::KeyCode const&, bool)':
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1392: undefined reference to `XhcWhb04b6::Hal::setFeedValueSelectedLead(bool)'
objects/hal/user_comps/xhc-whb04b-6/pendant.o: In function `XhcWhb04b6::Pendant::dispatchFeedValueToHal()':
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1422: undefined reference to `XhcWhb04b6::Hal::setMpgMode(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1423: undefined reference to `XhcWhb04b6::Hal::setConMode(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1425: undefined reference to `XhcWhb04b6::Hal::getFeedOverrideMaxVel() const'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1407: undefined reference to `XhcWhb04b6::Hal::setMpgMode(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1408: undefined reference to `XhcWhb04b6::Hal::setConMode(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1415: undefined reference to `XhcWhb04b6::Hal::setMpgMode(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1416: undefined reference to `XhcWhb04b6::Hal::setConMode(bool)'
objects/hal/user_comps/xhc-whb04b-6/pendant.o: In function `XhcWhb04b6::Pendant::onButtonPressedEvent(XhcWhb04b6::MetaButtonCodes const&)':
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1150: undefined reference to `XhcWhb04b6::Hal::toggleMistOnOff(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1023: undefined reference to `XhcWhb04b6::Hal::setSpindleOverrideMinus(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1018: undefined reference to `XhcWhb04b6::Hal::setSpindleOverridePlus(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1033: undefined reference to `XhcWhb04b6::Hal::setMachineHomingAll(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1064: undefined reference to `XhcWhb04b6::Hal::setConMode(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1097: undefined reference to `XhcWhb04b6::Hal::toggleLubeOnOff(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1144: undefined reference to `XhcWhb04b6::Hal::toggleFloodOnOff(bool)'
objects/hal/user_comps/xhc-whb04b-6/pendant.o: In function `XhcWhb04b6::Display::updateData()':
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1681: undefined reference to `XhcWhb04b6::Hal::getspindleSpeedChangeIncrease() const'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1682: undefined reference to `XhcWhb04b6::Hal::getspindleSpeedChangeDecrease() const'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1683: undefined reference to `XhcWhb04b6::Hal::getSpindleOverrideValue() const'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1684: undefined reference to `XhcWhb04b6::Hal::getspindleSpeedCmd() const'
objects/hal/user_comps/xhc-whb04b-6/pendant.o: In function `XhcWhb04b6::Pendant::dispatchActiveFeedToHal(XhcWhb04b6::KeyCode const&, bool)':
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1368: undefined reference to `XhcWhb04b6::Hal::setFeedValueSelected2(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1372: undefined reference to `XhcWhb04b6::Hal::setFeedValueSelected5(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1376: undefined reference to `XhcWhb04b6::Hal::setFeedValueSelected10(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1380: undefined reference to `XhcWhb04b6::Hal::setFeedValueSelected30(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1384: undefined reference to `XhcWhb04b6::Hal::setFeedValueSelected60(bool)'
/home/bryan/linuxcnc-dev2/src/hal/user_comps/xhc-whb04b-6/pendant.cc:1388: undefined reference to `XhcWhb04b6::Hal::setFeedValueSelected100(bool)'
collect2: error: ld returned 1 exit status
hal/user_comps/xhc-whb04b-6/Submakefile:21: recipe for target '../bin/xhc-whb04b-6' failed
make: *** [../bin/xhc-whb04b-6] Error 1
It recognized changes in pendant.cc and is attempting to recompile. It complains about undefined references though. There are two versions of the xhc-whb04b-6 driver that I have been messing around with, the one that has been precompiled with 2.8/2.9 linuxcnc and one that is delivered with machinekit. The one currently built in to linuxcnc is forked from the machinekit driver.
I can prove that the "undefined references" it is complaining about are indeed within the hal.cc file that should also be compiled alongside.
Snippet of the hal.cc file showing that these references do in fact, exist.
Warning: Spoiler!
void Hal::toggleSpindleOverrideIncrease()
{
if (*memory->out.spindleOverrideDoIncrease)
{
*memory->out.spindleOverrideDoIncrease = false;
}
else
{
*memory->out.spindleOverrideScale = 0.01;
*memory->out.spindleOverrideDoIncrease = true;
}
}
// ----------------------------------------------------------------------
void Hal::toggleSpindleOverrideDecrease()
{
if (*memory->out.spindleOverrideDoDecrease)
{
*memory->out.spindleOverrideDoDecrease = false;
}
else
{
*memory->out.spindleOverrideScale = 0.01;
*memory->out.spindleOverrideDoDecrease = true;
}
}
// ----------------------------------------------------------------------
void Hal::toggleFeedrateIncrease()
{
if (*memory->out.feedOverrideIncrease)
{
*memory->out.feedOverrideIncrease = false;
}
else
{
*memory->out.feedOverrideScale = 0.01;
*memory->out.feedOverrideIncrease = true;
}
}
// ----------------------------------------------------------------------
void Hal::toggleFeedrateDecrease()
{
if (*memory->out.feedOverrideDecrease)
{
*memory->out.feedOverrideDecrease = false;
}
else
{
*memory->out.feedOverrideScale = 0.01;
*memory->out.feedOverrideDecrease = true;
}
}
}
And to make sure everything has been checked, the Makefile in /src/ definitely points to the correct folder:
Warning: Spoiler!
# Submakefiles from each of these directories will be included if they exist
SUBDIRS := \
libnml/linklist libnml/cms libnml/rcs libnml/inifile libnml/os_intf \
libnml/nml libnml/buffer libnml/posemath libnml \
\
rtapi/examples/timer rtapi/examples/semaphore rtapi/examples/shmem \
rtapi/examples/extint rtapi/examples/fifo rtapi/examples rtapi \
\
hal/components hal/drivers hal/drivers/mesa-hostmot2 \
hal/user_comps/devices hal/user_comps/mb2hal \
hal/user_comps hal/user_comps/vismach hal/user_comps/vfs11_vfd hal/classicladder hal/utils hal \
hal/user_comps/vfdb_vfd hal/user_comps/wj200_vfd \
hal/user_comps/huanyang-vfd \
hal/user_comps/xhc-whb04b-6 \
\
emc/usr_intf/axis emc/usr_intf/touchy emc/usr_intf/stepconf emc/usr_intf/pncconf \
emc/usr_intf/gremlin emc/usr_intf/gscreen emc/usr_intf/pyui emc/usr_intf/qtvcp \
emc/usr_intf/gmoccapy \
emc/usr_intf emc/nml_intf emc/task emc/iotask emc/kinematics emc/tp emc/canterp \
emc/motion emc/ini emc/rs274ngc emc/sai emc emc/pythonplugin \
emc/motion-logger \
\
module_helper \
\
po \
\
../docs/src ../docs/src/source-highlight \
\
../tests \
The following user(s) said Thank You: BeagleBrainz
Please Log in or Create an account to join the conversation.
- BeagleBrainz
- Offline
- User is blocked
Less
More
- Posts: 1437
- Thank you received: 570
28 Sep 2020 19:17 #184202
by BeagleBrainz
Replied by BeagleBrainz on topic Editing userspace components
Lol
I’ve done something similar myself when editing a config for my mill.
Glad you worked it all out. I suspect we’ve all had moments like that.
I’ve done something similar myself when editing a config for my mill.
Glad you worked it all out. I suspect we’ve all had moments like that.
Please Log in or Create an account to join the conversation.
Time to create page: 0.103 seconds