File: ilib_for_link.cat

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