Python Launcher Module Not Respecting RIP Settings

63 views
Skip to first unread message

Ryan Helminen

unread,
May 29, 2019, 12:20:26 AM5/29/19
to Machinekit
Hello,

I am wondering how to get the mkwrapper approach to using QtQuickVCP to respect RIP environment variables so that the correct environment is loaded. From what I can tell the run.py script that I am using detects the RIP environment variables, but for some reason that isn't getting communicated during the call to the linuxcnc executable.

I have a custom build that includes a bipodkins RT module and when I try to start things up using the attached python script I get the following error message:

bipodsim.hal:5: insmod failed, returned -1:
do_load_cmd: dlopen: bipodkins.so: cannot open shared object file: No such file or directory
rpath=/usr/lib/linuxcnc/rt-preempt

The rpath that is referenced is not the path to the RIP files. I have tested that RIP is correctly setup by manually running halrun and doing a loadrt bipodkins which works as expected.

Does anyone have any tips on how I can force mkwrapper to correctly use the RIP environment that I have configured?

Thanks much,
Ryan
run.py

Bas de Bruijn

unread,
May 29, 2019, 1:47:00 AM5/29/19
to Ryan Helminen, Machinekit
Hi Ryan,

You need to source the rip-environment script in all terminals you use.
I put that into my .bashrc file so I don’t have to think about that.

If that does not help,
Please do an “export DEBUG=5” in the terminal you’re running things in.
Then look at /var/log/linuxcnc.log

It’s best to put the output of that into a gist or pastebin and link to that. As well as a link to your code.

Bas
--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
To view this discussion on the web visit https://groups.google.com/d/msgid/machinekit/6844b1f8-9718-4d8d-b022-1b7ef1d5dc49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<run.py>

schoo...@gmail.com

unread,
May 29, 2019, 7:16:08 AM5/29/19
to machi...@googlegroups.com
Can you attach your copy of the linuxcnc script.

That is where a lot of paths are set, the rpath looks like the path for an install, not a RIP.

Ryan Helminen

unread,
Jun 1, 2019, 12:18:49 AM6/1/19
to Machinekit
Hello Gentlemen,

Thank you for the guidance. In the end it looks like the problem was that the linuxcnc bash script was not setup to respect any RIP settings and had the paths hardcoded to the root /usr directory.

I had to update the first part of the script to check for the EMC2_HOME environment variable, and if it existed set the paths accordingly. My updated linuxcnc executable is at the following gist:


Best Regards,
Ryan

On Wednesday, May 29, 2019 at 6:16:08 AM UTC-5, Schooner wrote:
Can you attach your copy of the linuxcnc script.

That is where a lot of paths are set, the rpath looks like the path for an install, not a RIP.

On 29/05/19 05:20, Ryan Helminen wrote:
Hello,

I am wondering how to get the mkwrapper approach to using QtQuickVCP to respect RIP environment variables so that the correct environment is loaded. From what I can tell the run.py script that I am using detects the RIP environment variables, but for some reason that isn't getting communicated during the call to the linuxcnc executable.

I have a custom build that includes a bipodkins RT module and when I try to start things up using the attached python script I get the following error message:

bipodsim.hal:5: insmod failed, returned -1:
do_load_cmd: dlopen: bipodkins.so: cannot open shared object file: No such file or directory
rpath=/usr/lib/linuxcnc/rt-preempt

The rpath that is referenced is not the path to the RIP files. I have tested that RIP is correctly setup by manually running halrun and doing a loadrt bipodkins which works as expected.

Does anyone have any tips on how I can force mkwrapper to correctly use the RIP environment that I have configured?

Thanks much,
Ryan
--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to machi...@googlegroups.com.

Ryan Helminen

unread,
Jul 10, 2019, 12:08:35 AM7/10/19
to Machinekit
I think I finally figured out where the source of my initial problems were. ArcEye has been working on splitting up the machinekit repo into machinekit-cnc and machinekit-hal. The linuxcnc bash script that I was supposed to be calling into does exist under the scripts folder in machinekit-cnc, but that specific location doesn't get copied over to machinekit-hal when running the build_with_cnc script under the machinekit-hal/scripts folder. As a result, I was instead calling the linuxcnc script under the /usr/bin folder which had old settings in it.

I haven't tested my theory, but from looking through the build_with_cnc script I am not seeing the machinekit-cnc scripts folder get copied over to the machinekit-hal scripts folder. This will cause problems because the correct linuxcnc bash script is only in the machinekit-cnc repo.

schoo...@gmail.com

unread,
Jul 10, 2019, 3:11:55 AM7/10/19
to machi...@googlegroups.com
OK, this is the first time you have said you are actually building a combined RIP of machinekit-hal and machinekit-cnc, not machinekit.

The build_with_cnc script DOES copy the scripts.

First it removes the section of the paths in linuxcnc script, that lead to the machinekit-cnc clone and edits it to point to machinekit-hal
https://github.com/machinekit/machinekit-hal/blob/master/scripts/build_with_cnc#L56

Then it copies all scripts except 2 specifically excluded, to machinekit-hal/scripts.
https://github.com/machinekit/machinekit-hal/blob/master/scripts/build_with_cnc#L57

If it did not, the combined build could never have worked.

I suspect that either you were not calling . ./scripts/rip-environment from the terminal session of the build and then running from that session,
or that somehow your PATH var retained /bin ahead of the added paths from the RIP and executed /bin first.

Run 'echo $PATH' before calling 'machinekit and see what is in it.
To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages