From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <592273.9623.qm@domain.hid> Date: Thu, 17 Feb 2011 13:32:40 +0000 (GMT) From: Franz Engel In-Reply-To: <4D5CF34B.3030905@domain.hid> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1174114072-1297949560=:9623" Subject: Re: [Xenomai-help] valgrind and modprobe xeno_posix List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gilles Chanteperdrix Cc: xenomai@xenomai.org --0-1174114072-1297949560=:9623 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable >> Hi, >>=20 >> I'm still doubtful if I installed Xenomai correctly. When I start my QT-= Programm=20 >> it runs correctly and I can see a new process in /proc/xenomai/state wit= h the=20 >> name of my program. I insert the following lines in my *.pro-File (the d= raft for=20 >> my makefile): >> LIBS +=3D -Wl,@usr/xenomai/lib/posix.wrappers -L/usr/xenomai/lib -lpthre= ad_rt=20 >> -lxenomai -lpthread -lrt -Xlinker -rpath -Xlinker /usr/xenomai/lib >> LIBS +=3D -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall -pipe = -D__XENO__=20 >> -I/usr/xenomai/include/posix >>=20 >> I'm absoult no makefile pro. The two lines are the only thing I changed = in my=20 >> *.pro file. Do I have to make more changes? >Wrong makefile, see: >http://www.xenomai.org/index.php/Porting_POSIX_applications_to_Xenomai#Com= pilation_flags >> Futhermore, when I run: >> valgrind --leak-check=3Dyes ./demo >>=20 >> I get the correct valgrind output, but also a line of xenomai: >> Xenomai: POSIX skin or CONFIG_XENO_OPT_PERVASIVE disabled >> (modprobe xeno_posix?) >>=20 >> Do I use a bad makefile? >Yes, you use a bad makefile, but this is not the reason why your >application does not work with valgrind: Xenomai applications do not >work with valgrind. >Also note that the QT library is compiled to use Linux posix objects, >not Xenomai posix objects, so depending on what you do, mixing some >Xenomai code with QT code will not work. The real-time part of the >application has to clearly been separated from the rest, and only this >part needs to be linked with Xenomai flags, so, the simplest thing to do >is to put the real-time part of the application in a dynamic library, >link-edit this dynamic library with Xenomai posix skin flags, then link >with this dynamic library the rest of the application, without Xenomai >posix skin flags. And in the interface between the library and the >applicaiton, do not put any inline functions calling Xenomai posix skin >services, as this would ruin what you are trying to achieve. > >--=20 >=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Gill= es. O.k. This is a quite=A0helpfull information. I tried to make dynamic librar= ys and glue them with QT to my whole project. But, how I say, I'm a newbie = with makefiles. I tried to trim the satch-example. This is my makefile: APPLICATION =3D demoLib XENO?=3D/usr/xenomai XENOCONFIG=3D$(shell PATH=3D$(XENO):$(XENO)/bin:$(PATH) which xeno-config 2= >/dev/null) CC=3D$(shell $(XENOCONFIG) --cc) CFLAGS=3D$(shell $(XENOCONFIG) --posix-cflags) $(APP_CFLAGS) LDFLAGS=3D$(shell $(XENOCONFIG) --posix-ldflags) $(APP_LDFLAGS) LDFLAGS+=3DXlinker -rpath -Xlinker $(shell $(XENOCONFIG) --libdir) =A0 all:: $(APPLICATIONS) clean:: =A0=A0=A0 $(RM) $(APPLICATIONS) *.o =A0 The demoLib works fine, but of course, it is no lib. What I have to change = to make a lib? Did I understand it right that the xeno-config is a skript t= hat gives support to get the *FLAGS easier? But where is the compiling coma= nd?=0A=0A --0-1174114072-1297949560=:9623 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable <= /table>
--0-1174114072-1297949560=:9623--

&= gt;> Hi,
>>
>> I'm still doubtful if I installed Xeno= mai correctly. When I start my QT-Programm
>> it runs correctly a= nd I can see a new process in /proc/xenomai/state with the
>> nam= e of my program. I insert the following lines in my *.pro-File (the draft f= or
>> my makefile):
>> LIBS +=3D -Wl,@usr/xenomai/lib/po= six.wrappers -L/usr/xenomai/lib -lpthread_rt
>> -lxenomai -lpthre= ad -lrt -Xlinker -rpath -Xlinker /usr/xenomai/lib
>> LIBS +=3D -I/= usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__
&= gt;> -I/usr/xenomai/include/posix
>>
>> I'm absoult n= o makefile pro. The two lines are the only thing I changed in my
>&g= t; *.pro file. Do I have to make more changes?

>Wrong makefile, see:
>http://www.xenomai.o= rg/index.php/Porting_POSIX_applications_to_Xenomai#Compilation_flags

>> Futhermore, when I run:
>> valgrind --leak-check= =3Dyes ./demo
>>
>> I get the correct valgrind output, b= ut also a line of xenomai:
>> Xenomai: POSIX skin or CONFIG_XENO_O= PT_PERVASIVE disabled
>> (modprobe xeno_posix?)
>>
&g= t;> Do I use a bad makefile?

>Yes, you use a bad makefile, but= this is not the reason why your
>application does not work with valg= rind: Xenomai applications do not
>work with valgrind.

>Als= o note that the QT library is compiled to use Linux posix objects,
>n= ot Xenomai posix objects, so depending on what you do, mixing some
>X= enomai code with QT code will not work. The real-time part of the
>application has to clearly been separated from the rest, and on= ly this
>part needs to be linked with Xenomai flags, so, the simplest= thing to do
>is to put the real-time part of the application in a dy= namic library,
>link-edit this dynamic library with Xenomai posix ski= n flags, then link
>with this dynamic library the rest of the applica= tion, without Xenomai
>posix skin flags. And in the interface between= the library and the
>applicaiton, do not put any inline functions ca= lling Xenomai posix skin
>services, as this would ruin what you are t= rying to achieve.
>
>--
>     &= nbsp;           &nbs= p;      Gilles.

O.k. This is a quite helpf= ull information. I tried to make dynamic librarys and glue them with QT to = my whole project. But, how I say, I'm a newbie with makefiles. I tried to t= rim the satch-example. This is my makefile:

APPLICATION =3D demoLib

XENO?=3D/usr/xenomai

XENOCONFIG=3D$(shell PATH= =3D$(XENO):$(XENO)/bin:$(PATH) which xeno-config 2>/dev/null)

CC=3D$(shell $(XENOCONFIG)= --cc)

CFLAGS=3D$(shell $(XENOCON= FIG) --posix-cflags) $(APP_CFLAGS)

LDFLAGS=3D$(shell $(XENOCO= NFIG) --posix-ldflags) $(APP_LDFLAGS)

LDFLAGS+=3DXlinker -rpath = -Xlinker $(shell $(XENOCONFIG) --libdir)

 

all:: $(APPLICATIONS)

clean::

    $(RM) $(APPL= ICATIONS) *.o

 

The demoLib works fine, but of = course, it is no lib. What I have to change to make a lib? Did I understand= it right that the xeno-config is a skript that gives support to get the *F= LAGS easier? But where is the compiling comand?