RTEMS 5 how to run "hello" example

Vijay Kumar Banerjee vijay at rtems.org
Tue Mar 16 15:28:57 UTC 2021


On Tue, Mar 16, 2021 at 4:07 AM Olga Syrbachova <syrba4eva28 at gmail.com> wrote:
>
> Thank you very much for your reply!
>
> I've added
> includes = '/home/olga/development/rtems/rtems-5/testsuites/support/include/tmacros.h',
>
It takes the relative address to the directory where the header file
is. For example, if you're building from the
"/home/olga/development/rtems" directory the includes argument would
be:

`includes = './rtems-5/testsuites/support/include/'`

BTW, your first email at the start of the thread says that you just
want to run the samples, the samples get built as a part of the rtems
and you'll be able to see the *.exe files in the build directory. Is
there any reason that you're trying to build it in a separate
directory with waf? Experimenting with the build system is a good
reason though, just making sure that we're not pushing you in the
wrong direction and your objective is indeed to try waf on your own
and not just running RTEMS hello app.

Best regards,
Vijay


> it still says "No such file or directory". I'm pretty sure the path is write, though there is now another path to "tmacros.h" (the first one below), it's a folder named "tmacros.h" and it's empty.
> olga at olga-H270M-DS3H:~$ locate tmacros.h
> /home/olga/development/app/ticker/build/sparc-rtems5-erc32/$HOME/developement/rtems/rtems-5/testsuites/support/include/tmacros.h
> /home/olga/development/rtems/rtems-5/testsuites/support/include/tmacros.h
>
>
> On Mon, 15 Mar 2021 at 21:00, Vijay Kumar Banerjee <vijay at rtems.org> wrote:
>>
>> On Mon, Mar 15, 2021 at 1:53 PM Olga Syrbachova <syrba4eva28 at gmail.com> wrote:
>> >
>> > Sure! https://github.com/syrba4eva/RTEMS/blob/main/wscript
>>
>> Thanks. In this line: https://github.com/syrba4eva/RTEMS/blob/main/wscript#L33
>> After cflags parameter, add "includes", for example:
>>
>> bld(features = 'c cprogram',
>>       target = 'ticker.exe',
>>       cflags = '-g -O2',
>>       includes='. .. ./original/path/to/tmacros.h',
>>       source = ['init.c', 'tasks.c'])
>>
>> you don't need to copy tmacros.h or any headers from rtems, just add
>> the path to includes.
>>
>>
>> Best regards,
>> Vijay
>>
>> >
>> > On Mon, 15 Mar 2021 at 20:36, Vijay Kumar Banerjee <vijay at rtems.org> wrote:
>> >>
>> >> On Mon, Mar 15, 2021 at 1:30 PM Olga Syrbachova <syrba4eva28 at gmail.com> wrote:
>> >> >
>> >> > Thank you very much for your reply!
>> >> > Unfortunately I'm still a bit confused and don't quite understand what to do. Where do I need to modify the "include" parameter? In the wscript file from the "hello" example there is no "include" parameter. I also tried to find a tutorial on how to write a wscript, but didn't find any (Could you suggest any please?). So I tried to copy the file "tmacros.h" from testsuites/support/include to app/ticker. Now after running ./waf I get an error, which tells me that "buffer_test_io.h" wasn't found. When I copied it to my app/ticker directory it didn't work and I still have the same error.
>> >> >
>> >> Would it be possible for you to paste your wscript somewhere (like
>> >> gist.github.com) and share it here so that we can have a look and help
>> >> you with that?
>> >>
>> >> Best regards,
>> >> Vijay
>> >>
>> >> > Waf: Entering directory `/home/olga/development/app/ticker/build/sparc-rtems5-erc32'
>> >> > [1/3] Compiling tasks.c
>> >> > [2/3] Compiling init.c
>> >> > In file included from ../../system.h:17:0,
>> >> >                  from ../../init.c:15:
>> >> > ../../tmacros.h:32:10: fatal error: buffer_test_io.h: No such file or directory
>> >> >  #include <buffer_test_io.h>
>> >> >           ^~~~~~~~~~~~~~~~~~
>> >> > compilation terminated.
>> >> >
>> >> > In file included from ../../system.h:17:0,
>> >> >                  from ../../tasks.c:22:
>> >> > ../../tmacros.h:32:10: fatal error: buffer_test_io.h: No such file or directory
>> >> >  #include <buffer_test_io.h>
>> >> >           ^~~~~~~~~~~~~~~~~~
>> >> > compilation terminated.
>> >> >
>> >> > Waf: Leaving directory `/home/olga/development/app/ticker/build/sparc-rtems5-erc32'
>> >> > Build failed
>> >> >  -> task in 'ticker.exe' failed with exit status 1 (run with -v to display more information)
>> >> >  -> task in 'ticker.exe' failed with exit status 1 (run with -v to display more information)
>> >> >
>> >> > On Mon, 15 Mar 2021 at 16:21, Vijay Kumar Banerjee <vijay at rtems.org> wrote:
>> >> >>
>> >> >> Hi Olga,
>> >> >>
>> >> >>
>> >> >> On Mon, Mar 15, 2021 at 8:29 AM Olga Syrbachova <syrba4eva28 at gmail.com> wrote:
>> >> >> >
>> >> >> > Thank you very much for your reply!
>> >> >> >
>> >> >> > I've built the RTEMS Kernel for erc32. Then I followed this tutorial https://docs.rtems.org/branches/master/user/start/app.html to build a "Hello World" application and it works just fine. Then I've tried to create another application following the steps in the tutorial.
>> >> >> > 1. In $HOME/development/app/ I created a directory "ticker".
>> >> >> > 2. cd ticker
>> >> >> > 3. curl https://waf.io/waf-2.0.19 > waf
>> >> >> >     chmod +x waf
>> >> >> >     git init
>> >> >> >     git submodule add git://git.rtems.org/rtems_waf.git rtems_waf
>> >> >> > 4. I've copied the files "init.c", "tasks.c", "system.h" from testsuites/samples
>> >> >> > 5. In the "wscript" I've changed the lines 32 and 34 to target = 'ticker.exe', source = ['init.c', 'tasks.c']
>> >> >> > 6. ./waf configure --rtems=$HOME/development/rtems/5 --rtems-bsp=sparc/erc32
>> >> >> > 7. and running ./waf next, I get an error. It looks like the file "tmacros.h", which is included in "system.h", cannot be found.
>> >> >> >
>> >> >> You have changed the "target" and "source" parameters in your wscript.
>> >> >> You'd also need to modify the "include" parameter and add relative
>> >> >> path to tmacros.h. For multiple headers, you'll have to add the paths
>> >> >> as a string with space-separated values or a list like this:
>> >> >> `includes='./ ../ ./path/to/include/'`
>> >> >>
>> >> >>
>> >> >> > What am I doing wrong? Is the way to run other examples exactly the same as to run a "Hello World" example?
>> >> >> The other examples will also follow a similar wscript structure but
>> >> >> hello world is the simple one with fewer includes so it's a good place
>> >> >> to start if you're trying to learn how to make a separate project with
>> >> >> RTEMS applications using waf.
>> >> >>
>> >> >>
>> >> >> Best regards,
>> >> >> Vijay
>> >> >> > _______________________________________________
>> >> >> > users mailing list
>> >> >> > users at rtems.org
>> >> >> > http://lists.rtems.org/mailman/listinfo/users


More information about the users mailing list