All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Compiling the Xenomai examples
@ 2012-11-01 15:42 Stefan Videv
  2012-11-01 16:32 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 18+ messages in thread
From: Stefan Videv @ 2012-11-01 15:42 UTC (permalink / raw)
  To: xenomai

Hi All,

I've been following this:

http://www.xenomai.org/index.php/Examples

on how to cross-compile the examples that come with Xenomai.

However, running:

make XENO=/media/rootfs/usr/xenomai/ ARCH=arm-linux-gnueabi- 
KSRC=/media/rootfs/usr/include

where /media/rootfs/usr/xenomai is where xenomai is installed on the SD 
card that "powers" my embedded system, arm-linux-gnueabi- is the cross 
compiler chain I have running on my virtual box, and finally 
/media/rootfs/usr/include is where I installed the header files for the 
kernel that is running on my embedded board.

The above command fails with this:

make[1]: Entering directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/native'
arm-linux-gnueabi-gcc -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT 
-D__XENO__   -lnative -L/usr/xenomai/lib -lxenomai -lpthread -lrt  
-Xlinker -rpath -Xlinker /usr/xenomai/lib  trivial-periodic.c   -o 
trivial-periodic
trivial-periodic.c:6:25: fatal error: native/task.h: No such file or 
directory
compilation terminated.
make[1]: *** [trivial-periodic] Error 1
make[1]: Leaving directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/native'
POSIX support is not available
make[1]: Entering directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/rtdm/profiles/can'
arm-linux-gnueabi-gcc -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT 
-D__XENO__ -I/usr/xenomai/include/posix     -lrtdm -Xlinker -rpath 
-Xlinker /usr/xenomai/lib  rtcan_rtt.c   -o rtcan_rtt
rtcan_rtt.c:53:24: fatal error: rtdm/rtcan.h: No such file or directory
compilation terminated.
make[1]: *** [rtcan_rtt] Error 1
make[1]: Leaving directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/rtdm/profiles/can'
POSIX support is not available
make[1]: Entering directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/rtdm/profiles/ipc'
arm-linux-gnueabi-gcc -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT 
-D__XENO__ -I/usr/xenomai/include/posix     -lrtdm -Xlinker -rpath 
-Xlinker /usr/xenomai/lib  xddp-echo.c   -o xddp-echo
xddp-echo.c:58:18: fatal error: rtdk.h: No such file or directory
compilation terminated.
make[1]: *** [xddp-echo] Error 1
make[1]: Leaving directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/rtdm/profiles/ipc'
make[1]: Entering directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/rtdm/profiles/serial'
arm-linux-gnueabi-gcc -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT 
-D__XENO__   -lnative -L/usr/xenomai/lib -lxenomai -lpthread -lrt  
-lrtdm -Xlinker -rpath -Xlinker /usr/xenomai/lib  cross-link.c   -o 
cross-link
cross-link.c:28:25: fatal error: native/task.h: No such file or directory
compilation terminated.
make[1]: *** [cross-link] Error 1
make[1]: Leaving directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/rtdm/profiles/serial'
sed: can't read /media/rootfs/usr/include/Makefile: No such file or 
directory
make[1]: Entering directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/rtdm/driver-api'
arm-linux-gnueabi-gcc -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT 
-D__XENO__   -lnative -L/usr/xenomai/lib -lxenomai -lpthread -lrt  
-lrtdm -Xlinker -rpath -Xlinker /usr/xenomai/lib  tut01-skeleton-app.c   
-o tut01-skeleton-app
tut01-skeleton-app.c:49:23: fatal error: rtdm/rtdm.h: No such file or 
directory
compilation terminated.
make[1]: *** [tut01-skeleton-app] Error 1
make[1]: Leaving directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/rtdm/driver-api'
sed: can't read /media/rootfs/usr/include/Makefile: No such file or 
directory
POSIX support is not available
make[1]: Entering directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/posix'
arm-linux-gnueabi-gcc -DCONSUMER -I/usr/xenomai/include -D_GNU_SOURCE 
-D_REENTRANT -D__XENO__ -I/usr/xenomai/include/posix     -Xlinker -rpath 
-Xlinker /usr/xenomai/lib  satch.c   -o satch
/tmp/ccQTzItL.o: In function `abort_perror':
satch.c:(.text+0xfc): undefined reference to `xnprintf'
/tmp/ccQTzItL.o: In function `consumer':
satch.c:(.text+0x13a): undefined reference to `pthread_sigmask'
satch.c:(.text+0x198): undefined reference to `timer_settime'
satch.c:(.text+0x1ee): undefined reference to `mq_receive'
/tmp/ccQTzItL.o: In function `__xeno_user_exit':
satch.c:(.text+0x27e): undefined reference to `pthread_cancel'
satch.c:(.text+0x292): undefined reference to `pthread_join'
satch.c:(.text+0x2b2): undefined reference to `timer_delete'
satch.c:(.text+0x2d2): undefined reference to `mq_close'
/tmp/ccQTzItL.o: In function `__xeno_user_init':
satch.c:(.text+0x32c): undefined reference to `shm_open'
satch.c:(.text+0x34c): undefined reference to `xnprintf'
satch.c:(.text+0x380): undefined reference to `xnprintf'
satch.c:(.text+0x3cc): undefined reference to `mq_open'
satch.c:(.text+0x400): undefined reference to `xnprintf'
satch.c:(.text+0x418): undefined reference to `xnprintf'
satch.c:(.text+0x46a): undefined reference to `xnprintf'
satch.c:(.text+0x498): undefined reference to `timer_create'
satch.c:(.text+0x4b4): undefined reference to `xnprintf'
satch.c:(.text+0x4c4): undefined reference to `pthread_attr_setstacksize'
satch.c:(.text+0x4f8): undefined reference to `pthread_create'
satch.c:(.text+0x50e): undefined reference to `xnprintf'
satch.c:(.text+0x532): undefined reference to `xnprintf'
satch.c:(.text+0x584): undefined reference to `xnprintf'
/tmp/ccQTzItL.o: In function `main':
satch.c:(.text+0x60a): undefined reference to `pthread_sigmask'
satch.c:(.text+0x638): undefined reference to `xnprintf'
collect2: ld returned 1 exit status
make[1]: *** [satch] Error 1
make[1]: Leaving directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/posix'
make[1]: Entering directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/common'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/common'
stefan@stefan-VirtualBox:~/roosenXenomaiBone/xenomai-2.6.1/examples$

To me it seems that the XENO parameter is ignored altogether (same for 
the KSRC it seems) which results in the particular included .h files not 
being found on the path. Do I have any options rather than compiling 
manually?

Thanks!

-- Stefan


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] Compiling the Xenomai examples
  2012-11-01 15:42 [Xenomai] Compiling the Xenomai examples Stefan Videv
@ 2012-11-01 16:32 ` Gilles Chanteperdrix
  2012-11-01 16:39   ` Stefan Videv
  2012-11-01 17:00   ` Stefan Videv
  0 siblings, 2 replies; 18+ messages in thread
From: Gilles Chanteperdrix @ 2012-11-01 16:32 UTC (permalink / raw)
  To: Stefan Videv; +Cc: xenomai


Stefan Videv wrote:
> Hi All,
>
> I've been following this:
>
> http://www.xenomai.org/index.php/Examples
>
> on how to cross-compile the examples that come with Xenomai.
>
> However, running:
>
> make XENO=/media/rootfs/usr/xenomai/ ARCH=arm-linux-gnueabi-
> KSRC=/media/rootfs/usr/include
>
> where /media/rootfs/usr/xenomai is where xenomai is installed on the SD
> card that "powers" my embedded system, arm-linux-gnueabi- is the cross
> compiler chain I have running on my virtual box, and finally
> /media/rootfs/usr/include is where I installed the header files for the
> kernel that is running on my embedded board.
>
> To me it seems that the XENO parameter is ignored altogether (same for
> the KSRC it seems) which results in the particular included .h files not
> being found on the path. Do I have any options rather than compiling
> manually?

The problem is that you are cross-compiling, the instructions apply to
native compilation. The XENO parameter is not ignored, but as explained on
the page you linked its role is to locate the xeno-config script. But in
order for this script to produce the correct flags (and as explained if you
read xeno-config help) the DESTDIR environment variable needs to be set (to
/media/rootfs if I understand correctly).

Anyway, the examples are examples, to show you how to use Xenomai API and
compile programs for Xenomai, so, you are supposed to read their Makefiles
and understand how they work in order to adapt them to your particular
programs. Running these programs on your target will not bring you much.
Running the testsuite and the xeno-test script should be more useful.



-- 
                    Gilles.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] Compiling the Xenomai examples
  2012-11-01 16:32 ` Gilles Chanteperdrix
@ 2012-11-01 16:39   ` Stefan Videv
  2012-11-01 17:00   ` Stefan Videv
  1 sibling, 0 replies; 18+ messages in thread
From: Stefan Videv @ 2012-11-01 16:39 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai



On 11/01/2012 04:32 PM, Gilles Chanteperdrix wrote:
> Stefan Videv wrote:
>> Hi All,
>>
>> I've been following this:
>>
>> http://www.xenomai.org/index.php/Examples
>>
>> on how to cross-compile the examples that come with Xenomai.
>>
>> However, running:
>>
>> make XENO=/media/rootfs/usr/xenomai/ ARCH=arm-linux-gnueabi-
>> KSRC=/media/rootfs/usr/include
>>
>> where /media/rootfs/usr/xenomai is where xenomai is installed on the SD
>> card that "powers" my embedded system, arm-linux-gnueabi- is the cross
>> compiler chain I have running on my virtual box, and finally
>> /media/rootfs/usr/include is where I installed the header files for the
>> kernel that is running on my embedded board.
>>
>> To me it seems that the XENO parameter is ignored altogether (same for
>> the KSRC it seems) which results in the particular included .h files not
>> being found on the path. Do I have any options rather than compiling
>> manually?
> The problem is that you are cross-compiling, the instructions apply to
> native compilation. The XENO parameter is not ignored, but as explained on
> the page you linked its role is to locate the xeno-config script. But in
> order for this script to produce the correct flags (and as explained if you
> read xeno-config help) the DESTDIR environment variable needs to be set (to
> /media/rootfs if I understand correctly).
I suspected as much, but was not sure exactly what I should set DESTDIR 
to. Thanks!

>
> Anyway, the examples are examples, to show you how to use Xenomai API and
> compile programs for Xenomai, so, you are supposed to read their Makefiles
> and understand how they work in order to adapt them to your particular
> programs. Running these programs on your target will not bring you much.
> Running the testsuite and the xeno-test script should be more useful.
>
>
>
I am trying to compile the examples in order to figure out exactly how I 
should compile the little Xenomai RTDM module I've just written.

-- Stefan



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] Compiling the Xenomai examples
  2012-11-01 16:32 ` Gilles Chanteperdrix
  2012-11-01 16:39   ` Stefan Videv
@ 2012-11-01 17:00   ` Stefan Videv
  2012-11-01 17:03     ` Gilles Chanteperdrix
  1 sibling, 1 reply; 18+ messages in thread
From: Stefan Videv @ 2012-11-01 17:00 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

On 11/01/2012 04:32 PM, Gilles Chanteperdrix wrote:
> Stefan Videv wrote:
>> Hi All,
>>
>> I've been following this:
>>
>> http://www.xenomai.org/index.php/Examples
>>
>> on how to cross-compile the examples that come with Xenomai.
>>
>> However, running:
>>
>> make XENO=/media/rootfs/usr/xenomai/ ARCH=arm-linux-gnueabi-
>> KSRC=/media/rootfs/usr/include
>>
>> where /media/rootfs/usr/xenomai is where xenomai is installed on the SD
>> card that "powers" my embedded system, arm-linux-gnueabi- is the cross
>> compiler chain I have running on my virtual box, and finally
>> /media/rootfs/usr/include is where I installed the header files for the
>> kernel that is running on my embedded board.
>>
>> To me it seems that the XENO parameter is ignored altogether (same for
>> the KSRC it seems) which results in the particular included .h files not
>> being found on the path. Do I have any options rather than compiling
>> manually?
> The problem is that you are cross-compiling, the instructions apply to
> native compilation. The XENO parameter is not ignored, but as explained on
> the page you linked its role is to locate the xeno-config script. But in
> order for this script to produce the correct flags (and as explained if you
> read xeno-config help) the DESTDIR environment variable needs to be set (to
> /media/rootfs if I understand correctly).
After a quick attempt, things are looking better with DESTDIR. However, 
it still gives errors:

arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE 
-D_REENTRANT -D__XENO__   -lnative -L/media/rootfs/usr/xenomai/lib 
-lxenomai -lpthread -lrt  -Xlinker -rpath -Xlinker 
/media/rootfs/usr/xenomai/lib  trivial-periodic.c   -o trivial-periodic
/tmp/ccZ8pOKK.o: In function `demo':
trivial-periodic.c:(.text+0x1e): undefined reference to 
`rt_task_set_periodic'
trivial-periodic.c:(.text+0x22): undefined reference to `rt_timer_read'
trivial-periodic.c:(.text+0x2e): undefined reference to 
`rt_task_wait_period'
trivial-periodic.c:(.text+0x32): undefined reference to `rt_timer_read'
/tmp/ccZ8pOKK.o: In function `main':
trivial-periodic.c:(.text+0x10c): undefined reference to `rt_task_create'
trivial-periodic.c:(.text+0x124): undefined reference to `rt_task_start'
trivial-periodic.c:(.text+0x134): undefined reference to `rt_task_delete'
collect2: ld returned 1 exit status
make[1]: *** [trivial-periodic] Error 1
make[1]: Leaving directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/native'

However, if the above command is modified to look like this:

arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE 
-D_REENTRANT -D__XENO__   -lnative -L/media/rootfs/usr/xenomai/lib 
-lxenomai -lpthread -lrt  -Xlinker -rpath -Xlinker 
/media/rootfs/usr/xenomai/lib  trivial-periodic.c   -o trivial-periodic 
-lnative -lpthread -lxenomai

It works just fine. How can I fix this in the Makefile, or am I still 
doing something wrong?

Thanks!

>
> Anyway, the examples are examples, to show you how to use Xenomai API and
> compile programs for Xenomai, so, you are supposed to read their Makefiles
> and understand how they work in order to adapt them to your particular
> programs. Running these programs on your target will not bring you much.
> Running the testsuite and the xeno-test script should be more useful.
>
>
>



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] Compiling the Xenomai examples
  2012-11-01 17:00   ` Stefan Videv
@ 2012-11-01 17:03     ` Gilles Chanteperdrix
  0 siblings, 0 replies; 18+ messages in thread
From: Gilles Chanteperdrix @ 2012-11-01 17:03 UTC (permalink / raw)
  To: Stefan Videv; +Cc: xenomai


