7i77 5i25 hm2_pci unloaded

More
29 Nov 2016 19:18 #83445 by andypugh
Replied by andypugh on topic 7i77 5i25 hm2_pci unloaded
By removing "option singleton" from your .comp file it all compiles cleanly on my (RTAI) system.

So any problem you are having is likely to be caused by being in a uspace system.

At the bottom of section 6.2 linuxcnc.org/docs/2.7/html/hal/comp.html#_options there is an entry that is relevant _only_ when compiling in Uspace. Perhaps that is something you need to add items to?
The following user(s) said Thank You: bkt

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

More
30 Nov 2016 08:19 - 30 Nov 2016 08:30 #83475 by bkt
Replied by bkt on topic 7i77 5i25 hm2_pci unloaded
Ok Tanks You are in right ... after removing sigleton row and compiling the old file K1MbServer.c (the .comp file parsed by halcompile command) in these way: halcompile --install K1MbServer.c the compiling process is ok.... with halcompile --install --uspace k1MbServer.c have the same error than the past .... K1MbServer.c = konembserver.c without singleton row
halcompile --install --userspace K1MbServer.c gcc -Os -g -I. -I/home/k1/linuxcnc-dev/src/include -DUSPACE -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/home/k1/linuxcnc-dev/include -Wframe-larger-than=2560 -DSIM -fPIC -URTAPI -U__MODULE__ -DULAPI -Os -lm -ldl -L/usr/local/include/modbus -lmodbus -o K1MbServer /tmp/tmp0wIaJv/K1MbServer.c -Wl,-rpath,/home/k1/linuxcnc-dev/lib -L/home/k1/linuxcnc-dev/lib -llinuxcnchal 
/tmp/ccRr1qGz.o: in function "Rcf":
/tmp/tmp0wIaJv/K1MbServer.comp:177:undefined reference "modbus_get_float"
/tmp/ccRr1qGz.o: in function "SdFloat":
/tmp/tmp0wIaJv/K1MbServer.comp:184:undefined reference "modbus_set_float"
/tmp/ccRr1qGz.o: in function "user_mainloop":
/tmp/tmp0wIaJv/K1MbServer.comp:209:undefined reference "floor"
/tmp/tmp0wIaJv/K1MbServer.comp:215:undefined reference "floor"
/tmp/tmp0wIaJv/K1MbServer.comp:216:undefined reference "floor"
/tmp/tmp0wIaJv/K1MbServer.comp:217:undefined reference "floor"
/tmp/tmp0wIaJv/K1MbServer.comp:218:undefined reference "floor"
/tmp/tmp0wIaJv/K1MbServer.comp:235:undefined reference "modbus_new_tcp"
/tmp/tmp0wIaJv/K1MbServer.comp:237:undefined reference "modbus_get_header_length"
/tmp/tmp0wIaJv/K1MbServer.comp:239:undefined reference "modbus_set_debug"
/tmp/tmp0wIaJv/K1MbServer.comp:241:undefined reference "modbus_mapping_new"
/tmp/tmp0wIaJv/K1MbServer.comp:246:undefined reference "modbus_free"
/tmp/tmp0wIaJv/K1MbServer.comp:262:undefined reference "modbus_tcp_listen"
/tmp/tmp0wIaJv/K1MbServer.comp:263:undefined reference "modbus_tcp_accept"
/tmp/tmp0wIaJv/K1MbServer.comp:405:undefined reference "modbus_receive"
/tmp/tmp0wIaJv/K1MbServer.comp:416:undefined reference "modbus_reply"
/tmp/tmp0wIaJv/K1MbServer.comp:439:undefined reference "modbus_mapping_free"
/tmp/tmp0wIaJv/K1MbServer.comp:441:undefined reference "modbus_close"
/tmp/tmp0wIaJv/K1MbServer.comp:442:undefined reference "modbus_free"
collect2: error: ld returned 1 exit status
make: *** [K1MbServer] Errore 1

I try to do this:
halcompile -- install K1MbServer.c

linuxcnc myfileini.ini

The error returned from Lcnc is :
bla bla bla
bla bla: undefined reference "modbus_get_float"
bla bla..

These because libmodbus is userspace library and not realtime library so K1MbServer.c it must be userspace component ....

I not uderstand wery well: on ubuntu 10.04 Lcnc is installed on root directory .... on ubuntu14.04 Lcnc is installed on linuxcnc-dev directory in Home directory .... so the most logical conclusion is that there is permission problems ... libmodbus and math.h is in root dir /usr/include..... linuxcnc on /home/linuxcnc-dev .... I'm pretty sure that if I leave math.h and put rtmath.h instead the error about "floor" disappear ....

So the question is .... How can correctly link the library used on my comp?? I have just make a symlink of libmodbus.so on /home/linuxcnc-dev/lib .... but it not works...

Regards
Giorgio
Last edit: 30 Nov 2016 08:30 by bkt.

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

More
30 Nov 2016 08:29 #83476 by bkt
Replied by bkt on topic 7i77 5i25 hm2_pci unloaded
other things ....

option extra_link_args "…" - (default: "") This option is ignored if the option userspace (see above) is set to no. When linking a userspace component, the arguments given are inserted in the link line. Note that because compilation takes place in a temporary directory, "-L." refers to the temporary directory and not the directory where the .comp source file resides.


so:

gcc -Os -g -I. -I/home/k1/linuxcnc-dev/src/include -DUSPACE -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/home/k1/linuxcnc-dev/include -Wframe-larger-than=2560 -DSIM -fPIC -URTAPI -U__MODULE__ -DULAPI -Os -lm -ldl -L/usr/local/include/modbus -lmodbus -o K1MbServer /tmp/tmp0wIaJv/konembserver.c -Wl,-rpath,/home/k1/linuxcnc-dev/lib -L/home/k1/linuxcnc-dev/lib -llinuxcnchal

/*********** -lm -ldl -L/usr/local/include/modbus -lmodbus*************/


the commented row .. the link is search in /tmp/.... or in the right place on /usr/include...???

Regards
giorgio

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

Moderators: PCWjmelson
Time to create page: 0.541 seconds
Powered by Kunena Forum