changes in NML-interface?

More
02 Jul 2021 11:49 #213489 by Reinhard
Replied by Reinhard on topic changes in NML-interface?

One of the library's is outside the standard linux library search path.

Thank you for your attention!

I fear, my situation is a bit different. Any way - thank you for the pointer!
Actually java runtime claims about EMC_STAT unresolved.
Digging into code shows, that constructor of EMC_STAT is in file emcops.cc which makes it into liblinuxcnc.a (a static library).
That library is used by link command, so I guess, those references should have already been resolved (statically)..

I changed the linker flags to generate absolute path for every dependencies:
LC_FLAGS = -L$(abspath lc/lib) \
 -Wl,-rpath,$(abspath lc/lib) \
 -shared \
 -Xlinker -Map=libLinuxCNC.map \
  $(abspath lc/lib/liblinuxcnc.a) \
  $(abspath lc/lib/liblinuxcncini.so) \
  $(abspath lc/lib/libnml.so.0) \
  $(abspath lc/lib/liblinuxcnchal.so) \
  $(abspath lc/lib/libtooldata.so.0) \
 -L/usr/X11R6/lib
... and when I issue a ldd mylib, all dependencies have absolute path - and for so don't require ldconfig.
But there may be other dependencies not under my control, which may be unresolved. Don't know.
And the bad side: I have no idea, how to narrow that problem.

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

More
02 Jul 2021 13:56 #213496 by Grotius
Replied by Grotius on topic changes in NML-interface?
If i look at your code i see you miss the -lrt

Attached a makefile that i use with halcompile, And for c++ linuxcnc makefiles you could look at my github in the .pro files.
The qt_linuxcnc_gui is maybe interesting for you to look at. ".pro file has the compile slogan"

Warning: Spoiler!

 

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

More
02 Jul 2021 14:05 #213497 by Reinhard
Replied by Reinhard on topic changes in NML-interface?

If i look at your code i see you miss the -lrt

Thank you.
I just gave it a try, but it makes no difference.

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

More
02 Jul 2021 17:53 #213504 by arvidb
Replied by arvidb on topic changes in NML-interface?

When I load the lib created with the "-shared" flag I get this error:
ibLinuxCNC.so: undefined symbol: _Z9emcFormatiPvP3CMS


The name mangling is done by the C++ compiler to cope with overloading/namespaces. The actual function, emcFormat, seems to be implemented in src/emc/nml_intf/emc.cc. I'm guessing this becomes a part of libnml.so? If so, try to move it to later in the LC_FLAGS. For example:
LC_FLAGS = -L$(abspath lc/lib) \
-Wl,-rpath,$(abspath lc/lib) \
-shared \
lc/lib/liblinuxcnc.a \
lc/lib/liblinuxcncini.so \
lc/lib/liblinuxcnchal.so \
lc/lib/libnml.so.0 \
lc/lib/libtooldata.so.0 \
-L/usr/X11R6/lib -lm -lGL

It's a longshot, but it might work.

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

More
03 Jul 2021 04:28 #213534 by Reinhard
Replied by Reinhard on topic changes in NML-interface?
Thank you for your attention, arvidb
.

The name mangling is done by the C++ compiler to cope with overloading/namespaces.

I know and I suspect that name mangling has its part on the error.
One problem is, that there are so many languages mixed in LC and another problem is the nesting of dependencies. Aparently no lib can be used on its own
.

If so, try to move it to later in the LC_FLAGS.

Hm, I don't know, if sequence of objects/libs plays a role. I changed sequence a lot but couldn't see any difference.

I run out of ideas. Guess I have to start with a new interface layer from scratch :(

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

More
03 Jul 2021 16:52 #213574 by Reinhard
Replied by Reinhard on topic changes in NML-interface?

Guess I have to start with a new interface layer from scratch

That way I succeeded with working nml-layer again :)

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

More
20 Aug 2021 14:01 #218240 by udoS
Replied by udoS on topic changes in NML-interface?
Hi Genlemen
I hope this is the right place. 
How would I get the distance to go from nml for each axis on a gantry CNC. 

best reards

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

More
20 Aug 2021 20:19 #218270 by andypugh
Replied by andypugh on topic changes in NML-interface?
Do you need to use NML?

The UIs seem to use the Python interface:
github.com/LinuxCNC/linuxcnc/blob/master...mc_interface.py#L308

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

More
21 Aug 2021 07:59 - 21 Aug 2021 08:34 #218313 by udoS
Replied by udoS on topic changes in NML-interface?
Hi andypugh
i started with the position-logger using nml and ported it to qtcreator c/c++. No Py. 
Now there is suppose to be a .dtg value for each axis. 
I can not find the tuple for it in the emc_stat. And so on. No docu on that. 
std::get<0> (emcSTATUS->.......... .dtg);

The docu‘s in Py I have seen already. 


 
Attachments:
Last edit: 21 Aug 2021 08:34 by udoS.

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

Time to create page: 0.081 seconds
Powered by Kunena Forum