Stefan Videv wrote:
> On 11/01/2012 04:32 PM, Gilles Chanteperdrix wrote:
>> Stefan Videv wrote:
>>> Hi All,
>>>
>>> I've been following this:
>>>
>>> http://www.xenomai.org/index.php/Examples
>>>
>>> on how to cross-compile the examples that come with Xenomai.
>>>
>>> However, running:
>>>
>>> make XENO=/media/rootfs/usr/xenomai/ ARCH=arm-linux-gnueabi-
>>> KSRC=/media/rootfs/usr/include
>>>
>>> where /media/rootfs/usr/xenomai is where xenomai is installed on the SD
>>> card that "powers" my embedded system, arm-linux-gnueabi- is the cross
>>> compiler chain I have running on my virtual box, and finally
>>> /media/rootfs/usr/include is where I installed the header files for the
>>> kernel that is running on my embedded board.
>>>
>>> To me it seems that the XENO parameter is ignored altogether (same for
>>> the KSRC it seems) which results in the particular included .h files
>>> not
>>> being found on the path. Do I have any options rather than compiling
>>> manually?
>> The problem is that you are cross-compiling, the instructions apply to
>> native compilation. The XENO parameter is not ignored, but as explained
>> on
>> the page you linked its role is to locate the xeno-config script. But in
>> order for this script to produce the correct flags (and as explained if
>> you
>> read xeno-config help) the DESTDIR environment variable needs to be set
>> (to
>> /media/rootfs if I understand correctly).
> After a quick attempt, things are looking better with DESTDIR. However,
> it still gives errors:
>
> arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE
> -D_REENTRANT -D__XENO__   -lnative -L/media/rootfs/usr/xenomai/lib
> -lxenomai -lpthread -lrt  -Xlinker -rpath -Xlinker
> /media/rootfs/usr/xenomai/lib  trivial-periodic.c   -o trivial-periodic
> /tmp/ccZ8pOKK.o: In function `demo':
> trivial-periodic.c:(.text+0x1e): undefined reference to
> `rt_task_set_periodic'
> trivial-periodic.c:(.text+0x22): undefined reference to `rt_timer_read'
> trivial-periodic.c:(.text+0x2e): undefined reference to
> `rt_task_wait_period'
> trivial-periodic.c:(.text+0x32): undefined reference to `rt_timer_read'
> /tmp/ccZ8pOKK.o: In function `main':
> trivial-periodic.c:(.text+0x10c): undefined reference to `rt_task_create'
> trivial-periodic.c:(.text+0x124): undefined reference to `rt_task_start'
> trivial-periodic.c:(.text+0x134): undefined reference to `rt_task_delete'
> collect2: ld returned 1 exit status
> make[1]: *** [trivial-periodic] Error 1
> make[1]: Leaving directory
> `/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/native'
>
> However, if the above command is modified to look like this:
>
> arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE
> -D_REENTRANT -D__XENO__   -lnative -L/media/rootfs/usr/xenomai/lib
> -lxenomai -lpthread -lrt  -Xlinker -rpath -Xlinker
> /media/rootfs/usr/xenomai/lib  trivial-periodic.c   -o trivial-periodic
> -lnative -lpthread -lxenomai
>
> It works just fine. How can I fix this in the Makefile, or am I still
> doing something wrong?

This has been reported several times. I proposed a patch in the following
mail:
http://www.xenomai.org/pipermail/xenomai/2012-October/026561.html
But since nobody reported whether it fixes anything, it is not merged yet.


-- 
                    Gilles.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] Compiling the Xenomai examples
@ 2012-11-01 17:04 Gilles Chanteperdrix
  2012-11-01 17:17 ` Stefan Videv
  2012-11-01 17:30 ` Stefan Videv
  0 siblings, 2 replies; 18+ messages in thread
From: Gilles Chanteperdrix @ 2012-11-01 17:04 UTC (permalink / raw)
  To: Stefan Videv; +Cc: xenomai



Stefan Videv wrote:
> On 11/01/2012 04:32 PM, Gilles Chanteperdrix wrote:
>> Stefan Videv wrote:
>>> Hi All,
>>>
>>> I've been following this:
>>>
>>> http://www.xenomai.org/index.php/Examples
>>>
>>> on how to cross-compile the examples that come with Xenomai.
>>>
>>> However, running:
>>>
>>> make XENO=/media/rootfs/usr/xenomai/ ARCH=arm-linux-gnueabi-
>>> KSRC=/media/rootfs/usr/include
>>>
>>> where /media/rootfs/usr/xenomai is where xenomai is installed on the
SD card that "powers" my embedded system, arm-linux-gnueabi- is the
cross compiler chain I have running on my virtual box, and finally
>>> /media/rootfs/usr/include is where I installed the header files for
the kernel that is running on my embedded board.
>>>
>>> To me it seems that the XENO parameter is ignored altogether (same for
the KSRC it seems) which results in the particular included .h files
not
>>> being found on the path. Do I have any options rather than compiling
manually?
>> The problem is that you are cross-compiling, the instructions apply to
native compilation. The XENO parameter is not ignored, but as explained
on
>> the page you linked its role is to locate the xeno-config script. But
in order for this script to produce the correct flags (and as explained
if you
>> read xeno-config help) the DESTDIR environment variable needs to be set
(to
>> /media/rootfs if I understand correctly).
> After a quick attempt, things are looking better with DESTDIR. However,
it still gives errors:
>
> arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE
-D_REENTRANT -D__XENO__   -lnative -L/media/rootfs/usr/xenomai/lib
-lxenomai -lpthread -lrt  -Xlinker -rpath -Xlinker
> /media/rootfs/usr/xenomai/lib  trivial-periodic.c   -o trivial-periodic
/tmp/ccZ8pOKK.o: In function `demo':
> trivial-periodic.c:(.text+0x1e): undefined reference to
> `rt_task_set_periodic'
> trivial-periodic.c:(.text+0x22): undefined reference to `rt_timer_read'
trivial-periodic.c:(.text+0x2e): undefined reference to
> `rt_task_wait_period'
> trivial-periodic.c:(.text+0x32): undefined reference to `rt_timer_read'
/tmp/ccZ8pOKK.o: In function `main':
> trivial-periodic.c:(.text+0x10c): undefined reference to
`rt_task_create' trivial-periodic.c:(.text+0x124): undefined reference
to `rt_task_start' trivial-periodic.c:(.text+0x134): undefined reference
to `rt_task_delete' collect2: ld returned 1 exit status
> make[1]: *** [trivial-periodic] Error 1
> make[1]: Leaving directory
> `/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/native'
>
> However, if the above command is modified to look like this:
>
> arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE
-D_REENTRANT -D__XENO__   -lnative -L/media/rootfs/usr/xenomai/lib
-lxenomai -lpthread -lrt  -Xlinker -rpath -Xlinker
> /media/rootfs/usr/xenomai/lib  trivial-periodic.c   -o trivial-periodic
-lnative -lpthread -lxenomai
>
> It works just fine. How can I fix this in the Makefile, or am I still
doing something wrong?

This has been reported several times. I proposed a patch in the following
mail:
http://www.xenomai.org/pipermail/xenomai/2012-October/026561.html
But since nobody reported whether it fixes anything, it is not merged yet.


-- 
                    Gilles.



-- 
                    Gilles.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] Compiling the Xenomai examples
  2012-11-01 17:04 Gilles Chanteperdrix
