<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class="">On Fri, May 29, 2015 at 6:23 PM, Björn Brandenburg <span dir="ltr" class=""><<a href="mailto:bbb@mpi-sws.org" target="_blank" class="">bbb@mpi-sws.org</a>></span> wrote:<br class=""></blockquote><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><div class=""><br class="">
> On 29 May 2015, at 13:13, Dhanny R <<a href="mailto:dhanker2626@gmail.com" target="_blank" class="">dhanker2626@gmail.com</a>> wrote:<br class="">
><br class="">
> Hello Sir Björn<br class="">
><br class="">
> i have many question about LITMUS,<br class="">
> i'm interested because for my tesis research...<br class="">
> and i'm newbie for this<br class="">
><br class="">
> my question are :<br class="">
> 1. i have many task for testing in liblitmus, it's right if i edit from base_mt_task (multicore)<br class="">
> or base_task (single core) or i must create a new file from liblitmus directory?<br class="">
><br class="">
> 2. how can i compile the code that i build? if any tools must be installed like gcc or something else, in which directory i must installed? in liblitmus or any?<br class="">
><br class="">
> 3. if my step wrong, could you give me reference how step by step using this tools?<br class="">
><br class="">
> glad to know for the fast response<br class="">
<br class="">
<br class="">
</div></div>Dhany, I’m glad that you are interested in using LITMUS^RT for your thesis research, but the questions that you are now asking pertain to issues that are not LITMUS^RT specific and not appropriate for this mailing list. Some experience working with moderately complex C code bases and Linux is required to make use of LITMUS^RT.<br class="">
<br class="">
To answer your questions:<br class="">
<br class="">
1) You may organize your code any way you like. The two dummy skeletons exist to make starting up easier, but their use is entirely optional.<br class="">
<br class="">
2) Like most C libraries, liblitmus comes with a makefile. Of course a working gcc toolchain is required.<br class="">
<br class="">
3) I suggest you first learn how to build regular C programs on Linux, and how to use make. Once you know how to do that LITMUS^RT is fairly straightforward to use.<br class="">
<br class="">
Best regards,<br class="">
Björn<br class=""></blockquote></div></div></div></div></blockquote></div></div></div></blockquote><blockquote type="cite" class=""><br class=""></blockquote></div><div><blockquote type="cite" class="">On Sun, May 31, 2015 at 3:02 PM, Dhanny R <span dir="ltr" class=""><<a href="mailto:dhanker2626@gmail.com" target="_blank" class="">dhanker2626@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class="">hello again, <br class=""></div>when i want to compile my program with gcc, the error message fatal error: litmus.h: No such file or directory, after i found the directory and compile again, error message shown fatal error: asm/cycles.h No such file or directory, <br class=""><br class=""></div>my question, which directory i can find litmus.h, asm/cycles.h?<br class=""><br class=""></div>thanks<br class=""><br class=""></div>regards</div></blockquote></blockquote><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"></blockquote></div><div></div><blockquote type="cite" class=""><div><br class=""></div><div><div class="">On May 31, 2015, at 1:38 AM, Dhanny R <<a href="mailto:dhanker2626@gmail.com" class="">dhanker2626@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class="">hello, sorry for my last message, i have fixed that, but when i compile my sample experiment there is an error message :<br class=""><br class="">root@vm1:~/liblitmus/bin# gcc -o test base_mt_task.c <br class="">/tmp/ccA4KPUl.o: In function `main':<br class="">base_mt_task.c:(.text+0x19): undefined reference to `init_litmus'<br class="">base_mt_task.c:(.text+0x6b): undefined reference to `pthread_create'<br class="">base_mt_task.c:(.text+0x95): undefined reference to `pthread_join'<br class="">/tmp/ccA4KPUl.o: In function `rt_thread':<br class="">base_mt_task.c:(.text+0xc6): undefined reference to `init_rt_task_param'<br class="">base_mt_task.c:(.text+0x112): undefined reference to `init_rt_thread'<br class="">base_mt_task.c:(.text+0x169): undefined reference to `gettid'<br class="">base_mt_task.c:(.text+0x177): undefined reference to `set_rt_task_param'<br class="">base_mt_task.c:(.text+0x1ce): undefined reference to `task_mode'<br class="">base_mt_task.c:(.text+0x220): undefined reference to `sleep_next_period'<br class="">base_mt_task.c:(.text+0x238): undefined reference to `task_mode'<br class="">collect2: ld returned 1 exit status<br class=""><br class=""><br class=""></div>anyone can help me? thanks so much</div></div></div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Like many C programs, several liblitmus programs link in additional libraries. In your case, base_mt_task.c must also link in the liblitmus library. Here, the compiler is complaining that it cannot find liblitmus functions (among others). Assuming that you have run the liblitmus makefile, you should see a static library with the name “liblitmus.a” in the liblitmus directory.</div><div class=""><br class=""></div><div class="">You can try the command “gcc -o test base_mt_task.c -llitmus” to tell GCC to also link in liblitmus.a. HOWEVER, I don’t expect that this will actually work. Liblitmus programs usually also link in the standard math library (“-lm”), the POSIX real-time library (“-lrt”), and the POSIX threading library (“-pthread”). So you would probably need to do “gcc -o test base_mt_task.c -litmus -pthread -lrt -lm”. (For subtle reasons, you want to use “-pthread” and NOT “-lpthread”.)</div><div class=""><br class=""></div><div class="">As you may see in the file liblitmus/Makefile (see here: <a href="https://github.com/LITMUS-RT/liblitmus/blob/master/Makefile#L221" class="">https://github.com/LITMUS-RT/liblitmus/blob/master/Makefile#L221</a>), the liblitmus makefile is already set up to compile base_mt_task.c for you. Just run “make” in the liblitmus directory (again, after you have compiled litmus-rt.) If you want to write your own liblitmus-based programs, I recommend that you modify the liblitmus Makefile to also compile your custom source files. The link above should give you an idea of how to do this.</div><div class=""><br class=""></div><div class="">If you’re not familiar with makefiles, I suggest that you follow an online tutorial. Here’s google’s top tutorial: <a href="http://mrbook.org/blog/tutorials/make/" class="">http://mrbook.org/blog/tutorials/make/</a></div><div class=""><br class=""></div><div class="">-Glenn</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><div class=""><div dir="ltr" class=""></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div class="HOEnZb"><div class="h5"></div></div></blockquote></div></div></div></div><br class=""></div></body></html>