Compiler and linker options for rtnet (and xenomai)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi,
first of all sorry for the cross-posting but I think that there's something wrong in the xeno-config options in both projects. If I run:
$ xeno-config --skin=native --ldflags -lnative -L/usr/lib -lxenomai -lpthread -lrt
$ xeno-config --skin=posix --ldflags -Wl,@/usr/lib/posix.wrappers -L/usr/lib -lpthread_rt -lxenomai -lpthread -lrt
$ xeno-config --skin=rtdm --ldflags -lrtdm -L/usr/lib -lxenomai -lpthread -lrt
So, in my application, that I _only_ use rtnet calls and also, the pthread calls (pthread_*, rt_* calls)
none of the options described fits my needs. Or rtdm skin adds the native lib, or we create another --ldflags with rtdm, native.
What do you think?
Best regards,
Leopold
---------------------------/usr/bin/gcc -fPIC -Wl,--no-undefined -lrt -lrtdm -L/usr/lib -lxenomai - lpthread -lrt -Wl,--no-undefined -lrt -shared -Wl,-soname,libsoemrt.so.1.3.0 -o libsoemrt.so.1.3.0 CMakeFiles/soem_dynamic_rt.dir/soem/ethercatbase.c.o CMakeFiles/soem_dynamic_rt.dir/soem/ethercatcoe.c.o CMakeFiles/soem_dynamic_rt.dir/soem/ethercatconfig.c.o CMakeFiles/soem_dynamic_rt.dir/soem/ethercatdc.c.o CMakeFiles/soem_dynamic_rt.dir/soem/ethercatfoe.c.o CMakeFiles/soem_dynamic_rt.dir/soem/ethercatmain.c.o CMakeFiles/soem_dynamic_rt.dir/soem/ethercatprint.c.o CMakeFiles/soem_dynamic_rt.dir/soem/ethercatsoe.c.o CMakeFiles/soem_dynamic_rt.dir/oshw/linux/nicdrv.c.o CMakeFiles/soem_dynamic_rt.dir/oshw/linux/oshw.c.o CMakeFiles/soem_dynamic_rt.dir/osal/linux/osal.c.o
.....
CMakeFiles/soem_dynamic_rt.dir/oshw/linux/nicdrv.c.o: In function `ecx_setupnic':
nicdrv.c:(.text+0x309): undefined reference to rt_mutex_create' nicdrv.c:(.text+0x325): undefined reference to rt_mutex_create' nicdrv.c:(.text+0x341): undefined reference to rt_mutex_create' CMakeFiles/soem_dynamic_rt.dir/oshw/linux/nicdrv.c.o: In function ecx_getindex':
nicdrv.c:(.text+0x761): undefined reference to rt_mutex_acquire' nicdrv.c:(.text+0x821): undefined reference to rt_mutex_release' CMakeFiles/soem_dynamic_rt.dir/oshw/linux/nicdrv.c.o: In function `ecx_outframe_red':
nicdrv.c:(.text+0x99c): undefined reference to rt_mutex_acquire' nicdrv.c:(.text+0xa25): undefined reference to rt_mutex_release' CMakeFiles/soem_dynamic_rt.dir/oshw/linux/nicdrv.c.o: In function `ecx_inframe':
nicdrv.c:(.text+0xbad): undefined reference to rt_mutex_acquire' nicdrv.c:(.text+0xd83): undefined reference to rt_mutex_release'
collect2: error: ld returned 1 exit status
Signature · 8 lines
-- Linux User 152692 PGP: 0xF944807E Catalonia ------------------------------------- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?
Quoted 17 lines · Leopold Palomo Avellaneda
Hi,
first of all sorry for the cross-posting but I think that there's something
wrong in the xeno-config options in both projects. If I run:$ xeno-config --skin=native --ldflags -lnative -L/usr/lib -lxenomai -lpthread -lrt$ xeno-config --skin=posix --ldflags(quoted diff) +0
-2-Wl,@/usr/lib/posix.wrappers -L/usr/lib -lpthread_rt -lxenomai -lpthread -lrt$ xeno-config --skin=rtdm --ldflags -lrtdm -L/usr/lib -lxenomai -lpthread -lrt
Quoted 8 lines
So, in my application, that I _only_ use rtnet calls and also, the pthread calls (pthread_*, rt_* calls)
none of the options described fits my needs. Or rtdm skin adds the native lib,
or we create another --ldflags with rtdm, native.What do you think?
Hi,
I am not sure I understand your question.
If you want to use the RTDM skin only, then use the flags given by xeno-config --skin=rtdm
If you want to use the RTDM skin with the native skin, then use the flags given by both xeno-config --skin=rtdm and xeno-config --skin=native
If you want to use the RTDM skin through the posix skin, then only use the flags given by xeno-config --skin=posix
If you want to use the 3 skins (RTDM, native, posix), then use the flags given by all three calls to xeno-config.
Regards.
Signature · 1 line
Gilles.
A Dimarts, 18 de juny de 2013, Gilles Chanteperdrix va escriure:
Quoted 34 lines
Quoted 17 lines · Leopold Palomo Avellaneda
Hi,
first of all sorry for the cross-posting but I think that there's something
wrong in the xeno-config options in both projects. If I run:$ xeno-config --skin=native --ldflags -lnative -L/usr/lib -lxenomai -lpthread -lrt$ xeno-config --skin=posix --ldflags(quoted diff) +0
-2-Wl,@/usr/lib/posix.wrappers -L/usr/lib -lpthread_rt -lxenomai -lpthread -lrt$ xeno-config --skin=rtdm --ldflags -lrtdm -L/usr/lib -lxenomai -lpthread -lrtQuoted 8 lines
So, in my application, that I _only_ use rtnet calls and also, the pthread calls (pthread_*, rt_* calls)
none of the options described fits my needs. Or rtdm skin adds the native lib,
or we create another --ldflags with rtdm, native.What do you think?
Hi,
I am not sure I understand your question.
If you want to use the RTDM skin only, then use the flags given by xeno-config --skin=rtdm
Quoted 9 lines
If you want to use the RTDM skin with the native skin, then use the flags given by both xeno-config --skin=rtdm and xeno-config --skin=native
If you want to use the RTDM skin through the posix skin, then only use the flags given by xeno-config --skin=posix
If you want to use the 3 skins (RTDM, native, posix), then use the flags given by all three calls to xeno-config.
My problem is that neither of the three options fits my needs and to make a combination of two of them puts repeated options in the compiler. For example rtdm+native:
-lnative -L/usr/lib -lxenomai -lpthread -lrt -lrtdm -L/usr/lib -lxenomai -lpthread -lrt
I miss a "skin" rtnet, because IMHO the common use of rtnet using that calls cannot be set by none of the options of xeno-config, and you need a combination of both (rtdm+native).
I hope have been more clear now.
Regards,
Leo
Signature · 8 lines
-- Linux User 152692 PGP: 0xF944807E Catalonia ------------------------------------- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?
Review
Quoted 8 lines · Leopold Palomo Avellaneda
My problem is that neither of the three options fits my needs and to make a
combination of two of them puts repeated options in the compiler. For example
rtdm+native:(quoted diff) +0
-2-lnative -L/usr/lib -lxenomai -lpthread -lrt -lrtdm -L/usr/lib -lxenomai -lpthread -lrt
So, what is the problem with this? Do you get a compiler warning? A compilation error?
Signature · 1 line
Gilles.
A Dimecres, 19 de juny de 2013, Gilles Chanteperdrix va escriure:
Quoted 8 lines
Quoted 6 lines · Leopold Palomo Avellaneda
My problem is that neither of the three options fits my needs and to make a
combination of two of them puts repeated options in the compiler. For example
rtdm+native:
Quoted 5 lines
Review
Quoted 2 lines
(quoted diff) +0
-2-lnative -L/usr/lib -lxenomai -lpthread -lrt -lrtdm -L/usr/lib -lxenomai -lpthread -lrtSo, what is the problem with this? Do you get a compiler warning? A compilation error?
well,
obviously it's not a big problem, neither a problem. It's just that an option for rtnet will help a beginner user and don't waste time trying to understand why it doesn't link.
And to have a long long lines with options to the linker could produce that you don't see some errors in some option because the overinformation.
Leo
Signature · 3 lines
-- Linux User 152692 Catalonia