From: Stefan Videv <videvstefan@gmail.com>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] Compiling the Xenomai examples
Date: Thu, 01 Nov 2012 17:00:51 +0000 [thread overview]
Message-ID: <5092AAC3.5050900@gmail.com> (raw)
In-Reply-To: <984605f116e3f118be8a39540ec40a64.squirrel@www.xenomai.org>
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.
>
>
>
next prev parent reply other threads:[~2012-11-01 17:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5092AAC3.5050900@gmail.com \
--to=videvstefan@gmail.com \
--cc=gilles.chanteperdrix@xenomai.org \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.