Java UI for linuxcnc

More
05 Jul 2021 21:24 #213788 by vmihalca
Replied by vmihalca on topic Java UI for linuxcnc
From what you are saying, I understand I should have an exHdr directory inside JCNCScreen folder. I don't have it. I assume that the build script of LCExportHandler module should also create that folder and then copy the LCExportHandler.jar into it.
I have made a git pull on that module and it says its up to date. Did you forgot to commit some changes on that repo?
Starting from the assumption that there should be an exHdr folder inside JCNCScreen, I have created that folder and copied the LCExportHandler into it, then ran again ant dist.
This time it worked and the JCNCScreen-bin.zip was created.
I took that zip, I extracted it, created the symlink to the linuxcnc library, then tried to run the jar with the following command:

java -Djava.library.path=.:./lc/lib -jar JCNCScreen.jar -base ./exHdr

The error I got is:

vasilemihalca@INV1047:~/JavaLinuxCNC/JCNCScreen-bin$ java -Djava.library.path=.:./lc/lib -jar JCNCScreen.jar -base ./exHdr
local check: AppTitle == > JCNCScreen - frontend for linuxCNC <
populateTree ...
read ToolTable ...
java: symbol lookup error: /home/vasilemihalca/JavaLinuxCNC/JCNCScreen-bin/libLinuxCNC.so: undefined symbol: _ZN3NMLnwEm

See the attached image for the folder structure.
I feel I am close...still missing out something.. 
Thanks for your support so far! 
Attachments:

Please Log in or Create an account to join the conversation.

More
06 Jul 2021 13:57 #213854 by Reinhard
Replied by Reinhard on topic Java UI for linuxcnc

I assume that the build script of LCExportHandler module should also create that folder and then copy the LCExportHandler.jar into it.

No. LCExportHandler is a library wich is fine in lib-dir.
I didn't want to have any dependencies between application and exporthandler. So I exported all Interfaces and Baseclasse that an exporthandler might need into LCExportHandler and put that as an external library, which get used by application and exporthandler.
The directory exHdr is just an empty directory, where the application looks for exporthandlers. Exporthandlers are like shared libs from linux, which means, they get loaded at runtime.
I'll check the build-script on how to relax that situation.
You should not need to create directories of copy files ...
.

java: symbol lookup error: /home/vasilemihalca/JavaLinuxCNC/JCNCScreen-bin/libLinuxCNC.so: undefined symbol: _ZN3NMLnwEm

Yes, I had similar errors too. I have no idea, where they come from. The headers are resolved and the libraries got loaded at link stage - so "normally" those messages should not appear.
But ok - linuxcnc has heavily nested dependencies, so it might not be the original error, but the first succeeding error, that raises a message.

I removed anything unneeded from the native layer and with LC from git-master I can run the app without such dependeny errors.
But that may be by occasion, not by knowledge.
Currently I run out of ideas, but I keep on testing.

Please Log in or Create an account to join the conversation.

More
06 Jul 2021 15:49 #213867 by Reinhard
Replied by Reinhard on topic Java UI for linuxcnc
Hi,

I just pushed an updated build-script.
Please let me know, if it works for you without having an exHdr directory.

Please Log in or Create an account to join the conversation.

More
07 Jul 2021 13:26 #213971 by Reinhard
Replied by Reinhard on topic Java UI for linuxcnc
to make it clear again: the published state works for me.
Debian current, linuxcnc github-master

my linuxcnc configure-switches:
--with-realtime=uspace --enable-toolnml --enable-non-distributable=yes

Please Log in or Create an account to join the conversation.

More
07 Jul 2021 13:44 #213972 by vmihalca
Replied by vmihalca on topic Java UI for linuxcnc
Thanks for your effort, I've been busy debugging my new lathe in the last 2 days, once I can settle my mind for coding I will let you know if it works on my end.
I am not using a realtime kernel, I am using the development laptop I use for work.

Please Log in or Create an account to join the conversation.

More
07 Jul 2021 13:48 #213973 by Reinhard
Replied by Reinhard on topic Java UI for linuxcnc
Option --with-realtime=uspace means, no realtime, use current kernel ;)

Please Log in or Create an account to join the conversation.

More
07 Jul 2021 19:30 #213986 by vmihalca
Replied by vmihalca on topic Java UI for linuxcnc
Pulled the last code, ran the script, the build works flawlessly, extracted the jar into my home path, set the soft link and tried to run it. Unfortunately, same error while trying to run. Can you test my zip and see if it works for you?

vasilemihalca@INV1047:~/JCNCScreen-bin$ java -Djava.library.path=.:./lc/lib -splash:lc/linuxcnc.gif -jar JCNCScreen.jar -base ./exHdr
local check: AppTitle == > JCNCScreen - frontend for linuxCNC <
populateTree ...
read ToolTable ...
java: symbol lookup error: /home/vasilemihalca/JCNCScreen-bin/libLinuxCNC.so: undefined symbol: _ZN3NMLnwEm

I tried to upload the zip here so that you can try it on your machine, but its 12mb and the max here is 1.6mb.
If you give me an email and you wanna try it out, I would help to know if my zip works for you.

Thanks!

Please Log in or Create an account to join the conversation.

More
08 Jul 2021 02:37 #214005 by Reinhard
Replied by Reinhard on topic Java UI for linuxcnc
Hi,

as I already wrote, I don't believe, that this error is the real error. Its just a consecutive error, that vomits a message.

When this kind of error happened first, it was about emcFormat. That time I cloned emcFormat to a renamed function in my code space.
Then it was constructor or EMC_STAT. After recompiling linuxcnc it was constructor of StateTag.
Then I stripped down the native code to the absolute minimum and it worked without error.
In your case its now the constructor of NML.

I suspect a problem could be the name mangling / mixing c++ and extern "C" - but I don't know, how to narrow the real problem.
I found some strange code in LC that wipes out instance space with memset - may be such code writes wrong space? Don't know. There are so many unthinkable things that could happen ...
.

I tried to upload the zip here so that you can try it on your machine, but its 12mb and the max here is 1.6mb.

you could use a sharehoster and post the link here, but I'm pretty sure, that the problem is not part of the zip.

Please Log in or Create an account to join the conversation.

More
08 Jul 2021 16:12 #214034 by Reinhard
Replied by Reinhard on topic Java UI for linuxcnc
Hi,

with the latest updated I added a check to JCNCScreen to validated that the BufferDescriptor is insync with class definitions of linuxcnc.
After a new build, go into runtime directory and issue this call:
java -Djava.library.path=.:./lc/lib -jar JCNCScreen.jar checkBuffer
The native buffer checker is expected at path location ../native. If that location does not exists, you can specify the path to the native directory after "checkBuffer".
If everything is ok, you should see a message like
BufferDescriptor is upToDate

Please Log in or Create an account to join the conversation.

More
09 Jul 2021 09:05 #214069 by vmihalca
Replied by vmihalca on topic Java UI for linuxcnc
On what branch of Linuxcnc are you? master?
I was on master-gtk3, because when I've set up my local instalation, I was planning to help with converting qtpyvcp on python3.
I think that's a problem, I will switch to master and rebuild linuxcnc.

Please Log in or Create an account to join the conversation.

Time to create page: 0.163 seconds
Powered by Kunena Forum