@ 2012-11-01 17:17 ` Stefan Videv
  2012-11-01 18:25   ` Gilles Chanteperdrix
  2012-11-01 17:30 ` Stefan Videv
  1 sibling, 1 reply; 18+ messages in thread
From: Stefan Videv @ 2012-11-01 17:17 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

On 11/01/2012 05:04 PM, Gilles Chanteperdrix wrote:
>
> Stefan Videv wrote:
>> On 11/01/2012 04:32 PM, Gilles Chanteperdrix wrote:
>>> Stefan Videv wrote:
>>>> Hi All,
>>>>
>>>> I've been following this:
>>>>
>>>> http://www.xenomai.org/index.php/Examples
>>>>
>>>> on how to cross-compile the examples that come with Xenomai.
>>>>
>>>> However, running:
>>>>
>>>> make XENO=/media/rootfs/usr/xenomai/ ARCH=arm-linux-gnueabi-
>>>> KSRC=/media/rootfs/usr/include
>>>>
>>>> where /media/rootfs/usr/xenomai is where xenomai is installed on the
> SD card that "powers" my embedded system, arm-linux-gnueabi- is the
> cross compiler chain I have running on my virtual box, and finally
>>>> /media/rootfs/usr/include is where I installed the header files for
> the kernel that is running on my embedded board.
>>>> To me it seems that the XENO parameter is ignored altogether (same for
> the KSRC it seems) which results in the particular included .h files
> not
>>>> being found on the path. Do I have any options rather than compiling
> manually?
>>> The problem is that you are cross-compiling, the instructions apply to
> native compilation. The XENO parameter is not ignored, but as explained
> on
>>> the page you linked its role is to locate the xeno-config script. But
> in order for this script to produce the correct flags (and as explained
> if you
>>> read xeno-config help) the DESTDIR environment variable needs to be set
> (to
>>> /media/rootfs if I understand correctly).
>> After a quick attempt, things are looking better with DESTDIR. However,
> it still gives errors:
>> arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE
> -D_REENTRANT -D__XENO__   -lnative -L/media/rootfs/usr/xenomai/lib
> -lxenomai -lpthread -lrt  -Xlinker -rpath -Xlinker
>> /media/rootfs/usr/xenomai/lib  trivial-periodic.c   -o trivial-periodic
> /tmp/ccZ8pOKK.o: In function `demo':
>> trivial-periodic.c:(.text+0x1e): undefined reference to
>> `rt_task_set_periodic'
>> trivial-periodic.c:(.text+0x22): undefined reference to `rt_timer_read'
> trivial-periodic.c:(.text+0x2e): undefined reference to
>> `rt_task_wait_period'
>> trivial-periodic.c:(.text+0x32): undefined reference to `rt_timer_read'
> /tmp/ccZ8pOKK.o: In function `main':
>> trivial-periodic.c:(.text+0x10c): undefined reference to
> `rt_task_create' trivial-periodic.c:(.text+0x124): undefined reference
> to `rt_task_start' trivial-periodic.c:(.text+0x134): undefined reference
> to `rt_task_delete' collect2: ld returned 1 exit status
>> make[1]: *** [trivial-periodic] Error 1
>> make[1]: Leaving directory
>> `/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/native'
>>
>> However, if the above command is modified to look like this:
>>
>> arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE
> -D_REENTRANT -D__XENO__   -lnative -L/media/rootfs/usr/xenomai/lib
> -lxenomai -lpthread -lrt  -Xlinker -rpath -Xlinker
>> /media/rootfs/usr/xenomai/lib  trivial-periodic.c   -o trivial-periodic
> -lnative -lpthread -lxenomai
>> It works just fine. How can I fix this in the Makefile, or am I still
> doing something wrong?
>
> This has been reported several times. I proposed a patch in the following
> mail:
> http://www.xenomai.org/pipermail/xenomai/2012-October/026561.html
> But since nobody reported whether it fixes anything, it is not merged yet.
>
>
Yes this fixes the compilation for the examples in the native folder 
(kind of obvious since the patch fixes that particular make file). 
Should I go ahead and replicate the fix over the other make files?

-- Stefan


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] Compiling the Xenomai examples
  2012-11-01 17:04 Gilles Chanteperdrix
  2012-11-01 17:17 ` Stefan Videv
