[scilab-Users] compiling c block with LCC
trendic at gmx.de
trendic at gmx.de
Wed Nov 25 09:58:27 CET 2009
Hi,
thanks for your advices. Unfortunately it still doesnt work.
What I have done. I have created a user directory under scilab path. In the console i switch to that directory by the cd command. I save the file pendel_c.c in that directory. Then I type in the command as suggested.
I use the beta version 5.2. I have installed the latest LCC compiler. My results are the same as before:
>ilib_for_link('pendel_c','pendel_c.c','','c','','loader.sce','','','-I""'+WSCI+'\modules\scicos_blocks\includes""')
erzeuge eine Laderdatei
erzeuge ein Makefile
Warnung: C:/SCILAB~1/modules/dynamic_link/src/scripts/TEMPLATE_MAKEFILE.LCCnot found.
Führe Makefile aus
Kompilation von pendel_c.c
erzeuge eine gemeisame Bibliothek (habe Sie Geduld)
make: Can't open makelib.lcc
!--error 10000
unix_s: error during "make -f makelib.lcc all" execution
at line 34 of function unix_s called by :
at line 67 of function ilib_compile called by :
at line 59 of function ilib_for_link called by :
ilib_for_link('pendel_c','pendel_c.c','','c','','loader.sce','','','-I""'+WSCI+'\modules\scicos_blocks\includes""')
I still dont understand why it is said the makefile TEMPLATE_MAKEFILE.LCC is not found. It is exactly there. Can there be a problem with the tilde in SCILAB~1 ?
best regards
Olaf
-------- Original-Nachricht --------
> Datum: Wed, 25 Nov 2009 08:50:11 +0100
> Von: "Allan CORNET" <allan.cornet at scilab.org>
> An: users at lists.scilab.org
> Betreff: RE: [scilab-Users] compiling c block with LCC
> Hi,
>
> Try this:
>
> Save as 'pendel_c.c' filename
>
> #include <scicos_block.h>
> #include <math.h>
> void pendel_c(scicos_block *block, int flag) { if(flag==1){
> block->outptr[0][0]=block->x[0];
> }
> if(flag==0){
> double g=9.81;
> double m = block->rpar[0];
> double l = block->rpar[1];
> double c = block->rpar[2];
> double d = block->rpar[3];
> double phi=block->x[0]; //phi
> double omega=block->x[1]; //omega
> double M = block->inptr[0][0];
> block->xd[0]=block->x[1];
> block->xd[1]=1/m/l/l*(g*l*cos(phi)*m-c*phi-M-d*omega);
> }
> }
>
> ilib_for_link('pendel_c','pendel_c.c','','c','','loader.sce','','','-I""'
> +WSCI+'\modules\scicos_blocks\includes""')
>
> With Scilab 5.2-beta1:
>
> -->ilib_for_link('pendel_c','pendel_c.c','','c','','loader.sce','','','-I""'
> +WSCI+'\modules\scicos_blocks\includes""')
> Generate a loader file
> Generate a Makefile
> Running the Makefile
> Compilation of pendel_c.c
> Building shared library (be patient)
> Generate a cleaner file
> ans =
>
> libpendel_c.dll
>
>
>
> Best Regards
>
> Allan CORNET
>
> --
> -------------------------
> Allan CORNET
> -------------------------
> The Scilab Consortium
> Digiteo
> Domaine de Voluceau
> Rocquencourt - B.P. 105
> 78153 Le Chesnay Cedex
> France
>
> -----Message d'origine-----
> De : Dirk Schwitzt [mailto:trendic at gmx.de]
> Envoyé : mardi 24 novembre 2009 21:31
> À : users at lists.scilab.org
> Objet : Re: [scilab-Users] compiling c block with LCC
>
> This doesnt change anything.
>
> It doesnt work with the VC compiler as well. It says:
>
> ilib_for_link('pendel_c.c','pendel_c.o',[],'c');
> erzeuge eine Laderdatei
> erzeuge ein Makefile
> Führe Makefile aus
> Kompilation von pendel_c
> erzeuge eine gemeisame Bibliothek (habe Sie Geduld)
> NMAKE : fatal error U1077: '"C:\Programme\Microsoft Visual Studio
> 8\VC\bin\cl.EXE"' : return code '0x2'
> Stop.
> !--error 10000
> unix_s: error during "nmake /Y /nologo /f Makelib.mak all" execution
> at line 34 of function unix_s called by :
> at line 67 of function ilib_compile called by :
> at line 59 of function ilib_for_link called by :
> ilib_for_link('pendel_c.c','pendel_c.o',[],'c');
>
>
> Any ideas?
>
>
>
> -------- Original-Nachricht --------
> > Datum: Tue, 24 Nov 2009 20:50:27 +0100
> > Von: Roberto Bucher <roberto.bucher at supsi.ch>
> > An: users at lists.scilab.org
> > CC: trendic at gmx.de
> > Betreff: Re: [scilab-Users] compiling c block with LCC
>
> > Try to cmodify as some parts as following
> >
> > ...
> > if(flag==1){
> > double *y = block->outptr[0];
> > y[0] = block->x[0];
> > ...
> > double *M = block->inptr[0];
> > ...
> >
> > block->xd[1]=1/m/l/l*(g*l*cos(phi)*m-c*phi-M[0]-d*omega);
> > ...
> >
> > Regards
> >
> > Roberto Bucher
> >
> > On Tuesday 24 November 2009 19:09:39 trendic at gmx.de wrote:
> > > Hi,
> > >
> > > Even if there is an error in the code I dont understand the
> > > Warnings/errors. This is the example Code:
> > >
> > > #include <scicos/scicos_block.h>
> > > #include <math.h>
> > > void pendel_c(scicos_block *block, int flag) {
> > > if(flag==1){
> > > block->outptr[0][0]=block->x[0];
> > > }
> > > if(flag==0){
> > > double g=9.81;
> > > double m = block->rpar[0];
> > > double l = block->rpar[1];
> > > double c = block->rpar[2];
> > > double d = block->rpar[3];
> > > double phi=block->x[0]; //phi
> > > double omega=block->x[1]; //omega
> > > double M = block->inptr[0][0];
> > > block->xd[0]=block->x[1];
> > > block->xd[1]=1/m/l/l*(g*l*cos(phi)*m-c*phi-M-d*omega);
> > > }
> > > }
> > >
> > >
> > > I have tried to insert the Code in a block and tried the command
> > >
> > > ilib_for_link('pendel_c','pendel.o',[],'c');
> > >
> > > best regards
> > >
> > > -------- Original-Nachricht --------
> > >
> > > > Datum: Tue, 24 Nov 2009 12:01:29 +0100
> > > > Von: "Allan CORNET" <allan.cornet at scilab.org>
> > > > An: users at lists.scilab.org
> > > > Betreff: RE: [scilab-Users] compiling c block with LCC
> > > >
> > > > Hi,
> > > >
> > > > Can you attach your diagram (example) ?
> > > >
> > > > Thanks you
> > > >
> > > > --
> > > > -------------------------
> > > > Allan CORNET
> > > > -------------------------
> > > > The Scilab Consortium
> > > > Digiteo
> > > > Domaine de Voluceau
> > > > Rocquencourt - B.P. 105
> > > > 78153 Le Chesnay Cedex
> > > > France
> > > >
> > > > -----Message d'origine-----
> > > > De : trendic at gmx.de [mailto:trendic at gmx.de]
> > > > Envoyé : mardi 24 novembre 2009 11:48
> > > > À : users at lists.scilab.org
> > > > Objet : [scilab-Users] compiling c block with LCC
> > > >
> > > > Hello,
> > > >
> > > > Does anyone know how to compile and link a c block for scicos?
> > > >
> > > > I have tried with the Blocks in the Palette "user defined functions"
> > but
> > > > I get errors with that. At first I recieve the warning:
> > > >
> > > >
> C:/SCILAB~1/modules/dynamic_link/src/scripts/TEMPLATE_MAKEFILE.LCCnot
> > > > found.
> > > >
> > > > which is surprising since there is a file with that name at exactly
> > that
> > > > position. I further get the Message
> > > >
> > > > Can't open Makelib.lcc
> > > >
> > > > After that:
> > > >
> > > > unix_s: error during "make -f Makelib.lcc all" execution ...
> > > >
> > > > Is the command unix_s correct although I am working on windows?
> > > >
> > > > I have googled around and found someone who says that you can
> compile
> > > > Functions similar to S-Functions in Matlab by the ilib_for_link
> > command.
> > > >
> > > > I have tried that with an example c-File which delivers exactly the
> > same
> > > > Warnings/Errors as mentioned above.
> > > >
> > > >
> > > > Another question I have is: when I edit system functions as
> > > > "ilib_for_link.sci" e.g. how is the corresponding ilib_for_link.bin
> > file
> > > > created?
> > > >
> > > > Thanks for any advise in advance
> > > >
> > > > Olaf
> > >
> >
> > --
> > University of Applied Sciences of Southern Switzerland
> > Dept. Innovative Technologies
> > CH-6928 Lugano-Manno
> > http://web.dti.supsi.ch/~bucher
>
> --
> Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5
> -
> sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser
--
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser
More information about the users
mailing list