Skip to contentSkip to conversation

unresolved symbol - check the xenomai installation

Xenomai-help Gregory Gosse 4 participants 10 messages Jan 4, 2012 – Jan 9, 2012

lore
Share & tools
lore
#0 lore raw

Hello,

I have read here http://www.armadeus.com/wiki/index.php?title=Xenomai

That the following commands can be used to check the xenomai installation :

$ dmesg | grep Xenomai
$ xeno-test

It gives the following results for me

[email protected]:~# dmesg | grep Xenomai 
[    2.229354] I-pipe: Domain Xenomai registered. 
[    2.229358] Xenomai: hal/i386 started. 
[    2.229368] Xenomai: scheduling class idle registered. 
[    2.229370] Xenomai: scheduling class rt registered. 
[    2.229804] Xenomai: real-time nucleus v2.6.0 (Movin' On) loaded. 
[    2.229806] Xenomai: debug mode enabled. 
[    2.229877] Xenomai: starting native API services. 
[    2.229878] Xenomai: starting POSIX services. 
[    2.229899] Xenomai: starting RTDM services.

Xeno-test

.

.

Utilisation 2313: W....

2316: W..X.

2317: GS...

2338: W...V

[Domain info]

id=0x58454e4f

priority=topmost

mercredi 4 janvier 2012, 15:01:00 (UTC+0100)

running: cat /proc/ipipe/version

2.10-01

mercredi 4 janvier 2012, 15:01:00 (UTC+0100)

running: generate_loads 1

dd workload started, pids 2602 stored in /var/lock/xeno-test.2461.pids

2602 pts/0 00:00:00 dd

something died a 2602 or

something died a 2602 or

something died a 2602 or

something died a 2602 or

.

.

I'm still unable to compile the native examples . The 'make' command gives such errors :

/tmp/ccqQeLZj.o: In function `demo':

trivial-periodic.c:(.text+0x2f): undefined reference to `rt_task_set_periodic'

trivial-periodic.c:(.text+0x34): undefined reference to `rt_timer_read'

trivial-periodic.c:(.text+0x46): undefined reference to `rt_task_wait_period'

trivial-periodic.c:(.text+0x4b): undefined reference to `rt_timer_read'

Please . Any idea to go further ?

Gregory

#1 lore raw
Quoted 29 lines · Gregory Gosse

Hello,

I have read here http://www.armadeus.com/wiki/index.php?title=Xenomai

That the following commands can be used to check the xenomai installation :

$ dmesg | grep Xenomai
$ xeno-test

It gives the following results for me

[email protected]:~# dmesg | grep Xenomai 
[    2.229354] I-pipe: Domain Xenomai registered. 
[    2.229358] Xenomai: hal/i386 started. 
[    2.229368] Xenomai: scheduling class idle registered. 
[    2.229370] Xenomai: scheduling class rt registered. 
[    2.229804] Xenomai: real-time nucleus v2.6.0 (Movin' On) loaded. 
Quoted 7 lines
[    2.229806] Xenomai: debug mode enabled. 
[    2.229877] Xenomai: starting native API services. 
[    2.229878] Xenomai: starting POSIX services. 
[    2.229899] Xenomai: starting RTDM services.

That is the output of xenomai 2.6.0.

Quoted 16 lines

Xeno-test

.

.

Utilisation 2313: W....

2316: W..X.

2317: GS...

Quoted 7 lines

2338: W...V

[Domain info]

id=0x58454e4f

priority=topmost

That is the output of xeno-test from the 2.5 branch, so, you probably mixed two xenomai installations.

Also, as I already told you, a simple way to know if xenomai is correctly installed is to run the latency test.

Signature · 1 line
					    Gilles.
#2 lore raw

I tried to install xenomai 2.4.4 but didn't go too far ( unable to prepare the kernell ) Then I switched directly to 2.6.0 . Never used the 2.5 branch

The latency test gives me that:

# /usr/xenomai/bin/latency -t0 -p200 -f -T50 
Sampling period: 200 us 
Test mode: periodic user-mode task 
All results in microseconds 
Minuterie d'alerte
Quoted 2 lines

That is the output of xeno-test from the 2.5 branch, so, you probably mixed two xenomai installations. Also, as I already told you, a simple way to know if xenomai is correctly installed is to run the latency test.

Gilles.

#3 lore raw
Quoted 9 lines · Gregory Gosse

I tried to install xenomai 2.4.4 but didn't go too far ( unable to prepare the kernell ) Then I switched directly to 2.6.0 . Never used the 2.5 branch

The latency test gives me that:

# /usr/xenomai/bin/latency -t0 -p200 -f -T50 
Sampling period: 200 us 
Test mode: periodic user-mode task 
All results in microseconds 
Minuterie d'alerte

This looks bad. Please re-run latency with no argument. If should normally produce a report about min/average/max latency every second. If it does not, I would recommend restarting the installation from scratch:
- first uninstalling any installed version, running "make uninstall" in the build directory, this for xenomai 2.4.4 and 2.6.0.
- re-run prepare-kernel, recompile the kernel, leaving the xenomai configuration options to their default value.

Signature · 1 line
					    Gilles.
#4 lore raw
Quoted 9 lines · Gilles Chanteperdrix

This looks bad. Please re-run latency with no argument. If should normally produce a report about min/average/max latency every second. If it does not, I would recommend restarting the installation from scratch:
- first uninstalling any installed version, running "make uninstall" in the build directory, this for xenomai 2.4.4 and 2.6.0.
- re-run prepare-kernel, recompile the kernel, leaving the xenomai configuration options to their default value.

I have a similar problem trying to install xenomai 2.6.0. In my case latency works correctly, but trying to compile examples gives me the same 'unresolved reference' error. I noticed this first trying to compile RTXI, which also gives me

/usr/xenomai/lib/libnative.so: undefined reference to xeno_current' /usr/xenomai/lib/libnative.so: undefined reference to xeno_sem_heap' /usr/xenomai/lib/libnative.so: undefined reference to xeno_sigshadow_install_once' /usr/xenomai/lib/libnative.so: undefined reference to xeno_set_current' /usr/xenomai/lib/libnative.so: undefined reference to xeno_map_heap' /usr/xenomai/lib/libnative.so: undefined reference to xnarch_tsc_to_ns' /usr/xenomai/lib/libnative.so: undefined reference to xeno_handle_mlock_alert' /usr/xenomai/lib/libnative.so: undefined reference to xeno_fault_stack' /usr/xenomai/lib/libnative.so: undefined reference to xeno_set_current_mode' /usr/xenomai/lib/libnative.so: undefined reference to xeno_bind_skin_opt' /usr/xenomai/lib/libnative.so: undefined reference to xeno_current_mode' /usr/xenomai/lib/libnative.so: undefined reference to xnarch_ns_to_tsc'

I did it before with Xenomai 2.5.6 and did not recall such a linking problems. I read before that it might be causes by cross-compilation being messed up, but in that case I do default compilation on linux 2.6.38.8. I did not try 2.5.6 again to check if the problem remains for 2.5.6, I can try to do that.

Best wishes,

Jakub

#5 lore raw
Quoted 15 lines · Jakub Nowacki
Quoted 9 lines · Gilles Chanteperdrix

This looks bad. Please re-run latency with no argument. If should normally produce a report about min/average/max latency every second. If it does not, I would recommend restarting the installation from scratch:
- first uninstalling any installed version, running "make uninstall" in the build directory, this for xenomai 2.4.4 and 2.6.0.
- re-run prepare-kernel, recompile the kernel, leaving the xenomai configuration options to their default value.

I have a similar problem trying to install xenomai 2.6.0. In my case latency works correctly, but trying to compile examples gives me the same 'unresolved reference' error. I noticed this first trying to compile RTXI, which also gives me

Quoted 15 lines

/usr/xenomai/lib/libnative.so: undefined reference to xeno_current' /usr/xenomai/lib/libnative.so: undefined reference to xeno_sem_heap' /usr/xenomai/lib/libnative.so: undefined reference to `xeno_sigshadow_install_once'
/usr/xenomai/lib/libnative.so: undefined reference to xeno_set_current' /usr/xenomai/lib/libnative.so: undefined reference to xeno_map_heap' /usr/xenomai/lib/libnative.so: undefined reference to xnarch_tsc_to_ns' /usr/xenomai/lib/libnative.so: undefined reference to xeno_handle_mlock_alert'
/usr/xenomai/lib/libnative.so: undefined reference to xeno_fault_stack' /usr/xenomai/lib/libnative.so: undefined reference to xeno_set_current_mode'
/usr/xenomai/lib/libnative.so: undefined reference to xeno_bind_skin_opt' /usr/xenomai/lib/libnative.so: undefined reference to xeno_current_mode' /usr/xenomai/lib/libnative.so: undefined refereance to `xnarch_ns_to_tsc'

This is not the same issue as Gregory. Gregory missing symbols were from libnative, and we know that examples makefiles include -lnative, so, libnative is probably not installed in the place where the linker looks for it: that is an installation issue.
On the other hands, the symbols from the errors you show us are defined in libxenomai.so. So, the RTXI build system is likely using hardcoded flags instead of the flags returned by xeno-config: that is a makefile issue.

Signature · 1 line
					    Gilles.
#6 lore raw
Quoted 9 lines · Gilles Chanteperdrix

This is not the same issue as Gregory. Gregory missing symbols were from libnative, and we know that examples makefiles include -lnative, so, libnative is probably not installed in the place where the linker looks for it: that is an installation issue.
On the other hands, the symbols from the errors you show us are defined in libxenomai.so. So, the RTXI build system is likely using hardcoded flags instead of the flags returned by xeno-config: that is a makefile issue.

OK, maybe my problem is not similar but I still get unresolved reference. Below I show the full listing when compilation fails

/bin/bash ../libtool --tag=CXX --mode=link g++ -pipe -Wall -I/usr/share/qt3/include -DQT_THREAD_SUPPORT -O2 -L/usr/share/qt3/lib -lqt-mt -lSM -lICE -lX11 -lXext -lXmu -lXt -lXi -lgsl -lgslcblas -lm
-L/usr/xenomai/lib -lxenomai -lpthread -lrt -lnative -o rtxi
cmdline.o daq.o default_gui_model.o event.o fifo.o io.o main.o main_window.o mutex.o plugin.o rt.o rtfile.o rwlock.o sem.o settings.o workspace.o rt_os-xenomai.o moc_default_gui_model.o moc_main_window.o moc_plugin.o -rdynamic
libtool: link: g++ -pipe -Wall -I/usr/share/qt3/include -DQT_THREAD_SUPPORT -O2 -o rtxi cmdline.o daq.o default_gui_model.o event.o fifo.o io.o main.o main_window.o mutex.o plugin.o rt.o rtfile.o rwlock.o sem.o settings.o workspace.o rt_os-xenomai.o moc_default_gui_model.o moc_main_window.o moc_plugin.o -rdynamic -L/usr/share/qt3/lib /usr/lib/libqt-mt.so -lSM -lICE -lX11 -lXext -lXmu -lXt -lXi -lgsl -lgslcblas -lm -L/usr/xenomai/lib /usr/xenomai/lib/libxenomai.so -lpthread -lrt /usr/xenomai/lib/libnative.so -Wl,-rpath -Wl,/usr/xenomai/lib -Wl,-rpath -Wl,/usr/xenomai/lib /usr/xenomai/lib/libnative.so: undefined reference to `xeno_current'
/usr/xenomai/lib/libnative.so: undefined reference to `xeno_sem_heap'
/usr/xenomai/lib/libnative.so: undefined reference to `xeno_sigshadow_install_once'
/usr/xenomai/lib/libnative.so: undefined reference to `xeno_set_current'
/usr/xenomai/lib/libnative.so: undefined reference to `xeno_map_heap'
/usr/xenomai/lib/libnative.so: undefined reference to `xnarch_tsc_to_ns'
/usr/xenomai/lib/libnative.so: undefined reference to `xeno_handle_mlock_alert'
/usr/xenomai/lib/libnative.so: undefined reference to `xeno_fault_stack'
/usr/xenomai/lib/libnative.so: undefined reference to `xeno_set_current_mode'
/usr/xenomai/lib/libnative.so: undefined reference to `xeno_bind_skin_opt'
/usr/xenomai/lib/libnative.so: undefined reference to `xeno_current_mode'
/usr/xenomai/lib/libnative.so: undefined reference to `xnarch_ns_to_tsc'
collect2: ld returned 1 exit status
make[1]: *** [rtxi] Error 1
make[1]: Leaving directory `/usr/src/rtxi-1.31/rtxi'
make: *** [all-recursive] Error 1

I use xeno-config to get flags, as you can see in the above libtool command. I'm not the expert on autotools, but everything seems to look OK. I even tried to add xenomai LD_LIBRARY_PATH, but the result is still the same. I think I give it a go with 2.5.6 and see if the error is there; I installed xenomai 2.5.6 for RTXI a couple of times on different machines and I don't recall this problem. Just to be absolutely clear, I'm suing Ubuntu 11.04 with GCC 4.6 (I checked 4.5 and I get the same thing).

Best wishes,

Jakub

#7 lore raw
Quoted 29 lines · Jakub Nowacki
Quoted 9 lines · Gilles Chanteperdrix

This is not the same issue as Gregory. Gregory missing symbols were from libnative, and we know that examples makefiles include -lnative, so, libnative is probably not installed in the place where the linker looks for it: that is an installation issue.
On the other hands, the symbols from the errors you show us are defined in libxenomai.so. So, the RTXI build system is likely using hardcoded flags instead of the flags returned by xeno-config: that is a makefile issue.

OK, maybe my problem is not similar but I still get unresolved reference. Below I show the full listing when compilation fails

/bin/bash ../libtool --tag=CXX --mode=link g++ -pipe -Wall

(quoted diff) +0 -3
-I/usr/share/qt3/include -DQT_THREAD_SUPPORT -O2 -L/usr/share/qt3/lib
-lqt-mt -lSM -lICE -lX11 -lXext -lXmu -lXt -lXi -lgsl -lgslcblas -lm
-L/usr/xenomai/lib -lxenomai -lpthread -lrt -lnative -o rtxi cmdline.o

daq.o default_gui_model.o event.o fifo.o io.o main.o main_window.o mutex.o plugin.o rt.o rtfile.o rwlock.o sem.o settings.o workspace.o rt_os-xenomai.o moc_default_gui_model.o moc_main_window.o moc_plugin.o -rdynamic
libtool: link: g++ -pipe -Wall -I/usr/share/qt3/include -DQT_THREAD_SUPPORT -O2 -o rtxi cmdline.o daq.o default_gui_model.o event.o fifo.o io.o main.o main_window.o mutex.o plugin.o rt.o rtfile.o rwlock.o sem.o settings.o workspace.o rt_os-xenomai.o moc_default_gui_model.o moc_main_window.o moc_plugin.o -rdynamic

(quoted diff) +0 -2
-L/usr/share/qt3/lib /usr/lib/libqt-mt.so -lSM -lICE -lX11 -lXext -lXmu
-lXt -lXi -lgsl -lgslcblas -lm -L/usr/xenomai/lib
Quoted 3 lines

/usr/xenomai/lib/libxenomai.so -lpthread -lrt /usr/xenomai/lib/libnative.so -Wl,-rpath -Wl,/usr/xenomai/lib -Wl,-rpath -Wl,/usr/xenomai/lib

References should precede definitions. Try swapping libxenomai.so and libnative.so in your link order. As Gilles already suggested, using the xeno-config script in your Makefile to get the proper link flags would have prevented this issue.

Quoted 40 lines

/usr/xenomai/lib/libnative.so: undefined reference to xeno_current' /usr/xenomai/lib/libnative.so: undefined reference to xeno_sem_heap' /usr/xenomai/lib/libnative.so: undefined reference to `xeno_sigshadow_install_once'
/usr/xenomai/lib/libnative.so: undefined reference to xeno_set_current' /usr/xenomai/lib/libnative.so: undefined reference to xeno_map_heap' /usr/xenomai/lib/libnative.so: undefined reference to xnarch_tsc_to_ns' /usr/xenomai/lib/libnative.so: undefined reference to xeno_handle_mlock_alert'
/usr/xenomai/lib/libnative.so: undefined reference to xeno_fault_stack' /usr/xenomai/lib/libnative.so: undefined reference to xeno_set_current_mode'
/usr/xenomai/lib/libnative.so: undefined reference to xeno_bind_skin_opt' /usr/xenomai/lib/libnative.so: undefined reference to xeno_current_mode' /usr/xenomai/lib/libnative.so: undefined reference to `xnarch_ns_to_tsc'
collect2: ld returned 1 exit status
make[1]: *** [rtxi] Error 1
make[1]: Leaving directory `/usr/src/rtxi-1.31/rtxi'
make: *** [all-recursive] Error 1

I use xeno-config to get flags, as you can see in the above libtool command. I'm not the expert on autotools, but everything seems to look OK. I even tried to add xenomai LD_LIBRARY_PATH, but the result is still the same. I think I give it a go with 2.5.6 and see if the error is there; I installed xenomai 2.5.6 for RTXI a couple of times on different machines and I don't recall this problem. Just to be absolutely clear, I'm suing Ubuntu 11.04 with GCC 4.6 (I checked 4.5 and I get the same thing).

Best wishes,

Jakub

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Signature · 1 line
Philippe.
#8 lore raw
Quoted 5 lines · Philippe Gerum

References should precede definitions. Try swapping libxenomai.so and libnative.so in your link order. As Gilles already suggested, using the xeno-config script in your Makefile to get the proper link flags would have prevented this issue.

Thanks for the answer. The problem is I do not have just a Makefile but it is generated with autotools. In autotools xeno-config is used but apparently order is not OK.

Cheers,

Jakub

#9 lore raw
Quoted 9 lines · Jakub Nowacki
Quoted 5 lines · Philippe Gerum

References should precede definitions. Try swapping libxenomai.so and libnative.so in your link order. As Gilles already suggested, using the xeno-config script in your Makefile to get the proper link flags would have prevented this issue.

Thanks for the answer. The problem is I do not have just a Makefile but it is generated with autotools. In autotools xeno-config is used but apparently order is not OK.

The flag returned by xeno-config are in the right order if you use the "new" syntax that is --skin=native --ldflags instead of the "old" syntax --xeno-ldflags which required you to add -lnative -lxenomai by hand.

Another solution, since xenomai 2.6.0, is to use pkg-config. How to use pkg-config with the autotools is described here, for instance:

http://bec-systems.com/site/121/autotools-quick-reference

The name of xenomai .pc files are libxenomai_skin, so libxenomai_native for the native skin, or libxenomai_posix for the posix skin.

Signature · 1 line
                                                                Gilles.