@ 2012-11-01 17:30 ` Stefan Videv
  1 sibling, 0 replies; 18+ messages in thread
From: Stefan Videv @ 2012-11-01 17:30 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

On 11/01/2012 05:04 PM, Gilles Chanteperdrix wrote:
>
> Stefan Videv wrote:
>> On 11/01/2012 04:32 PM, Gilles Chanteperdrix wrote:
>>> Stefan Videv wrote:
>>>> Hi All,
>>>>
>>>> I've been following this:
>>>>
>>>> http://www.xenomai.org/index.php/Examples
>>>>
>>>> on how to cross-compile the examples that come with Xenomai.
>>>>
>>>> However, running:
>>>>
>>>> make XENO=/media/rootfs/usr/xenomai/ ARCH=arm-linux-gnueabi-
>>>> KSRC=/media/rootfs/usr/include
>>>>
>>>> where /media/rootfs/usr/xenomai is where xenomai is installed on the
> SD card that "powers" my embedded system, arm-linux-gnueabi- is the
> cross compiler chain I have running on my virtual box, and finally
>>>> /media/rootfs/usr/include is where I installed the header files for
> the kernel that is running on my embedded board.
>>>> To me it seems that the XENO parameter is ignored altogether (same for
> the KSRC it seems) which results in the particular included .h files
> not
>>>> being found on the path. Do I have any options rather than compiling
> manually?
>>> The problem is that you are cross-compiling, the instructions apply to
> native compilation. The XENO parameter is not ignored, but as explained
> on
>>> the page you linked its role is to locate the xeno-config script. But
> in order for this script to produce the correct flags (and as explained
> if you
>>> read xeno-config help) the DESTDIR environment variable needs to be set
> (to
>>> /media/rootfs if I understand correctly).
>> After a quick attempt, things are looking better with DESTDIR. However,
> it still gives errors:
>> arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE
> -D_REENTRANT -D__XENO__   -lnative -L/media/rootfs/usr/xenomai/lib
> -lxenomai -lpthread -lrt  -Xlinker -rpath -Xlinker
>> /media/rootfs/usr/xenomai/lib  trivial-periodic.c   -o trivial-periodic
> /tmp/ccZ8pOKK.o: In function `demo':
>> trivial-periodic.c:(.text+0x1e): undefined reference to
>> `rt_task_set_periodic'
>> trivial-periodic.c:(.text+0x22): undefined reference to `rt_timer_read'
> trivial-periodic.c:(.text+0x2e): undefined reference to
>> `rt_task_wait_period'
>> trivial-periodic.c:(.text+0x32): undefined reference to `rt_timer_read'
> /tmp/ccZ8pOKK.o: In function `main':
>> trivial-periodic.c:(.text+0x10c): undefined reference to
> `rt_task_create' trivial-periodic.c:(.text+0x124): undefined reference
> to `rt_task_start' trivial-periodic.c:(.text+0x134): undefined reference
> to `rt_task_delete' collect2: ld returned 1 exit status
>> make[1]: *** [trivial-periodic] Error 1
>> make[1]: Leaving directory
>> `/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/native'
>>
>> However, if the above command is modified to look like this:
>>
>> arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE
> -D_REENTRANT -D__XENO__   -lnative -L/media/rootfs/usr/xenomai/lib
> -lxenomai -lpthread -lrt  -Xlinker -rpath -Xlinker
>> /media/rootfs/usr/xenomai/lib  trivial-periodic.c   -o trivial-periodic
> -lnative -lpthread -lxenomai
>> It works just fine. How can I fix this in the Makefile, or am I still
> doing something wrong?
>
> This has been reported several times. I proposed a patch in the following
> mail:
> http://www.xenomai.org/pipermail/xenomai/2012-October/026561.html
> But since nobody reported whether it fixes anything, it is not merged yet.
>
>
Just to illustrate my last email, the rest of the compilation produces this:

make[1]: Entering directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/native'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/native'
make[1]: Entering directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/rtdm/profiles/can'
arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE 
-D_REENTRANT -D__XENO__ -I/media/rootfs/usr/xenomai/include/posix  
-I/usr/arm-linux-gnueabi/include  
-Wl,@/media/rootfs/usr/xenomai/lib/posix.wrappers 
-L/media/rootfs/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt   
-L/usr/arm-linux-gnueabi/lib -lrtdm  -Xlinker -rpath -Xlinker 
/media/rootfs/usr/xenomai/lib  rtcan_rtt.c   -o rtcan_rtt
/usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: 
/tmp/cc3mnvp0.o: undefined reference to symbol 'pthread_join@@GLIBC_2.4'
/usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: 
note: 'pthread_join@@GLIBC_2.4' is defined in DSO 
/usr/arm-linux-gnueabi/lib/libpthread.so.0 so try adding it to the 
linker command line
/usr/arm-linux-gnueabi/lib/libpthread.so.0: could not read symbols: 
Invalid operation
collect2: ld returned 1 exit status
make[1]: *** [rtcan_rtt] Error 1
make[1]: Leaving directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/rtdm/profiles/can'
make[1]: Entering directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/rtdm/profiles/ipc'
arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE 
-D_REENTRANT -D__XENO__ -I/media/rootfs/usr/xenomai/include/posix   
-Wl,@/media/rootfs/usr/xenomai/lib/posix.wrappers 
-L/media/rootfs/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt   
-lrtdm -Xlinker -rpath -Xlinker /media/rootfs/usr/xenomai/lib  
xddp-echo.c   -o xddp-echo
/usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: 
/tmp/ccR4Aszs.o: undefined reference to symbol 'pthread_join@@GLIBC_2.4'
/usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: 
note: 'pthread_join@@GLIBC_2.4' is defined in DSO 
/usr/arm-linux-gnueabi/lib/libpthread.so.0 so try adding it to the 
linker command line
/usr/arm-linux-gnueabi/lib/libpthread.so.0: could not read symbols: 
Invalid operation
collect2: ld returned 1 exit status
make[1]: *** [xddp-echo] Error 1
make[1]: Leaving directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/rtdm/profiles/ipc'
make[1]: Entering directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/rtdm/profiles/serial'
arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE 
-D_REENTRANT -D__XENO__   -lnative -L/media/rootfs/usr/xenomai/lib 
-lxenomai -lpthread -lrt  -lrtdm -Xlinker -rpath -Xlinker 
/media/rootfs/usr/xenomai/lib  cross-link.c   -o cross-link
/tmp/ccEmQmfT.o: In function `close_file':
cross-link.c:(.text+0x1a): undefined reference to `rt_dev_close'
cross-link.c:(.text+0x46): undefined reference to `rt_task_sleep'
/tmp/ccEmQmfT.o: In function `cleanup_all':
cross-link.c:(.text+0x15a): undefined reference to `rt_task_delete'
cross-link.c:(.text+0x19c): undefined reference to `rt_task_delete'
/tmp/ccEmQmfT.o: In function `write_task_proc':
cross-link.c:(.text+0x200): undefined reference to `rt_timer_ns2ticks'
cross-link.c:(.text+0x218): undefined reference to `rt_task_set_periodic'
cross-link.c:(.text+0x24a): undefined reference to `rt_task_wait_period'
cross-link.c:(.text+0x276): undefined reference to `rt_timer_read'
cross-link.c:(.text+0x298): undefined reference to `rt_dev_write'
/tmp/ccEmQmfT.o: In function `read_task_proc':
cross-link.c:(.text+0x3b2): undefined reference to `rt_dev_ioctl'
cross-link.c:(.text+0x404): undefined reference to `rt_dev_read'
cross-link.c:(.text+0x412): undefined reference to `rt_timer_read'
/tmp/ccEmQmfT.o: In function `main':
cross-link.c:(.text+0x550): undefined reference to `rt_dev_open'
cross-link.c:(.text+0x5de): undefined reference to `rt_dev_ioctl'
cross-link.c:(.text+0x622): undefined reference to `rt_dev_open'
cross-link.c:(.text+0x6b0): undefined reference to `rt_dev_ioctl'
cross-link.c:(.text+0x706): undefined reference to `rt_task_create'
cross-link.c:(.text+0x774): undefined reference to `rt_task_create'
cross-link.c:(.text+0x7e4): undefined reference to `rt_task_start'
cross-link.c:(.text+0x830): undefined reference to `rt_task_start'
collect2: ld returned 1 exit status
make[1]: *** [cross-link] Error 1
make[1]: Leaving directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/rtdm/profiles/serial'
sed: can't read /media/rootfs/usr/include/Makefile: No such file or 
directory
make[1]: Entering directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/rtdm/driver-api'
arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE 
-D_REENTRANT -D__XENO__   -lnative -L/media/rootfs/usr/xenomai/lib 
-lxenomai -lpthread -lrt  -lrtdm -Xlinker -rpath -Xlinker 
/media/rootfs/usr/xenomai/lib  tut01-skeleton-app.c   -o tut01-skeleton-app
/tmp/ccUJnMmo.o: In function `main':
tut01-skeleton-app.c:(.text+0x30): undefined reference to `rt_dev_open'
tut01-skeleton-app.c:(.text+0x96): undefined reference to `rt_dev_read'
tut01-skeleton-app.c:(.text+0xee): undefined reference to `rt_dev_write'
tut01-skeleton-app.c:(.text+0x124): undefined reference to `rt_dev_read'
tut01-skeleton-app.c:(.text+0x158): undefined reference to `rt_dev_read'
tut01-skeleton-app.c:(.text+0x184): undefined reference to `rt_dev_close'
collect2: ld returned 1 exit status
make[1]: *** [tut01-skeleton-app] Error 1
make[1]: Leaving directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/rtdm/driver-api'
sed: can't read /media/rootfs/usr/include/Makefile: No such file or 
directory
make[1]: Entering directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/posix'
arm-linux-gnueabi-gcc -DCONSUMER -I/media/rootfs/usr/xenomai/include 
-D_GNU_SOURCE -D_REENTRANT -D__XENO__ 
-I/media/rootfs/usr/xenomai/include/posix   
-Wl,@/media/rootfs/usr/xenomai/lib/posix.wrappers 
-L/media/rootfs/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt   
-Xlinker -rpath -Xlinker /media/rootfs/usr/xenomai/lib  satch.c   -o satch
/usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: 
/tmp/ccjJ80DW.o: undefined reference to symbol 'pthread_join@@GLIBC_2.4'
/usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: 
note: 'pthread_join@@GLIBC_2.4' is defined in DSO 
/usr/arm-linux-gnueabi/lib/libpthread.so.0 so try adding it to the 
linker command line
/usr/arm-linux-gnueabi/lib/libpthread.so.0: could not read symbols: 
Invalid operation
collect2: ld returned 1 exit status
make[1]: *** [satch] Error 1
make[1]: Leaving directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/posix'
make[1]: Entering directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/common'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory 
`/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/common'



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] Compiling the Xenomai examples
  2012-11-01 17:17 ` Stefan Videv
@ 2012-11-01 18:25   ` Gilles Chanteperdrix
  2012-11-02 16:48     ` Stefan Videv
  0 siblings, 1 reply; 18+ messages in thread
From: Gilles Chanteperdrix @ 2012-11-01 18:25 UTC (permalink / raw)
  To: Stefan Videv; +Cc: xenomai


Stefan Videv wrote:
> On 11/01/2012 05:04 PM, Gilles Chanteperdrix wrote:
>>
>> Stefan Videv wrote:
>>> On 11/01/2012 04:32 PM, Gilles Chanteperdrix wrote:
>>>> Stefan Videv wrote:
>>>>> Hi All,
>>>>>
>>>>> I've been following this:
>>>>>
>>>>> http://www.xenomai.org/index.php/Examples
>>>>>
>>>>> on how to cross-compile the examples that come with Xenomai.
>>>>>
>>>>> However, running:
>>>>>
>>>>> make XENO=/media/rootfs/usr/xenomai/ ARCH=arm-linux-gnueabi-
>>>>> KSRC=/media/rootfs/usr/include
>>>>>
>>>>> where /media/rootfs/usr/xenomai is where xenomai is installed on the
>> SD card that "powers" my embedded system, arm-linux-gnueabi- is the
>> cross compiler chain I have running on my virtual box, and finally
>>>>> /media/rootfs/usr/include is where I installed the header files for
>> the kernel that is running on my embedded board.
>>>>> To me it seems that the XENO parameter is ignored altogether (same
>>>>> for
>> the KSRC it seems) which results in the particular included .h files
>> not
>>>>> being found on the path. Do I have any options rather than compiling
>> manually?
>>>> The problem is that you are cross-compiling, the instructions apply to
>> native compilation. The XENO parameter is not ignored, but as explained
>> on
>>>> the page you linked its role is to locate the xeno-config script. But
>> in order for this script to produce the correct flags (and as explained
>> if you
>>>> read xeno-config help) the DESTDIR environment variable needs to be
>>>> set
>> (to
>>>> /media/rootfs if I understand correctly).
>>> After a quick attempt, things are looking better with DESTDIR. However,
>> it still gives errors:
>>> arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE
>> -D_REENTRANT -D__XENO__   -lnative -L/media/rootfs/usr/xenomai/lib
>> -lxenomai -lpthread -lrt  -Xlinker -rpath -Xlinker
>>> /media/rootfs/usr/xenomai/lib  trivial-periodic.c   -o trivial-periodic
>> /tmp/ccZ8pOKK.o: In function `demo':
>>> trivial-periodic.c:(.text+0x1e): undefined reference to
>>> `rt_task_set_periodic'
>>> trivial-periodic.c:(.text+0x22): undefined reference to `rt_timer_read'
>> trivial-periodic.c:(.text+0x2e): undefined reference to
>>> `rt_task_wait_period'
>>> trivial-periodic.c:(.text+0x32): undefined reference to `rt_timer_read'
>> /tmp/ccZ8pOKK.o: In function `main':
>>> trivial-periodic.c:(.text+0x10c): undefined reference to
>> `rt_task_create' trivial-periodic.c:(.text+0x124): undefined reference
>> to `rt_task_start' trivial-periodic.c:(.text+0x134): undefined reference
>> to `rt_task_delete' collect2: ld returned 1 exit status
>>> make[1]: *** [trivial-periodic] Error 1
>>> make[1]: Leaving directory
>>> `/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/native'
>>>
>>> However, if the above command is modified to look like this:
>>>
>>> arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE
>> -D_REENTRANT -D__XENO__   -lnative -L/media/rootfs/usr/xenomai/lib
>> -lxenomai -lpthread -lrt  -Xlinker -rpath -Xlinker
>>> /media/rootfs/usr/xenomai/lib  trivial-periodic.c   -o trivial-periodic
>> -lnative -lpthread -lxenomai
>>> It works just fine. How can I fix this in the Makefile, or am I still
>> doing something wrong?
>>
>> This has been reported several times. I proposed a patch in the
>> following
>> mail:
>> http://www.xenomai.org/pipermail/xenomai/2012-October/026561.html
>> But since nobody reported whether it fixes anything, it is not merged
>> yet.
>>
>>
> Yes this fixes the compilation for the examples in the native folder
> (kind of obvious since the patch fixes that particular make file).
> Should I go ahead and replicate the fix over the other make files?

Yes, and please tell us if you get the compilation working.

-- 
                    Gilles.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] Compiling the Xenomai examples
  2012-11-01 18:25   ` Gilles Chanteperdrix
