[Scilab-Dev] Fortran interfaces in a toolbox
Allan CORNET
allan.cornet at scilab.org
Fri Oct 8 08:12:36 CEST 2010
Hi,
If you use fort, you have NOT a built-in defined in Scilab.
n With toolbox_skeleton : from scilab, you do f_sum(3,2)
In this gateway, you manage errors and input/output arguments check-in
(check size, type, value ,
) and return results in scilab.
n With fort : you need to do :
A = 3 ; B = 3 ;
C= 0 ;
fort(fsum,A,1, « d »,B,1, « d », « out »,C,3,1, « d »)
in this case, you need to know size and type returned.
and if you have a error, you can not return this error to scilab.
For more information, see :
help call
help addinter
help api_scilab
for a quick and dirty tool, you can use call or fort but for a toolbox,
you need to create a built-in when you call C or fortran code.
Best regards
Allan
--
-------------------------
Allan CORNET
-------------------------
The Scilab Consortium
Digiteo
Domaine de Voluceau
Rocquencourt - B.P. 105
78153 Le Chesnay Cedex
France
De : Jean-Pierre Dussault [mailto:Jean-Pierre.Dussault at USherbrooke.ca]
Envoyé : jeudi 7 octobre 2010 22:21
À : dev at lists.scilab.org
Cc : Romain Cotte
Objet : [Scilab-Dev] Fortran interfaces in a toolbox
Hi!
the toolbox_skeleton as well as the instructions at
http://wiki.scilab.org/howto/Create_a_toolbox
wrap the example fortran fsum into a C-wrapper. However, there exists a
"fort" command in scilab which allows to interface directly a fortran
function. Why then use the complicated fortran --> C --> scilab path instead
of fortran --> fort(...)?
Further complications arise when dealing with non-scalar variables which
will have to be properly converted in C before being properly transmitted to
scilab while the instruction "fort" takes care of this easily while hiding
cumbersome conversion details.
Will the "fort" command remain in scilab? If so, we will stick to using it!
Thx,
JPD
P.S. In the toolbox_skeleton (scilab binary distribution), csum.h and
csub.h are missing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/dev/attachments/20101008/6b7a7148/attachment.htm>
More information about the dev
mailing list