~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to man/utilities/ilib_build.cat

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
ilib_build         Scilab Group         Scilab Function          ilib_build
2
 
NAME
3
 
   ilib_build - utility for shared library management
4
 
  
5
 
CALLING SEQUENCE
6
 
 ilib_build(lib_name,table,files,libs [,makename])
7
 
PARAMETERS
8
 
 lib_name   : a character string, the generic name of the library without
9
 
            path and extension.
10
 
            
11
 
 table      : 2 column string matrix giving the table of pairs
12
 
            'scilab-name', 'interface name'
13
 
            
14
 
 files      : string matrix giving objects files needed for shared library
15
 
            creation
16
 
            
17
 
 libs       : string matrix giving extra libraries needed for shred
18
 
            library creation
19
 
            
20
 
 makename   : character string. The path of the Makefile file without
21
 
            extension.
22
 
            
23
 
DESCRIPTION
24
 
   This tool is used to create shared libraries and to generate a  loader
25
 
  file which can be used to dynamically load the shared library  into
26
 
  Scilab with addinter  Many examples are provided in
27
 
  examples/interface-tour-so directory.  
28
 
  
29
 
EXAMPLE
30
 
 //Here with give a complete example on adding new primitive to Scilab
31
 
 //create the procedure files
32
 
 f1=['extern double fun2();'
33
 
     'void fun1(x,y)'
34
 
     'double *x, *y;'
35
 
     '{*y=fun2(*x)/(*x);}'];
36
 
 
37
 
 mputl(f1,'fun1.c')
38
 
 
39
 
 f2=['#include <math.h>'
40
 
     'double fun2(x)'
41
 
     'double x;'
42
 
     '{ return( sin(x+1.));}'];
43
 
 mputl(f2,'fun2.c');
44
 
 
45
 
 //creating the interface file
46
 
 i=['#include ""stack-c.h""'
47
 
    'extern int fun1 _PARAMS(( double *x, double *y));'
48
 
    'int intfun1(fname)' 
49
 
    'char * fname;'
50
 
    '{'
51
 
    '  int m1,n1,l1;'
52
 
    '  CheckRhs(1,1);'
53
 
    '  CheckLhs(1,1);'
54
 
    '  GetRhsVar(1, ""d"", &m1, &n1, &l1);'
55
 
    '  fun1(stk(l1),stk(l1));'
56
 
    '  LhsVar(1) = 1;'
57
 
    '  return 0;'
58
 
    '}'];
59
 
 mputl(i,'intfun1.c')
60
 
 
61
 
 //creating the shared library (a gateway, a Makefile and a loader are 
62
 
 //generated. 
63
 
 
64
 
 files=['fun1.o','fun2.o','intfun1.o'];
65
 
 ilib_build('foo',['scifun1','intfun1'],files,[]);
66
 
 
67
 
 // load the shared library 
68
 
 
69
 
 exec loader.sce 
70
 
 
71
 
 //using the new primitive
72
 
 scifun1(33)
73
 
SEE ALSO
74
 
   addinter, link, ilib_compile, ilib_gen_Make, ilib_gen_gateway,
75
 
  ilib_gen_loader, ilib_for_link   
76