@ 2012-11-02 16:48     ` Stefan Videv
  2012-11-02 17:13       ` Gilles Chanteperdrix
  0 siblings, 1 reply; 18+ messages in thread
From: Stefan Videv @ 2012-11-02 16:48 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

On 11/01/2012 06:25 PM, Gilles Chanteperdrix wrote:
> Stefan Videv wrote:
>> On 11/01/2012 05:04 PM, Gilles Chanteperdrix wrote:
>>> Stefan Videv wrote:
>>>> On 11/01/2012 04:32 PM, Gilles Chanteperdrix wrote:
>>>>> Stefan Videv wrote:
>>>>>> Hi All,
>>>>>>
>>>>>> I've been following this:
>>>>>>
>>>>>> http://www.xenomai.org/index.php/Examples
>>>>>>
>>>>>> on how to cross-compile the examples that come with Xenomai.
>>>>>>
>>>>>> However, running:
>>>>>>
>>>>>> make XENO=/media/rootfs/usr/xenomai/ ARCH=arm-linux-gnueabi-
>>>>>> KSRC=/media/rootfs/usr/include
>>>>>>
>>>>>> where /media/rootfs/usr/xenomai is where xenomai is installed on the
>>> SD card that "powers" my embedded system, arm-linux-gnueabi- is the
>>> cross compiler chain I have running on my virtual box, and finally
>>>>>> /media/rootfs/usr/include is where I installed the header files for
>>> the kernel that is running on my embedded board.
>>>>>> To me it seems that the XENO parameter is ignored altogether (same
>>>>>> for
>>> the KSRC it seems) which results in the particular included .h files
>>> not
>>>>>> being found on the path. Do I have any options rather than compiling
>>> manually?
>>>>> The problem is that you are cross-compiling, the instructions apply to
>>> native compilation. The XENO parameter is not ignored, but as explained
>>> on
>>>>> the page you linked its role is to locate the xeno-config script. But
>>> in order for this script to produce the correct flags (and as explained
>>> if you
>>>>> read xeno-config help) the DESTDIR environment variable needs to be
>>>>> set
>>> (to
>>>>> /media/rootfs if I understand correctly).
>>>> After a quick attempt, things are looking better with DESTDIR. However,
>>> it still gives errors:
>>>> arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE
>>> -D_REENTRANT -D__XENO__   -lnative -L/media/rootfs/usr/xenomai/lib
>>> -lxenomai -lpthread -lrt  -Xlinker -rpath -Xlinker
>>>> /media/rootfs/usr/xenomai/lib  trivial-periodic.c   -o trivial-periodic
>>> /tmp/ccZ8pOKK.o: In function `demo':
>>>> trivial-periodic.c:(.text+0x1e): undefined reference to
>>>> `rt_task_set_periodic'
>>>> trivial-periodic.c:(.text+0x22): undefined reference to `rt_timer_read'
>>> trivial-periodic.c:(.text+0x2e): undefined reference to
>>>> `rt_task_wait_period'
>>>> trivial-periodic.c:(.text+0x32): undefined reference to `rt_timer_read'
>>> /tmp/ccZ8pOKK.o: In function `main':
>>>> trivial-periodic.c:(.text+0x10c): undefined reference to
>>> `rt_task_create' trivial-periodic.c:(.text+0x124): undefined reference
>>> to `rt_task_start' trivial-periodic.c:(.text+0x134): undefined reference
>>> to `rt_task_delete' collect2: ld returned 1 exit status
>>>> make[1]: *** [trivial-periodic] Error 1
>>>> make[1]: Leaving directory
>>>> `/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/native'
>>>>
>>>> However, if the above command is modified to look like this:
>>>>
>>>> arm-linux-gnueabi-gcc -I/media/rootfs/usr/xenomai/include -D_GNU_SOURCE
>>> -D_REENTRANT -D__XENO__   -lnative -L/media/rootfs/usr/xenomai/lib
>>> -lxenomai -lpthread -lrt  -Xlinker -rpath -Xlinker
>>>> /media/rootfs/usr/xenomai/lib  trivial-periodic.c   -o trivial-periodic
>>> -lnative -lpthread -lxenomai
>>>> It works just fine. How can I fix this in the Makefile, or am I still
>>> doing something wrong?
>>>
>>> This has been reported several times. I proposed a patch in the
>>> following
>>> mail:
>>> http://www.xenomai.org/pipermail/xenomai/2012-October/026561.html
>>> But since nobody reported whether it fixes anything, it is not merged
>>> yet.
>>>
>>>
>> Yes this fixes the compilation for the examples in the native folder
>> (kind of obvious since the patch fixes that particular make file).
>> Should I go ahead and replicate the fix over the other make files?
> Yes, and please tell us if you get the compilation working.
>
I've done the changes. However, the kernel modules are still not being made:

