File: ilib_build.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 (76 lines) | stat: -rw-r--r-- 2,165 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
65
66
67
68
69
70
71
72
73
74
75
76
ilib_build         Scilab Group         Scilab Function          ilib_build
NAME
   ilib_build - utility for shared library management
  
CALLING SEQUENCE
 ilib_build(lib_name,table,files,libs [,makename])
PARAMETERS
 lib_name   : a character string, the generic name of the library without
            path and extension.
            
 table      : 2 column string matrix giving the table of pairs
            'scilab-name', 'interface name'
            
 files      : string matrix giving objects files needed for shared library
            creation
            
 libs       : string matrix giving extra libraries needed for shred
            library creation
            
 makename   : character string. The path of the Makefile file without
            extension.
            
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 addinter  Many examples are provided in
  examples/interface-tour-so directory.  
  
EXAMPLE
 //Here with give a complete example on adding new primitive to Scilab
 //create the procedure files
 f1=['extern double fun2();'
     'void fun1(x,y)'
     'double *x, *y;'
     '{*y=fun2(*x)/(*x);}'];
 
 mputl(f1,'fun1.c')
 
 f2=['#include <math.h>'
     'double fun2(x)'
     'double x;'
     '{ return( sin(x+1.));}'];
 mputl(f2,'fun2.c');
 
 //creating the interface file
 i=['#include ""stack-c.h""'
    'extern int fun1 _PARAMS(( double *x, double *y));'
    'int intfun1(fname)' 
    'char * fname;'
    '{'
    '  int m1,n1,l1;'
    '  CheckRhs(1,1);'
    '  CheckLhs(1,1);'
    '  GetRhsVar(1, ""d"", &m1, &n1, &l1);'
    '  fun1(stk(l1),stk(l1));'
    '  LhsVar(1) = 1;'
    '  return 0;'
    '}'];
 mputl(i,'intfun1.c')
 
 //creating the shared library (a gateway, a Makefile and a loader are 
 //generated. 
 
 files=['fun1.o','fun2.o','intfun1.o'];
 ilib_build('foo',['scifun1','intfun1'],files,[]);
 
 // load the shared library 
 
 exec loader.sce 
 
 //using the new primitive
 scifun1(33)
SEE ALSO
   addinter, link, ilib_compile, ilib_gen_Make, ilib_gen_gateway,
  ilib_gen_loader, ilib_for_link