~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to man/utilities/ilib_for_link.cat

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
ilib_for_link       Scilab Group       Scilab Function        ilib_for_link
 
2
NAME
 
3
   ilib_for_link - utility for shared library management with link
 
4
  
 
5
CALLING SEQUENCE
 
6
 libn=ilib_for_link(names,files,libs,flag,makename,loadername])
 
7
PARAMETERS
 
8
 names      : a string matrix giving the entry names which are to be
 
9
            linked.
 
10
            
 
11
 files      : string matrix giving objects files needed for shared library
 
12
            creation
 
13
            
 
14
 libs       : string matrix giving extra libraries needed for shred
 
15
            library creation
 
16
            
 
17
 flag       : a string flag ("c" or "f") for C or Fortran entry points.
 
18
            
 
19
 makename   : character string. The pathname of the Makefile file without
 
20
            extension (default value Makelib).
 
21
            
 
22
 loadername : character string. The pathname of the loader file (default
 
23
            value  loader.sce).
 
24
            
 
25
 libn       : character string. The path of the really generated shared
 
26
            library file.
 
27
            
 
28
DESCRIPTION
 
29
   This tool is used to create shared libraries and to generate a  loader
 
30
  file which can be used to dynamically load the shared library  into
 
31
  Scilab with the link function. New entry points  given by names are then
 
32
  accessible through the call  function or with non linear tools ode,
 
33
  optim,...  Many examples are provided in examples/link-examples-so
 
34
  directory.  
 
35
  
 
36
EXAMPLE
 
37
 
 
38
 f1=['int ext1c(n, a, b, c)'
 
39
     'int *n;     double *a, *b, *c;'
 
40
     '{int k;'
 
41
     '  for (k = 0; k < *n; ++k) '
 
42
     '      c[k] = a[k] + b[k];'
 
43
     '  return(0);}'];
 
44
 
 
45
 mputl(f1,'fun1.c')
 
46
 
 
47
 //creating the shared library (a gateway, a Makefile and a loader are 
 
48
 //generated. 
 
49
 
 
50
 ilib_for_link('ext1c','fun1.o',[],"c") 
 
51
 
 
52
 // load the shared library 
 
53
 
 
54
 exec loader.sce 
 
55
 
 
56
 //using the new primitive
 
57
 a=[1,2,3];b=[4,5,6];n=3;
 
58
 c=call('ext1c',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d');
 
59
 if norm(c-(a+b)) > %eps then pause,end
 
60
 
 
61
SEE ALSO
 
62
   addinter, link, ilib_compile, ilib_gen_Make, ilib_gen_gateway,
 
63
  ilib_gen_loader, ilib_for_link   
 
64