make XENO=/media/rootfs/usr/xenomai/ ARCH=arm-linux-gnueabi- 
KSRC=/media/rootfs/usr/include DESTDIR=/media/rootfs
make[1]: Entering directory `/home/stefan/xenomai-2.6.1/examples/native'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/stefan/xenomai-2.6.1/examples/native'
make[1]: Entering directory 
`/home/stefan/xenomai-2.6.1/examples/rtdm/profiles/can'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory 
`/home/stefan/xenomai-2.6.1/examples/rtdm/profiles/can'
make[1]: Entering directory 
`/home/stefan/xenomai-2.6.1/examples/rtdm/profiles/ipc'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory 
`/home/stefan/xenomai-2.6.1/examples/rtdm/profiles/ipc'
make[1]: Entering directory 
`/home/stefan/xenomai-2.6.1/examples/rtdm/profiles/serial'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory 
`/home/stefan/xenomai-2.6.1/examples/rtdm/profiles/serial'
sed: can't read /media/rootfs/usr/include/Makefile: No such file or 
directory
make[1]: Entering directory 
`/home/stefan/xenomai-2.6.1/examples/rtdm/driver-api'
make -C /media/rootfs/usr/include 
SUBDIRS=/home/stefan/xenomai-2.6.1/examples/rtdm/driver-api modules
make[2]: Entering directory `/media/rootfs/usr/include'
make[2]: *** No rule to make target `modules'. Stop.
make[2]: Leaving directory `/media/rootfs/usr/include'
make[1]: *** [all] Error 2
make[1]: Leaving directory 
`/home/stefan/xenomai-2.6.1/examples/rtdm/driver-api'
sed: can't read /media/rootfs/usr/include/Makefile: No such file or 
directory
make[1]: Entering directory `/home/stefan/xenomai-2.6.1/examples/posix'
make -C /media/rootfs/usr/include ARCH=arm-linux-gnueabi- CROSS_COMPILE= 
SUBDIRS=/home/stefan/xenomai-2.6.1/examples/posix modules
make[2]: Entering directory `/media/rootfs/usr/include'
make[2]: *** No rule to make target `modules'. Stop.
make[2]: Leaving directory `/media/rootfs/usr/include'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/stefan/xenomai-2.6.1/examples/posix'
make[1]: Entering directory `/home/stefan/xenomai-2.6.1/examples/common'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/stefan/xenomai-2.6.1/examples/common'

How do we get around that? That's actually what I was hoping to 
understand from this "exercise."

The patch for the Make files is exactly the same one as the one for the 
native examples with the exception for the one for the driver-api, where 
I explicitly added the xenomai library to get it to compile:

LOADLIBES=$(shell $(XENOCONFIG) --skin=native --ldflags) $(MY_LDFLAGS) 
-lrtdm -lxenomai

The common examples compile without the need for the patch (or so it 
seems). Apologies, for not providing a patch file, but I just realized I 
had not checked out the git repository where I made the changes but 
rather it was a direct download from the website.

Thanks!
-- Stefan




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] Compiling the Xenomai examples
  2012-11-02 16:48     ` Stefan Videv
@ 2012-11-02 17:13       ` Gilles Chanteperdrix
  2012-11-02 17:35         ` Stefan Videv
  2012-11-02 17:44         ` Stefan Videv
  0 siblings, 2 replies; 18+ messages in thread
From: Gilles Chanteperdrix @ 2012-11-02 17:13 UTC (permalink / raw)
  To: Stefan Videv; +Cc: xenomai


Stefan Videv wrote:
> make XENO=/media/rootfs/usr/xenomai/ ARCH=arm-linux-gnueabi-
> KSRC=/media/rootfs/usr/include DESTDIR=/media/rootfs

Should be ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi
and KSRC should be the path to the kernel sources.

-- 
                    Gilles.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] Compiling the Xenomai examples
  2012-11-02 17:13       ` Gilles Chanteperdrix
@ 2012-11-02 17:35         ` Stefan Videv
  2012-11-02 17:44         ` Stefan Videv
  1 sibling, 0 replies; 18+ messages in thread
From: Stefan Videv @ 2012-11-02 17:35 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

On 11/02/2012 05:13 PM, Gilles Chanteperdrix wrote:
> Stefan Videv wrote:
>> make XENO=/media/rootfs/usr/xenomai/ ARCH=arm-linux-gnueabi-
>> KSRC=/media/rootfs/usr/include DESTDIR=/media/rootfs
> Should be ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi
> and KSRC should be the path to the kernel sources.
>
That's a good point. When you say kernel sources, do you mean headers or 
sources? It seems the terms are used interchangeably to me, and it's 
quite confusing.

-- Stefan


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] Compiling the Xenomai examples
  2012-11-02 17:13       ` Gilles Chanteperdrix
  2012-11-02 17:35         ` Stefan Videv
@ 2012-11-02 17:44         ` Stefan Videv
  2012-11-02 17:47           ` Gilles Chanteperdrix
  1 sibling, 1 reply; 18+ messages in thread
From: Stefan Videv @ 2012-11-02 17:44 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

On 11/02/2012 05:13 PM, Gilles Chanteperdrix wrote:
> Stefan Videv wrote:
>> make XENO=/media/rootfs/usr/xenomai/ ARCH=arm-linux-gnueabi-
>> KSRC=/media/rootfs/usr/include DESTDIR=/media/rootfs
> Should be ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi
> and KSRC should be the path to the kernel sources.
>
Running the above (with the correction) produces the following:

sed: can't read /media/rootfs/usr/include/Makefile: No such file or 
directory

make -C /media/rootfs/usr/include 
SUBDIRS=/home/stefan/xenomai-2.6.1/examples/rtdm/driver-api modules
make[2]: Entering directory `/media/rootfs/usr/include'
make[2]: *** No rule to make target `modules'. Stop.
make[2]: Leaving directory `/media/rootfs/usr/include'
make[1]: *** [all] Error 2
make[1]: Leaving directory 
`/home/stefan/xenomai-2.6.1/examples/rtdm/driver-api'
sed: can't read /media/rootfs/usr/include/Makefile: No such file or 
directory
make[1]: Entering directory `/home/stefan/xenomai-2.6.1/examples/posix'
make -C /media/rootfs/usr/include ARCH=arm 
CROSS_COMPILE=arm-linux-gnueabi 
SUBDIRS=/home/stefan/roosenXenomaiBone/xenomai-2.6.1/examples/posix modules
make[2]: Entering directory `/media/rootfs/usr/include'
make[2]: *** No rule to make target `modules'. Stop.
make[2]: Leaving directory `/media/rootfs/usr/include'
make[1]: *** [all] Error 2


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] Compiling the Xenomai examples
  2012-11-02 17:44         ` Stefan Videv
@ 2012-11-02 17:47           ` Gilles Chanteperdrix
  2012-11-02 17:58             ` Stefan Videv
  0 siblings, 1 reply; 18+ messages in thread
From: Gilles Chanteperdrix @ 2012-11-02 17:47 UTC (permalink / raw)
  To: Stefan Videv; +Cc: xenomai


Stefan Videv wrote:
> On 11/02/2012 05:13 PM, Gilles Chanteperdrix wrote:
>> Stefan Videv wrote:
>>> make XENO=/media/rootfs/usr/xenomai/ ARCH=arm-linux-gnueabi-
>>> KSRC=/media/rootfs/usr/include DESTDIR=/media/rootfs
>> Should be ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi
>> and KSRC should be the path to the kernel sources.
>>
> Running the above (with the correction) produces the following:
>
> sed: can't read /media/rootfs/usr/include/Makefile: No such file or
> directory

So, obviously /media/rootfs/usr/include is not the path to the kernel
sources. If you are interested in how to compile kernel modules for
Linux, see:

Documentation/kbuild/modules.txt

In the kernel sources.

-- 
                    Gilles.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] Compiling the Xenomai examples
  2012-11-02 17:47           ` Gilles Chanteperdrix
@ 2012-11-02 17:58             ` Stefan Videv
  2012-11-02 18:46               ` Gilles Chanteperdrix
  0 siblings, 1 reply; 18+ messages in thread
From: Stefan Videv @ 2012-11-02 17:58 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

On 11/02/2012 05:47 PM, Gilles Chanteperdrix wrote:
> Stefan Videv wrote:
>> On 11/02/2012 05:13 PM, Gilles Chanteperdrix wrote:
>>> Stefan Videv wrote:
>>>> make XENO=/media/rootfs/usr/xenomai/ ARCH=arm-linux-gnueabi-
>>>> KSRC=/media/rootfs/usr/include DESTDIR=/media/rootfs
>>> Should be ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi
>>> and KSRC should be the path to the kernel sources.
>>>
>> Running the above (with the correction) produces the following:
>>
>> sed: can't read /media/rootfs/usr/include/Makefile: No such file or
>> directory
> So, obviously /media/rootfs/usr/include is not the path to the kernel
> sources. If you are interested in how to compile kernel modules for
> Linux, see:
>
> Documentation/kbuild/modules.txt
>
> In the kernel sources.
>
Thanks. I got it to compile now -- I pointed to the root directory of 
the kernel sources, is that ok? It of course remains to be tested if the 
examples would work at all. Do you want me to let you guys know when I 
test that?

-- Stefan


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] Compiling the Xenomai examples
  2012-11-02 17:58             ` Stefan Videv
@ 2012-11-02 18:46               ` Gilles Chanteperdrix
  2012-11-05 15:58                 ` Stefan Videv
  0 siblings, 1 reply; 18+ messages in thread
From: Gilles Chanteperdrix @ 2012-11-02 18:46 UTC (permalink / raw)
  To: Stefan Videv; +Cc: xenomai


Stefan Videv wrote:
> Thanks. I got it to compile now -- I pointed to the root directory of
> the kernel sources, is that ok? It of course remains to be tested if the
> examples would work at all. Do you want me to let you guys know when I
> test that?

Yes, please.

-- 
                    Gilles.



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] Compiling the Xenomai examples
  2012-11-02 18:46               ` Gilles Chanteperdrix
@ 2012-11-05 15:58                 ` Stefan Videv
  2012-11-05 18:09                   ` Stefan Videv
  0 siblings, 1 reply; 18+ messages in thread
From: Stefan Videv @ 2012-11-05 15:58 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

On 11/02/2012 06:46 PM, Gilles Chanteperdrix wrote:
> Stefan Videv wrote:
>> Thanks. I got it to compile now -- I pointed to the root directory of
>> the kernel sources, is that ok? It of course remains to be tested if the
>> examples would work at all. Do you want me to let you guys know when I
>> test that?
> Yes, please.
>
Okay, so I've tested the examples I compiled last week.

-- common: could not test as I don't have the particular hardware required
-- native: work
-- posix: fails to load the kernel module with:
     satch: Unknown symbol munmap (err 0)
     satch: Unknown symbol shm_open (err 0)
     satch: Unknown symbol pse51_shm_close (err 0)
     satch: Unknown symbol ftruncate (err 0)
     satch: Unknown symbol mmap (err 0)
     satch: Unknown symbol shm_unlink (err 0)
-- rtdm driver-api -- works, the second example seems to be out of date 
with the xenomai API as I get a message saying RT open and close 
handlers are deprecated.
-- rtdm profiles -- could/did not test

Any ideas regarding the problem with the POSIX example kernel module?

-- Stefan



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Xenomai] Compiling the Xenomai examples
  2012-11-05 15:58                 ` Stefan Videv
@ 2012-11-05 18:09                   ` Stefan Videv
  0 siblings, 0 replies; 18+ messages in thread
From: Stefan Videv @ 2012-11-05 18:09 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

On Mon, Nov 5, 2012 at 3:58 PM, Stefan Videv <videvstefan@gmail.com> wrote:

> On 11/02/2012 06:46 PM, Gilles Chanteperdrix wrote:
>
>> Stefan Videv wrote:
>>
>>> Thanks. I got it to compile now -- I pointed to the root directory of
>>> the kernel sources, is that ok? It of course remains to be tested if the
>>> examples would work at all. Do you want me to let you guys know when I
>>> test that?
>>>
>> Yes, please.
>>
>>  Okay, so I've tested the examples I compiled last week.
>
> -- common: could not test as I don't have the particular hardware required
> -- native: work
> -- posix: fails to load the kernel module with:
>     satch: Unknown symbol munmap (err 0)
>     satch: Unknown symbol shm_open (err 0)
>     satch: Unknown symbol pse51_shm_close (err 0)
>     satch: Unknown symbol ftruncate (err 0)
>     satch: Unknown symbol mmap (err 0)
>     satch: Unknown symbol shm_unlink (err 0)
> -- rtdm driver-api -- works, the second example seems to be out of date
> with the xenomai API as I get a message saying RT open and close handlers
> are deprecated.
> -- rtdm profiles -- could/did not test
>
> Any ideas regarding the problem with the POSIX example kernel module?
>
Including POSIX shared memory support in the kernel options solves the
above.

In conclusion, applying the fix to all the make files in the examples
directory should solve the problem of cross compiling.

-- Stefan


>
> -- Stefan
>
>

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2012-11-05 18:09 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-01 15:42 [Xenomai] Compiling the Xenomai examples Stefan Videv
2012-11-01 16:32 ` Gilles Chanteperdrix
2012-11-01 16:39   ` Stefan Videv
2012-11-01 17:00   ` Stefan Videv
2012-11-01 17:03     ` Gilles Chanteperdrix
  -- strict thread matches above, loose matches on Subject: below --
2012-11-01 17:04 Gilles Chanteperdrix
2012-11-01 17:17 ` Stefan Videv
2012-11-01 18:25   ` Gilles Chanteperdrix
2012-11-02 16:48     ` Stefan Videv
2012-11-02 17:13       ` Gilles Chanteperdrix
2012-11-02 17:35         ` Stefan Videv
2012-11-02 17:44         ` Stefan Videv
2012-11-02 17:47           ` Gilles Chanteperdrix
2012-11-02 17:58             ` Stefan Videv
2012-11-02 18:46               ` Gilles Chanteperdrix
2012-11-05 15:58                 ` Stefan Videv
2012-11-05 18:09                   ` Stefan Videv
2012-11-01 17:30 ` Stefan Videv

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.