diff options
author | Shashank | 2017-05-29 12:40:26 +0530 |
---|---|---|
committer | Shashank | 2017-05-29 12:40:26 +0530 |
commit | 0345245e860375a32c9a437c4a9d9cae807134e9 (patch) | |
tree | ad51ecbfa7bcd3cc5f09834f1bb8c08feaa526a4 /modules/dynamic_link/help | |
download | scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.gz scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.bz2 scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.zip |
CMSCOPE changed
Diffstat (limited to 'modules/dynamic_link/help')
34 files changed, 3995 insertions, 0 deletions
diff --git a/modules/dynamic_link/help/en_US/G_make.xml b/modules/dynamic_link/help/en_US/G_make.xml new file mode 100755 index 000000000..8d40b475e --- /dev/null +++ b/modules/dynamic_link/help/en_US/G_make.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="G_make"> + <refnamediv> + <refname>G_make</refname> + <refpurpose>call make or nmake</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>Rfiles=G_make(files,dllname)</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>files</term> + <listitem> + <para>a character string or a vector of character string.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>dllname</term> + <listitem> + <para>a character string.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>Rfiles</term> + <listitem> + <para> + vector of character string. <literal>Rfiles</literal> can be used as a first argument when calling <literal>addinter</literal> function. + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para> + On Unix like systems <literal>G_make</literal> calls the <literal>make</literal> utility for building target <literal>files</literal> + and returns the value of <literal>files</literal> in the variable <literal>Rfiles</literal>. + On windows platforms, <literal>G_make</literal> calls the <literal>nmake</literal> utility for building target <literal>dllname</literal> and it + returns the value of <literal>dllname</literal> in the variable <literal>Rfiles</literal>. + Of course <literal>G_make</literal> will work if appropriate Makefiles are + provided in the current Scilab directory. + </para> + <para> + <literal>G_make</literal> can be used to provide OS independent call to addinter. + </para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example"><![CDATA[ +if getos() == 'Windows' then + txt = ['ex1c.dll:', + ' @echo ------------------------------------------', + ' @echo From Makefile.mak', + ' @echo ------------------------------------------', + ' ']; + mputl(txt,TMPDIR+'/makefile.mak') + current_dir = pwd(); + cd TMPDIR + files=G_make([TMPDIR+'/ex1cI.o',TMPDIR+'/ex1c.o'],'ex1c.dll');// compilation + // + //addinter(files,'foobar','foubare'); // link + cd(current_dir); +end + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="addinter">addinter</link> + </member> + <member> + <link linkend="api_scilab">api_scilab</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/addchapter.sce b/modules/dynamic_link/help/en_US/addchapter.sce new file mode 100755 index 000000000..eb784b168 --- /dev/null +++ b/modules/dynamic_link/help/en_US/addchapter.sce @@ -0,0 +1,11 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009 - DIGITEO +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +add_help_chapter("Dynamic/incremental Link",SCI+"/modules/dynamic_link/help/en_US",%T); + diff --git a/modules/dynamic_link/help/en_US/addinter.xml b/modules/dynamic_link/help/en_US/addinter.xml new file mode 100755 index 000000000..7c06f8029 --- /dev/null +++ b/modules/dynamic_link/help/en_US/addinter.xml @@ -0,0 +1,203 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - + * Copyright (C) DIGITEO - 2009 - Allan CORNET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="addinter" xml:lang="en"> + <refnamediv> + <refname>addinter</refname> + <refpurpose>new functions interface dynamic link at run time.</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>addinter(files, spname, fcts)</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>files</term> + <listitem> + <para>a character string or a vector of character string contain + object files used to define the new Scilab interface routine + (interface code, user routines or libraries, system + libraries). + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>spname</term> + <listitem> + <para>a character string. Name of interface routine entry + point + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>fcts</term> + <listitem> + <para>vector of character strings. The name of new Scilab function + implemented in the new interface (in <literal> fin</literal> the + order ). + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para> + <literal>addinter</literal> performs dynamic link of a compiled C or + Fortran new Scilab interface routine and define corresponding scilab + functions. + </para> + <para> + You can use the command <literal>link('show')</literal> to get the + number of the shared libraries. And to reload a new version of an + interface a call to <literal>ulink</literal> is necessary to get rid of + the old version. + </para> + <para> + See <literal>link</literal> for more precision on use. + </para> + <para>Number of 'addinter' in a scilab session can be limited by the + operating system. On Windows, you cannot load more than 80 dynamic + libraries at the same time. + </para> + <para>Number of functions implemented in a interface is limited to + 1000. + </para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example"><![CDATA[ if haveacompiler() then + +chdir(TMPDIR); +mkdir('example_addinter'); +chdir('example_addinter'); + +src = ['#include <math.h>' +'#include <api_scilab.h>' +'#include <Scierror.h>' +'#include <localization.h>' +'' +'static double fun2(double x);' +'' +'void fun1(double *x,double *y) ' +'{' +' *y=fun2(*x)/(*x); ' +'} ' +'' +'static double fun2(double x)' +'{ ' +' return( sin(x+1));' +'}' +'' +'int sci_fun1(char *fname)' +'{' +' int iType1 = 0;' +' SciErr sciErr;' +' int m1 = 0, n1 = 0;' +' double *pdVarOne = NULL;' +' int *piAddressVarOne = NULL;' +'' +' CheckRhs(1,1);' +' CheckLhs(1,1);' +'' +' sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddressVarOne);' +' if(sciErr.iErr)' +' {' +' printError(&sciErr, 0);' +' return 0;' +' }' +'' +' sciErr = getVarType(pvApiCtx, piAddressVarOne, &iType1);' +' if(sciErr.iErr)' +' {' +' printError(&sciErr, 0);' +' return 0;' +' }' +'' +' if (iType1 != sci_matrix)' +' {' +' Scierror(999,_(""%s: Wrong type for input argument #%d: A string expected.\n""), fname, 1);' +' return 0;' +' }' +'' +' sciErr = getMatrixOfDouble(pvApiCtx, piAddressVarOne, &m1, &n1, &pdVarOne);' +' if(sciErr.iErr)' +' {' +' printError(&sciErr, 0);' +' return 0;' +' }' +'' +' fun1(pdVarOne, pdVarOne);' +' LhsVar(1) = 1;' +' return 0;' +'}']; + +mputl(src,TMPDIR + '/example_addinter/example_addinter.c'); +files=['example_addinter.c']; +ilib_build('addinter',['fun1_in_scilab','sci_fun1'],files,[]); +disp(mgetl('loader.sce')); +exec loader.sce; +fun1_in_scilab(%pi) + +end // if haveacompiler() +]]></programlisting> + <refsection> + <title>Generated loader.sce with addinter</title> + </refsection> + <programlisting role="example"><![CDATA[// This file is released under the 3-clause BSD license. See COPYING-BSD. +// Generated by builder.sce : Please, do not edit this file +// ---------------------------------------------------------------------------- +// +addinter_path = get_absolute_file_path('loader.sce'); +// +// ulink previous function with same name +[bOK, ilib] = c_link('addinter'); +if bOK then + ulink(ilib); +end +// +list_functions = [ 'fun1_in_scilab']; +// +// here we call addinter +addinter(addinter_path + filesep() + 'addinter' + getdynlibext(), 'addinter', list_functions); +// remove temp. variables on stack +clear addinter_path; +clear bOK; +clear ilib; +clear list_functions; +// ---------------------------------------------------------------------------- +]]></programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="link">link</link> + </member> + <member> + <link linkend="intersci">intersci</link> + </member> + <member> + <link linkend="newfun">newfun</link> + </member> + <member> + <link linkend="clearfun">clearfun</link> + </member> + <member> + <link linkend="api_scilab">api_scilab</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/c_link.xml b/modules/dynamic_link/help/en_US/c_link.xml new file mode 100755 index 000000000..36fc2b730 --- /dev/null +++ b/modules/dynamic_link/help/en_US/c_link.xml @@ -0,0 +1,114 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - + * Copyright (C) DIGITEO - 2011 - Allan CORNET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="c_link" xml:lang="en"> + <refnamediv> + <refname>c_link</refname> + <refpurpose>check if symbol loaded with dynamic link</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>c_link(routine_name) + [test, ilib] = c_link(routine_name) + test = c_link(routine_name,num) + </synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>routine_name</term> + <listitem> + <para>a character string</para> + </listitem> + </varlistentry> + <varlistentry> + <term>num</term> + <listitem> + <para>number of the shared library where routine_name is searched + (-1: default, last used) + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>test</term> + <listitem> + <para>boolean, indicates if there is a shared library which contains + <literal>routine_name</literal>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>ilib</term> + <listitem> + <para>a scalar, the number of the shared library which contains + <literal>routine_name</literal> + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para> + <literal>c_link</literal> is a boolean function which checks if the + routine <literal>routine_name</literal> is currently linked. This function + returns a boolean value true or false. When used with two return values, + the function <literal>c_link</literal> returns a boolean value in + <literal>test</literal> and the number of the shared library which + contains <literal>routine_name</literal> in <literal>ilib</literal> (when + <literal>test</literal> is true). + </para> + </refsection> + <refsection> + <title>Examples (C code)</title> + <programlisting role="example">if haveacompiler() then + chdir(TMPDIR) + f1=['int ext1c(int *n, double *a, double *b, double *c)' + '{int k;' + ' for (k = 0; k < *n; ++k) ' + ' c[k] = a[k] + b[k];' + ' return(0);}']; + + mputl(f1, TMPDIR + '/fun1.c'); + //creating the shared library (a gateway, a Makefile and a loader are + //generated. + ilib_for_link('ext1c','fun1.c',[],"c"); + // load the shared library + exec loader.sce; + // show link + link('show') + + [test, ilib] = c_link('ext1c') // check if 'ext1c' symbol is linked in scilab (it returns %T, ilib equals to 0) + c_link('ext1c', -1) // check if 'ext1c' linked in scilab in current library (last used) (it returns %T) + c_link('ext1c', 0) // check in library (id eqs 0) if 'ext1c' is linked (it returns %T) + c_link('ext1c', 1) // 'ext1c' not in library with id = 1 (it returns %F) + c_link('toto') // returns %F 'toto' not linked to scilab (it returns %F) + end + </programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="link">link</link> + </member> + <member> + <link linkend="fort">fort</link> + </member> + <member> + <link linkend="api_scilab">api_scilab</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/call.xml b/modules/dynamic_link/help/en_US/call.xml new file mode 100755 index 000000000..6bad5442a --- /dev/null +++ b/modules/dynamic_link/help/en_US/call.xml @@ -0,0 +1,276 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - + * Copyright (C) DIGITEO - 2012 - Allan CORNET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="call" xml:lang="en"> + <refnamediv> + <refname>call</refname> + <refpurpose>Fortran or C user routines call</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>// long form 'out' is present + [y1,...,yk] = call("ident",x1,px1,"tx1",...,xn,pxn,"txn","out",[ny1,my1],py1,"ty1",...,[nyl,myl],pyl,"tyl") + // short form : no 'out' parameter + [y1,....,yk] = call("ident",x1,...,xn) + </synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>"ident"</term> + <listitem> + <para>string.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>xi</term> + <listitem> + <para>real matrix or string</para> + </listitem> + </varlistentry> + <varlistentry> + <term>pxi, pyi</term> + <listitem> + <para>integers</para> + </listitem> + </varlistentry> + <varlistentry> + <term>txi, tyi</term> + <listitem> + <para> + character string <literal>"d"</literal>, + <literal>"r"</literal>, <literal>"i"</literal> or + <literal>"c"</literal>. + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para>Interactive call of Fortran (or C) user program from Scilab. The + routine must be previously linked with Scilab. This link may be + done: + </para> + <itemizedlist> + <listitem> + <para> + with Scilab "<literal>link</literal>" command (dynamical + linking) during the Scilab session.(see + <literal>link</literal>) + </para> + <para>On Windows, C functions must use cdecl calling convention name + (see options in your C compiler(default calling convention for x86 C + compilers)). + </para> + </listitem> + </itemizedlist> + <para>There are two forms of calling syntax, a short one and a long one. + The short one will give faster code and an easier calling syntax but one + has to write a small (C or Fortran) interface in order to make the short + form possible. The long one make it possible to call a Fortran routine (or + a C one) whitout modification of the code but the syntax is more complex + and the interpreted code slower. + </para> + <para>The meaning of each parameter is described now:</para> + <variablelist> + <varlistentry> + <term>"ident"</term> + <listitem> + <para>is the name of the called subroutine.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>x1,...,xn</term> + <listitem> + <para>are input variables (real matrices or strings) sent to the + routine, + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>px1,...,pxn</term> + <listitem> + <para>are the respective positions of these variables in the calling + sequence of the routine <literal>"ident"</literal> and + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>tx1,...,txn</term> + <listitem> + <para> + are their types (<literal>"r"</literal>, + <literal>"i"</literal>, <literal>"d"</literal> and + <literal>"c"</literal> for real (float) , integer, double precision + and strings) + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>"out"</term> + <listitem> + <para>is a keyword used to separate input variables from output + variables. when this key word is present it is assumed that the long + form will be used and when it is not prsent, the short form is + used. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>[ny1, my1]</term> + <listitem> + <para> + are the size (<literal>#</literal> of rows and columns. For + 'c' arguments,<literal>m1*n1</literal> is the number of charaters ) + of output variables and + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>py1, ...</term> + <listitem> + <para>are the positions of output variables (possibly equal to + <literal>pxi</literal> ) in the calling sequence of the routine. The + <literal>pyi</literal>'s integers must be in increasing + order. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>"ty1", ...</term> + <listitem> + <para>are the Fortran types of output variables. The + <literal>k</literal> first output variables are put in + <literal>y1,..., yk</literal>. + </para> + </listitem> + </varlistentry> + </variablelist> + <para>If an output variable coincides with an input variable (i.e. + <literal>pyi=pxj</literal> ) one can pass only its position + <literal>pyi</literal> . The size and type of <literal>yi</literal> are + then the same as those of <literal>xi</literal>. If an output variable + coincides with an input variable and one specify the dimensions of the + output variable <literal>[myl,nyl]</literal> must follow the compatibility + condition <literal>mxk*nxk >= myl*nyl</literal>. + </para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example">//Example 1 with a simple C code + f1=['#include <math.h>' + 'void fooc(double c[],double a[],double *b,int *m,int *n)' + '{' + ' int i;' + ' for ( i =0 ; i < (*m)*(*n) ; i++) ' + ' c[i] = sin(a[i]) + *b; ' + '}']; + + mputl(f1,'fooc.c') + + //creating the shared library (a gateway, a Makefile and a loader are + //generated. + + ilib_for_link('fooc','fooc.c',[],"c") + + // load the shared library + + exec loader.sce + + //using the new primitive + a=[1,2,3;4,5,6];b= %pi; + [m,n]=size(a); + + // Inputs: + // a is in position 2 and double + // b 3 double + // n 4 integer + // m 5 integer + // Outputs: + // c is in position 1 and double with size [m,n] + c=call("fooc",a,2,"d",b,3,"d",m,4,"i",n,5,"i","out",[m,n],1,"d"); + + //Example 2 with a simple Fortran code + f1=[' subroutine foof(c,a,b,n,m)' + ' integer n,m' + ' double precision a(*),b,c(*)' + ' do 10 i=1,m*n ' + ' c(i) = sin(a(i))+b' + ' 10 continue' + ' end']; + mputl(f1,'foof.f') + + //creating the shared library (a gateway, a Makefile and a loader are + //generated. + + ilib_for_link('foof','foof.f',[],"f") + + // load the shared library + + exec loader.sce + + //using the new primitive + a=[1,2,3;4,5,6];b= %pi; + [m,n]=size(a); + c=call("foof",a,2,"d",b,3,"d",m,4,"i",n,5,"i","out",[m,n],1,"d"); + </programlisting> + <refsection> + <title>Limitations to Shared Library Support</title> + <para>Scilab shared library interface (call function) supports only C and fortran + libraries routines. + </para> + <para> + In others cases, we recommend to use <link linkend="api_scilab">api_scilab</link> interfaces. + </para> + <title>Troubleshooting Shared Library Applications (Windows)</title> + <para>Some shared libraries, compiled as Microsoft Windows 32 or 64 bit + libraries, use a calling convention that is incompatible with the + default Scilab calling convention. + </para> + <para>The default calling convention for Scilab and for Microsoft C and + C++ compilers is cdecl. + </para> + <para> + For more information, see the <ulink url="http://msdn.microsoft.com/en-us/library/k2b2ssfy.aspx">MSDN® + Calling Conventions + </ulink> + and <ulink url="http://en.wikipedia.org/wiki/X86_calling_conventions#cdecl"> + Wikipedia + </ulink> + articles. + </para> + </refsection> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="link">link</link> + </member> + <member> + <link linkend="c_link">c_link</link> + </member> + <member> + <link linkend="intersci">intersci</link> + </member> + <member> + <link linkend="addinter">addinter</link> + </member> + <member> + <link linkend="api_scilab">api_scilab</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/chooselcccompiler.xml b/modules/dynamic_link/help/en_US/chooselcccompiler.xml new file mode 100755 index 000000000..44d6fd5b4 --- /dev/null +++ b/modules/dynamic_link/help/en_US/chooselcccompiler.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - Allan CORNET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="chooselcccompiler"> + <refnamediv> + <refname>chooselcccompiler</refname> + <refpurpose>moved as toolbox in ATOMS</refpurpose> + </refnamediv> +</refentry> diff --git a/modules/dynamic_link/help/en_US/configure_msifort.xml b/modules/dynamic_link/help/en_US/configure_msifort.xml new file mode 100755 index 000000000..ff8b66d48 --- /dev/null +++ b/modules/dynamic_link/help/en_US/configure_msifort.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) DIGITEO - Allan CORNET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="configure_msifort" xml:lang="en"> + <refnamediv> + <refname>configure_ifort</refname> + <refpurpose>set environments variables for Intel Fortran Compiler + (Windows). + </refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>bOK=configure_msifort()</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>bOK</term> + <listitem> + <para>returns %T if environments variables for Intel fortran (9 or + 10) Compiler are OK. + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para>set environments variables for Intel fortran (9 or 10) + Compiler. + </para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example"><![CDATA[ +bOK = configure_msifort() + ]]></programlisting> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/configure_msvc.xml b/modules/dynamic_link/help/en_US/configure_msvc.xml new file mode 100755 index 000000000..816451194 --- /dev/null +++ b/modules/dynamic_link/help/en_US/configure_msvc.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - Allan CORNET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="configure_msvc"> + <refnamediv> + <refname>configure_msvc</refname> + <refpurpose>set environments variables for Microsoft C Compiler.</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>bOK=configure_msvc()</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>bOK</term> + <listitem> + <para>returns %T if environments variables for Ms C Compiler are OK. </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para>set environments variables for Microsoft C Compiler.</para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example"><![CDATA[ +bOK=configure_msvc() + ]]></programlisting> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/dllinfo.xml b/modules/dynamic_link/help/en_US/dllinfo.xml new file mode 100755 index 000000000..9090ee389 --- /dev/null +++ b/modules/dynamic_link/help/en_US/dllinfo.xml @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) DIGITEO - Allan CORNET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="dllinfo" xml:lang="en"> + <refnamediv> + <refname>dllinfo</refname> + <refpurpose>provides information about the format and symbols provided in + executable and DLL files (Windows). + </refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>infolist = dllinfo(filename,option)</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>filename</term> + <listitem> + <para>a string : a filename .dll or .exe file</para> + </listitem> + </varlistentry> + <varlistentry> + <term>option</term> + <listitem> + <para>a string : 'machine' , 'exports' , 'imports'</para> + </listitem> + </varlistentry> + <varlistentry> + <term>infolist</term> + <listitem> + <para>a list :</para> + <para>infolist(1) : a string : name of dll or executable.</para> + <para>infolist(2) : a string matrix : symbols (imported or exported) + or machine type (x86 or x64). + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para>This tool provides information about the format and symbols + (imported or exported) provided in executable and DLL files. + </para> + <para>This tool is based on dumpbin.exe. A tool provided with Visual + studio SDK. + </para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example"><![CDATA[ +if getos() == "Windows" then + filename = SCI + "\bin\api_scilab.dll"; + + dllinfolist = dllinfo(filename, "machine"); + mprintf("Machine destination of %s: %s\n", dllinfolist(1), dllinfolist(2)); + + dllinfolist = dllinfo(filename, "imports"); + mprintf("Dlls dependencies of %s:\n", filename); + for i=1:size(dllinfolist) + mprintf("%s\n",dllinfolist(i)(1)); + end + + dllinfolist = dllinfo(filename, "exports"); + mprintf("Dll exports of %s:\n", filename); + disp(dllinfolist); +end + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="addinter">addinter</link> + </member> + <member> + <link linkend="link">link</link> + </member> + <member> + <link linkend="ilib_compile">ilib_compile</link> + </member> + <member> + <link linkend="ilib_gen_Make">ilib_gen_Make</link> + </member> + <member> + <link linkend="ilib_gen_gateway">ilib_gen_gateway</link> + </member> + <member> + <link linkend="ilib_gen_loader">ilib_gen_loader</link> + </member> + <member> + <link linkend="ilib_for_link">ilib_for_link</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/findmsifortcompiler.xml b/modules/dynamic_link/help/en_US/findmsifortcompiler.xml new file mode 100755 index 000000000..d7ab4385e --- /dev/null +++ b/modules/dynamic_link/help/en_US/findmsifortcompiler.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) DIGITEO - Allan CORNET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="findmsifortcompiler" xml:lang="en"> + <refnamediv> + <refname>findmsifortcompiler</refname> + <refpurpose>detects Intel fortran Compiler</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>ifortv = findmsifortcompiler()</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>ifortv</term> + <informaltable border="1"> + <tr> + <td>string</td> + <td>Intel Fortran version</td> + </tr> + <tr> + <td>ifort90</td> + <td>Intel Fortran 9.x</td> + </tr> + <tr> + <td>ifort10</td> + <td>Intel Fortran 10.x</td> + </tr> + <tr> + <td>ifort11</td> + <td>Intel Fortran 11.x</td> + </tr> + <tr> + <td>ifort12</td> + <td>Intel Fortran 12.x (beta support)</td> + </tr> + <tr> + <td>unknown</td> + <td>not detected or unknown version.</td> + </tr> + </informaltable> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para>detects Intel fortran Compiler (Windows).</para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example"><![CDATA[ +ifortv = findmsifortcompiler() + ]]></programlisting> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/findmsvccompiler.xml b/modules/dynamic_link/help/en_US/findmsvccompiler.xml new file mode 100755 index 000000000..f1fab7f6d --- /dev/null +++ b/modules/dynamic_link/help/en_US/findmsvccompiler.xml @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - Allan CORNET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="findmsvccompiler"> + <refnamediv> + <refname>findmsvccompiler</refname> + <refpurpose>detects Microsoft C Compiler</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>msvc = findmsvccompiler()</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>msvc</term> + <listitem> + <para>returns a string to identify Visual studio version.</para> + <informaltable border="1"> + <tr> + <td>string</td> + <td>Visual Studio version</td> + </tr> + <tr> + <td>msvc70</td> + <td>Microsoft Visual Studio 2002 Professional or above.</td> + </tr> + <tr> + <td>msvc71</td> + <td>Microsoft Visual Studio 2003 Professional or above.</td> + </tr> + <tr> + <td>msvc80express</td> + <td>Microsoft Visual Studio 2005 Express Edition.</td> + </tr> + <tr> + <td>msvc80std</td> + <td>Microsoft Visual Studio 2005 Standard Edition.</td> + </tr> + <tr> + <td>msvc80pro</td> + <td>Microsoft Visual Studio 2005 Professional or above.</td> + </tr> + <tr> + <td>msvc90express</td> + <td>Microsoft Visual Studio 2008 Express Edition.</td> + </tr> + <tr> + <td>msvc90std</td> + <td>Microsoft Visual Studio 2008 Standard Edition.</td> + </tr> + <tr> + <td>msvc90pro</td> + <td>Microsoft Visual Studio 2008 Professional or above.</td> + </tr> + <tr> + <td>msvc100express</td> + <td>Microsoft Visual Studio 2010 Express Edition</td> + </tr> + <tr> + <td>msvc100pro</td> + <td>Microsoft Visual Studio 2010 Professional or above.</td> + </tr> + <tr> + <td>unknown</td> + <td>not detected or unknown version.</td> + </tr> + </informaltable> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para>detects Microsoft C Compiler.</para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example"><![CDATA[ +msvc = findmsvccompiler() + ]]></programlisting> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/fort.xml b/modules/dynamic_link/help/en_US/fort.xml new file mode 100755 index 000000000..97e2890b1 --- /dev/null +++ b/modules/dynamic_link/help/en_US/fort.xml @@ -0,0 +1,230 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="fort" xml:lang="en"> + <refnamediv> + <refname>fort</refname> + <refpurpose>Fortran or C user routines call</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>// long form 'out' is present + [y1,...,yk] = fort("ident",x1,px1,"tx1",...,xn,pxn,"txn","out",[ny1,my1],py1,"ty1",...,[nyl,myl],pyl,"tyl") + // short form : no 'out' parameter + [y1,....,yk] = fort("ident",x1,...,xn) + </synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>"ident"</term> + <listitem> + <para>string.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>xi</term> + <listitem> + <para>real matrix or string</para> + </listitem> + </varlistentry> + <varlistentry> + <term>pxi, pyi</term> + <listitem> + <para>integers</para> + </listitem> + </varlistentry> + <varlistentry> + <term>txi, tyi</term> + <listitem> + <para> + character string <literal>"d"</literal>, + <literal>"r"</literal>, <literal>"i"</literal> or + <literal>"c"</literal>. + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para>Interactive call of Fortran (or C) user program from Scilab. The + routine must be previously linked with Scilab. This link may be + done: + </para> + <itemizedlist> + <listitem> + <para> + with Scilab "<literal>link</literal>" command (dynamic link) + during the Scilab session.(see <literal>link</literal>) + </para> + </listitem> + </itemizedlist> + <para>There are two forms of calling syntax, a short one and a long one. + The short one will give faster code and an easier calling syntax but one + has to write a small (C or Fortran) interface in order to make the short + form possible. The long one make it possible to call a Fortran routine (or + a C one) whitout modification of the code but the syntax is more complex + and the interpreted code slower. + </para> + <para>The meaning of each parameter is described now:</para> + <variablelist> + <varlistentry> + <term>"ident"</term> + <listitem> + <para>is the name of the called subroutine.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>x1,...,xn</term> + <listitem> + <para>are input variables (real matrices or strings) sent to the + routine, + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>px1,...,pxn</term> + <listitem> + <para>are the respective positions of these variables in the calling + sequence of the routine <literal>"ident"</literal> and + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>tx1,...,txn</term> + <listitem> + <para> + are their types (<literal>"r"</literal>, + <literal>"i"</literal>, <literal>"d"</literal> and + <literal>"c"</literal> for real (float) , integer, double precision + and strings) + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>"out"</term> + <listitem> + <para>is a keyword used to separate input variables from output + variables. when this key word is present it is assumed that the long + form will be used and when it is not prsent, the short form is + used. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>[ny1, my1]</term> + <listitem> + <para>are the size (number of rows and columns. For 'c' + arguments,<literal>m1*n1</literal> is the number of charaters ) of + output variables and + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>py1, ...</term> + <listitem> + <para>are the positions of output variables (possibly equal to + <literal>pxi</literal> ) in the calling sequence of the routine. The + <literal>pyi</literal>'s integers must be in increasing + order. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>"ty1", ...</term> + <listitem> + <para>are the Fortran types of output variables. The + <literal>k</literal> first output variables are put in + <literal>y1,..., yk</literal>. + </para> + </listitem> + </varlistentry> + </variablelist> + <para>If an output variable coincides with an input variable (i.e. + <literal>pyi=pxj</literal> ) one can pass only its position + <literal>pyi</literal> . The size and type of <literal>yi</literal> are + then the same as those of <literal>xi</literal>. If an output variable + coincides with an input variable and one specify the dimensions of the + output variable <literal>[myl,nyl]</literal> must follow the compatibility + condition <literal>mxk*nxk >= myl*nyl</literal>. + </para> + <para>For example the following program:</para> + <programlisting role=""><![CDATA[ +subroutine foof(c,a,b,n,m) + integer n,m + double precision a(*),b,c(*) + do 10 i=1,m*n + c(i) = sin(a(i))+b + 10 continue +end + ]]></programlisting> + <programlisting role=""><![CDATA[ +link("foof"+getdynlibext(),"foof") +a=[1,2,3;4,5,6];b= %pi; +[m,n]=size(a); +// Inputs: +// a is in position 2 and double +// b 3 double +// n 4 integer +// m 5 integer +// Outputs: +// c is in position 1 and double with size [m,n] +c=fort("foof",a,2,"d",b,3,"d",n,4,"i",m,5,"i","out",[m,n],1,"d"); + ]]></programlisting> + <para> + returns the matrix <literal>c=2*a+b</literal>. + </para> + <para>The same example coded in C:</para> + <programlisting role=""><![CDATA[ +void fooc(c,a,b,m,n) +double a[],*b,c[]; +int *m,*n; +{ + double sin(); + int i; + for ( i =0 ; i < (*m)*(*n) ; i++) + c[i] = sin(a[i]) + *b; +} +]]></programlisting> + <programlisting role=""><![CDATA[ +link("fooc"+getdynlibext(),"fooc","C") // note the third argument +a=[1,2,3;4,5,6];b= %pi; +[m,n]=size(a); +c=fort("fooc",a,2,"d",b,3,"d",m,4,"i",n,5,"i","out",[m,n],1,"d"); + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="call">call</link> + </member> + <member> + <link linkend="link">link</link> + </member> + <member> + <link linkend="c_link">c_link</link> + </member> + <member> + <link linkend="intersci">intersci</link> + </member> + <member> + <link linkend="addinter">addinter</link> + </member> + <member> + <link linkend="api_scilab">api_scilab</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/getdynlibext.xml b/modules/dynamic_link/help/en_US/getdynlibext.xml new file mode 100755 index 000000000..0ef7e5954 --- /dev/null +++ b/modules/dynamic_link/help/en_US/getdynlibext.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - Allan CORNET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="getdynlibext"> + <refnamediv> + <refname>getdynlibext</refname> + <refpurpose>get the extension of dynamic libraries on your operating system.</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>ret=getdynlibext()</synopsis> + </refsynopsisdiv> + <refsection> + <title>Description</title> + <para>get the extension of dynamic libraries on your operating system.</para> + <para>ret=getdynlibext() returns (.so on linux, .dylib on MacOS, .sl HP-UX,.dll on Windows, ...).</para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example"><![CDATA[ +getdynlibext() + ]]></programlisting> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/haveacompiler.xml b/modules/dynamic_link/help/en_US/haveacompiler.xml new file mode 100755 index 000000000..03dbaa43b --- /dev/null +++ b/modules/dynamic_link/help/en_US/haveacompiler.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - Allan CORNET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="haveacompiler"> + <refnamediv> + <refname>haveacompiler</refname> + <refpurpose>detect if you have a C compiler.</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>bOK=haveacompiler()</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>bOK</term> + <listitem> + <para>returns %T a C compiler has been found.</para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para>Detect if a C compiler is available on the system.</para> + <para> + <note> + Please note that due to the multi vendors aspect in the Unix world (Mac OS X, Unix or various GNU/Linux distributions), this function always returns True for these operating system. + </note> + </para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example"><![CDATA[ +bOK = haveacompiler(); + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="supported_compilers">supported compilers</link> + </member> + <member> + <link linkend="findmsvccompiler">findmsvccompiler</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/ilib_build.xml b/modules/dynamic_link/help/en_US/ilib_build.xml new file mode 100755 index 000000000..7981e9e77 --- /dev/null +++ b/modules/dynamic_link/help/en_US/ilib_build.xml @@ -0,0 +1,595 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="ilib_build" xml:lang="en"> + <refnamediv> + <refname>ilib_build</refname> + <refpurpose>utility for shared library management</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>ilib_build(lib_name,table,files,libs [,makename,ldflags,cflags,fflags,ismex, cc])</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>lib_name</term> + <listitem> + <para>a character string, the generic name of the library without + path and extension. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>table</term> + <listitem> + <para>2 column string matrix giving the table of pairs + 'scilab-name', 'interface name' + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>files</term> + <listitem> + <para>string matrix giving source files needed for shared library creation. Since Scilab 5.3.1, object files are deprecated.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>libs</term> + <listitem> + <para>string matrix giving extra libraries needed for shared library + creation + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>makename</term> + <listitem> + <para>character string. The path of the Makefile file without extension.</para> + <para>This parameter is useless since Scilab 5.0. Default value to use: [].</para> + <para>A warning will be displayed in Scilab 5.3 if you use another value that the default.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>ldflags,cflags,fflags</term> + <listitem> + <para>character strings to provide options for the loader, the C + compiler and the Fortran compiler. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>ismex</term> + <listitem> + <para>Internal variable to specify if we are working with mex or + not. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>cc</term> + <listitem> + <para>Provide the name of the C compiler.</para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para>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 <literal>addinter</literal> + </para> + <para>Many examples are provided in + <literal>SCI/modules/dynamic_link/examples</literal> directory. They are + all released into the public domain. + </para> + <para> + <emphasis role="bold">Note that a compiler must be available on the + system to use this function. + </emphasis> + </para> + <para> + <emphasis role="bold">Languages handle by this function are: C, C++, + Fortran and Fortran 90. + </emphasis> + </para> + <para> + On the internal technical level, under GNU/Linux and Mac OS X, the ilib_* function are based on the autotools. First, a configure is executed to detect compilers available. Then, a make is launched with the provided arguments. For more information: <ulink url="http://wiki.scilab.org/Full%20technical%20description%20of%20the%20incremental%20link">Full technical description of the incremental link / dynamic link</ulink> + </para> + <para> + Since version 5.3.2, under GNU/Linux, Scilab detects where the libstdc++ is located (thanks to the command <emphasis role="italic">gcc -print-search-dirs|grep ^install:|awk '{print $2}'</emphasis>). Previously, the dynamic link was using the libstdc++ embedded in Scilab. + </para> + </refsection> + <refsection> + <title>Examples (C code)</title> + <programlisting role="example"><![CDATA[ +//Here with give a complete example on adding new primitive to Scilab +//create the procedure files + +cd TMPDIR; +mkdir('example_ilib_build_c'); +cd('example_ilib_build_c'); + +f1=['extern double fun2();' + 'void fun1(double *x, double *y)' + '{*y=fun2(*x)/(*x);}']; + +mputl(f1,TMPDIR + '/example_ilib_build_c/fun1.c'); + +f2=['#include <math.h>' + 'double fun2(double x)' + '{ return( sin(x+1.));}']; +mputl(f2,TMPDIR + '/example_ilib_build_c/fun2.c'); + +//creating the interface file +i=['#include <stdlib.h>' + '#include <api_scilab.h>' + '#include <Scierror.h>' + '#include <localization.h>' + '' + 'extern int fun1 ( double *x, double *y);' + '' + 'int sci_fun1(char *fname)' + '{' + ' int iType1 = 0;' + ' SciErr sciErr;' + ' int m1 = 0, n1 = 0;' + ' double *pdVarOne = NULL;' + ' int *piAddressVarOne = NULL;' + '' + ' CheckRhs(1,1);' + ' CheckLhs(1,1);' + '' + ' sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddressVarOne);' + ' if(sciErr.iErr)' + ' {' + ' printError(&sciErr, 0);' + ' return 0;' + ' }' + '' + ' sciErr = getVarType(pvApiCtx, piAddressVarOne, &iType1);' + ' if(sciErr.iErr)' + ' {' + ' printError(&sciErr, 0);' + ' return 0;' + ' }' + '' + ' if (iType1 != sci_matrix)' + ' {' + ' Scierror(999,_(""%s: Wrong type for input argument #%d: A string expected.\n""), fname, 1);' + ' return 0;' + ' }' + '' + ' sciErr = getMatrixOfDouble(pvApiCtx, piAddressVarOne, &m1, &n1, &pdVarOne);' + ' if(sciErr.iErr)' + ' {' + ' printError(&sciErr, 0);' + ' return 0;' + ' }' + '' + ' fun1(pdVarOne, pdVarOne);' + ' LhsVar(1) = 1;' + ' return 0;' + '}']; +mputl(i,TMPDIR + '/example_ilib_build_c/sci_fun1.c'); + +//creating the shared library (a gateway, a Makefile and a loader are +//generated. + +files=['fun1.c','fun2.c','sci_fun1.c']; +ilib_build('build_c',['fun1','sci_fun1'],files,[]); + +// load the shared library + +exec loader.sce; + +//using the new primitive +fun1(33) +]]></programlisting> + </refsection> + <refsection> + <title>Examples (C code - previous Scilab API < 5.2)</title> + <programlisting role="example"><![CDATA[ +cd TMPDIR; +mkdir('example_ilib_build_c_old'); +cd('example_ilib_build_c_old'); + +//Here with give a complete example on adding new primitive to Scilab +//create the procedure files +f1=['extern double fun2();' + 'void fun1(double *x, double *y)' + '{*y=fun2(*x)/(*x);}']; + +mputl(f1,'fun1.c') + +f2=['#include <math.h>' + 'double fun2(double x)' + '{ return( sin(x+1.));}']; +mputl(f2,'fun2.c'); + +//creating the interface file +i=['#include ""stack-c.h""' + '#include ""stackTypeVariable.h""' + '#include ""version.h""' + '#if SCI_VERSION_MAJOR <= 5' + '#if SCI_VERSION_MINOR < 2' + ' #error ""This example is obsolete see help ilib_buid""' + '#endif' + '#endif' + '' + 'extern int fun1 ( double *x, double *y);' + 'int intfun1(char *fname)' + '{' + ' int m1,n1,l1;' + ' CheckRhs(1,1);' + ' CheckLhs(1,1);' + ' GetRhsVar(1, MATRIX_OF_DOUBLE_DATATYPE, &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.c','fun2.c','intfun1.c']; +ilib_build('ilib_c_old',['scifun1','intfun1'],files,[]); + +// load the shared library + +exec loader.sce + +//using the new primitive +scifun1(33) + ]]></programlisting> + </refsection> + <refsection> + <title>Examples (C++ code)</title> + <programlisting role="example"><![CDATA[ +cd TMPDIR; +mkdir('example_ilib_build_cpp'); +cd('example_ilib_build_cpp'); + +i=['#include <string>' + 'extern ""C"" {' + '#include <stdlib.h>' + '#include <api_scilab.h>' + '#include <localization.h>' + '#include <Scierror.h>' + '' + 'int sci_cppfind(char *fname)' + '{' + '' + ' SciErr sciErr;' + ' int *piAddressVarOne = NULL;' + ' char *pStVarOne = NULL;' + ' int iType1 = 0;' + ' int lenStVarOne = 0;' + ' int m1 = 0, n1 = 0;' + '' + ' int *piAddressVarTwo = NULL;' + ' char *pStVarTwo = NULL;' + ' int iType2 = 0;' + ' int lenStVarTwo = 0;' + ' int m2 = 0, n2 = 0;' + '' + ' int m_out = 0;' + ' int n_out = 0;' + '' + ' sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddressVarOne);' + ' if(sciErr.iErr)' + ' {' + ' printError(&sciErr, 0);' + ' return 0;' + ' }' + '' + ' sciErr = getVarType(pvApiCtx, piAddressVarOne, &iType1);' + ' if(sciErr.iErr)' + ' {' + ' printError(&sciErr, 0);' + ' return 0;' + ' }' + '' + ' if (iType1 != sci_strings)' + ' {' + ' Scierror(999,_(""%s: Wrong type for input argument #%d: A string expected.\n""), fname, 1);' + ' return 0;' + ' }' + '' + ' sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddressVarTwo);' + ' if(sciErr.iErr)' + ' {' + ' printError(&sciErr, 0);' + ' return 0;' + ' }' + '' + ' sciErr = getVarType(pvApiCtx, piAddressVarTwo, &iType2);' + ' if(sciErr.iErr)' + ' {' + ' printError(&sciErr, 0);' + ' return 0;' + ' }' + '' + ' if (iType2 != sci_strings)' + ' {' + ' Scierror(999,_(""%s: Wrong type for input argument #%d: A string expected.\n""), fname, 2);' + ' return 0;' + ' }' + '' + ' sciErr = getMatrixOfString(pvApiCtx, piAddressVarOne, &m1, &n1, &lenStVarOne, &pStVarOne);' + ' if(sciErr.iErr)' + ' {' + ' printError(&sciErr, 0);' + ' return 0;' + ' }' + '' + ' pStVarOne = new char[lenStVarOne + 1];' + ' if (pStVarOne == NULL)' + ' {' + ' Scierror(999,_(""%s: Memory allocation error.\n""),fname);' + ' return 0;' + ' }' + '' + ' sciErr = getMatrixOfString(pvApiCtx, piAddressVarTwo, &m2, &n2, &lenStVarTwo, &pStVarTwo);' + ' if(sciErr.iErr)' + ' {' + ' printError(&sciErr, 0);' + ' return 0;' + ' }' + '' + ' pStVarTwo = new char[lenStVarTwo + 1];' + ' if (pStVarTwo == NULL)' + ' {' + ' Scierror(999,_(""%s: Memory allocation error.\n""),fname);' + ' return 0;' + ' }' + '' + ' sciErr = getMatrixOfString(pvApiCtx, piAddressVarOne, &m1, &n1, &lenStVarOne, &pStVarOne);' + ' if(sciErr.iErr)' + ' {' + ' printError(&sciErr, 0);' + ' return 0;' + ' }' + '' + ' sciErr = getMatrixOfString(pvApiCtx, piAddressVarTwo, &m2, &n2, &lenStVarTwo, &pStVarTwo);' + ' if(sciErr.iErr)' + ' {' + ' printError(&sciErr, 0);' + ' return 0;' + ' }' + '' + ' std::string myMessage(pStVarOne);' + ' std::string search(pStVarTwo);' + + ' delete pStVarTwo;' + ' delete pStVarOne;' + + ' double dOut = 0.0;' + '' + ' if (myMessage.find(search) != std::string::npos) {' + ' dOut = myMessage.find(search); /* The actual operation */' + ' } else {' + ' dOut = -1; /* Substring not found */' + ' }' + + ' m_out = 1;' + ' n_out = 1;' + ' sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 1, m_out, n_out, &dOut);' + ' if(sciErr.iErr)' + ' {' + ' printError(&sciErr, 0);' + ' return 0;' + ' }' + '' + ' LhsVar(1) = Rhs + 1;' + ' return 0;' + '} /* extern ""C"" */' + '}']; + +mputl(i,TMPDIR + '/example_ilib_build_cpp/sci_cppfind.cxx'); + +//creating the shared library (a gateway, a Makefile and a loader are +//generated. + +files = ['sci_cppfind.cxx']; +ilib_build('ilib_build_cpp',['cppfind','sci_cppfind'],files,[]); + +// load the shared library + +exec loader.sce; + +// Small test to see if the function is actually working. +if cppfind("my very long string","long") <> 8 pause, end +if cppfind("my very long string","very") <> 3 pause, end +if cppfind("my very long string","short") <> -1 pause, end + ]]></programlisting> + </refsection> + <refsection> + <title>Examples (C++ code - previous Scilab API < 5.2)</title> + <programlisting role="example"><![CDATA[ +cd TMPDIR; +mkdir('example_ilib_build_cpp_old'); +cd('example_ilib_build_cpp_old'); + +i=['#include <string>' + 'extern ""C"" {' + '#include ""stack-c.h""' + '#include ""version.h""' + '#if SCI_VERSION_MAJOR <= 5' + '#if SCI_VERSION_MINOR < 2' + ' #error ""This example is obsolete see help ilib_buid""' + '#endif' + '#endif' + '' + 'int sci_cppfind(char *fname) {' + ' int m1 = 0, n1 = 0, l1;' + ' char *inputString1, *inputString2;' + ' int m2 = 0, n2 = 0, l2;' + ' int m3 = 0, n3 = 0;' + ' double *position = NULL; /* Where we will store the position */' + ' CheckRhs(2,2); /* Check the number of input argument */' + ' CheckLhs(1,1); /* Check the number of output argument */' + ' GetRhsVar(1, ""c"", &m1, &n1, &l1); /* Retrieve the first input argument */' + ' inputString1=cstk(l1);' + ' GetRhsVar(2, ""c"", &m2, &n2, &l2); /* Retrieve the second input argument */' + ' inputString2=cstk(l2);' + ' std::string myMessage (inputString1);' + ' std::string search (inputString2);' + ' m3=1;n3=1;' + ' position = new double[1];' + ' if (myMessage.find(search) != std::string::npos) {' + ' position[0] = myMessage.find(search); /* The actual operation */' + ' } else {' + ' position[0] = -1; /* Substring not found */' + ' }' + ' CreateVarFromPtr(Rhs+1,""d"",&m3,&n3,&position); /* Create the output argument */' + ' LhsVar(1) = Rhs+1;' + ' delete[] position;' + ' return 0;' + '}' + '}']; + +mputl(i,'sci_cppfind.cxx'); + +//creating the shared library (a gateway, a Makefile and a loader are +//generated. + +files=['sci_cppfind.cxx']; +ilib_build('foo_old',['cppfind','sci_cppfind'],files,[]); + +// load the shared library + +exec loader.sce + +// Small test to see if the function is actually working. +if cppfind("my very long string","long") <> 8 pause, end +if cppfind("my very long string","very") <> 3 pause, end +if cppfind("my very long string","short") <> -1 pause, end + ]]></programlisting> + </refsection> + <refsection> + <title>Examples (Fortran 90 code)</title> + <programlisting role="example"><![CDATA[ +cd TMPDIR; +mkdir('example_ilib_build_f90'); +cd('example_ilib_build_f90'); + +sourcecode=['subroutine incrdoublef90(x,y)' + ' implicit none' + ' double precision, intent(in) :: x' + ' double precision, intent(out) :: y' + ' y=x+1' + 'end subroutine incrdoublef90']; +mputl(sourcecode,'incrdoublef90.f90'); +libpath=ilib_for_link('incrdoublef90','incrdoublef90.f90',[],'f'); +exec loader.sce +n=1.; +m=call("incrdoublef90",n,1,"d","out",[1,1],2,"d"); +if abs(m-2.)>%eps then pause,end +n=2.; +m=call("incrdoublef90",n,1,"d","out",[1,1],2,"d"); +if abs(m-3.)>%eps then pause,end + ]]></programlisting> + </refsection> + <refsection> + <title>Example: How to use cflags arguments</title> + <programlisting role="example"><![CDATA[ +cd TMPDIR; +mkdir('example_ilib_build_cflag'); +cd('example_ilib_build_cflag'); + +csource = ['#include <stdlib.h>' + '#include <api_scilab.h>' + '#include <sciprint.h>' + '' + 'int sci_examplecflag(char *fname)' + '{' + '' + '#ifdef __MYDEF_FOR_THIS_FUNCTION__' + 'sciprint(""__MYDEF_FOR_THIS_FUNCTION__ detected !!!\n"");' + '#else' + 'sciprint(""__MYDEF_FOR_THIS_FUNCTION__ not detected !!!\n"");' + '#endif' + '' + ' LhsVar(1) = 0;' + ' return 0;' + '}']; + +mputl(csource, TMPDIR + '/example_ilib_build_cflag/sci_cflags.c'); + +//creating the shared library (a gateway, a Makefile and a loader are +//generated.) + +files=['sci_cflags.c']; + +// here we uses cflags argument and we define __MYDEF_FOR_THIS_FUNCTION__ +ilib_build('gw_c_flags',['examplecflag','sci_examplecflag'], files, [], [], '', '-D__MYDEF_FOR_THIS_FUNCTION__'); + +// load the shared library +exec loader.sce; + +//using the new primitive +examplecflag() // __MYDEF_FOR_THIS_FUNCTION__ detected !!! + +ulink(); +exec cleaner.sce; + +// and now +ilib_build('gw_c_flags',['examplecflag','sci_examplecflag'], files, []); +exec loader.sce; +examplecflag() // __MYDEF_FOR_THIS_FUNCTION__ not detected !!! + + + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="addinter">addinter</link> + </member> + <member> + <link linkend="link">link</link> + </member> + <member> + <link linkend="ilib_compile">ilib_compile</link> + </member> + <member> + <link linkend="ilib_gen_Make">ilib_gen_Make</link> + </member> + <member> + <link linkend="ilib_gen_gateway">ilib_gen_gateway</link> + </member> + <member> + <link linkend="ilib_gen_loader">ilib_gen_loader</link> + </member> + <member> + <link linkend="ilib_for_link">ilib_for_link</link> + </member> + <member> + <link linkend="api_scilab">api_scilab</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>History</title> + <revhistory> + <revision> + <revnumber>5.4.0</revnumber> + <revremark>This function no more accepts files with ".o" or ".obj" extensions as source files.</revremark> + </revision> + </revhistory> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/ilib_build_jar.xml b/modules/dynamic_link/help/en_US/ilib_build_jar.xml new file mode 100755 index 000000000..b495ed1cd --- /dev/null +++ b/modules/dynamic_link/help/en_US/ilib_build_jar.xml @@ -0,0 +1,146 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +* +* ====================================================================== +* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +* Copyright (C) 2013 - Scilab Enterprises - Simon MARCHETTO +* +* This file is distributed under the same license as the Scilab package. +* ======================================================================= +* +--> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:lang="en" xml:id="ilib_build_jar"> + <refnamediv> + <refname>ilib_build_jar</refname> + <refpurpose>Build Java packages from sources into a JAR file</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis> + ilib_build_jar(jarFilePath, packageNames[, sourcePath[, classPath, [, manifestFilePath]]]) + </synopsis> + </refsynopsisdiv> + <refsection> + <title>Parameters</title> + <variablelist> + <varlistentry> + <term>jarFilePath</term> + <listitem> + <para>A string, sets the destination file path of the JAR.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>packageNames</term> + <listitem> + <para>A string matrix, contains the names of packages that will be built and stored the JAR.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>sourcePaths</term> + <listitem> + <para>A string matrix, sets the paths to the packages Java source directories.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>classPaths</term> + <listitem> + <para>A string matrix (optional), sets the class paths of the dependencies needed for the build.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>manifestFilePath</term> + <listitem> + <para>A string (optional), sets the file path of the manifest data to include in the JAR.</para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para> + <literal>ilib_build_jar</literal> extends <link linkend="ilib_build">ilib_build</link>, which purpose is to build C/C++/Fortran libraries, to Java. In other words, <literal>ilib_build_jar</literal> allows to build Java libraries from a set of Java sources. A library in Java is a JAR file (Java archive, extension is <literal>.jar</literal>), which contains Java compiled packages (a Java package contains a set of classes sharing the same purpose), and a manifest file (to describe its content). + </para> + <para> + <literal>ilib_build_jar</literal> works like following. All the Java sources found in the given source directory paths <literal>sourcePaths</literal> are compiled. Then the JAR file specified in <literal>jarFilePath</literal> is created from all the compiled classes of all the packages declared in <literal>packageNames</literal>. <literal>ilib_build_jar</literal> relies on the <link linkend="jcompile">jcompile</link> function for compilation, and <link linkend="jcreatejar">jcreatejar</link> for JAR creation, no external tool is needed. + </para> + <para> + The following Java conventions should be followed when using <literal>ilib_build_jar</literal>. + A JAR file usually contains one package only, and its file name is often the same as the package. The Java package is usually organized in a class directory tree, and has a hierarchical naming pattern something like <literal>org.company.software.package</literal>, which the class directory tree follows. Each class location in the tree corresponds to its <literal>package</literal> declaration in the source. + </para> + <para> + <literal>ilib_build_jar</literal> can be used to create a JAR file with several packages, with any desired file name. The only requirement is that one package name at least must be declared, and each of the Java classes should belong to a package. + </para> + <para> + The build dependencies can be specified by setting the <literal>classPaths</literal> argument. It can be paths to JAR files or paths to directories containing Java compiled classes. + </para> + <para> + The file path to a manifest can be given, this one will be stored in the JAR, in the MANIFEST.MF file in META-INF folder. If the manifest file is not specified or does not exist, a default manifest will be created in the JAR. Note: if a manifest is given, it must contain a version attribute, otherwise the manifest in the JAR will be empty. + </para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example"><![CDATA[ +// Example of ilib_build_jar + +// Create org.scilab.test.mypackage package sources in TMPDIR +packageName = 'org.scilab.test.mypackage'; +packageSrcPath = fullfile(TMPDIR, packageName); + +// Create a source file in the package (in org/scilab/test/mypackage folder) +function addJavaSourceToPackage(className, packageName) + packagePath = strsubst(packageName, '.', filesep()); + packagePath = fullfile(packageSrcPath, packagePath); + mkdir(packagePath); + filePath = fullfile(packagePath, className + '.java'); + + sourceCode = [msprintf('package %s;', packageName); .. + msprintf('public class %s {}\n', className); + ]; + fd = mopen(filePath, 'wt'); + mputl(sourceCode, fd); + mclose(fd); +endfunction + +// Add 'Foo' and 'bar.Bar' classes to the package +addJavaSourceToPackage('Foo', packageName); +addJavaSourceToPackage('Bar', packageName + '.bar'); + +// Build the package +jarFilePath = fullfile(TMPDIR, packageName + '.jar'); +ilib_build_jar(jarFilePath, packageName, packageSrcPath); + +// Import and test the package +javaclasspath(jarFilePath); +jimport org.scilab.test.mypackage.Foo; +foo = Foo.new(); +jimport org.scilab.test.mypackage.bar.Bar; +bar = Bar.new(); + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="jcompile">jcompile</link> + </member> + <member> + <link linkend="jcreatejar">jcreatejar</link> + </member> + <member> + <link linkend="javaclasspath">javaclasspath</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>History</title> + <revhistory> + <revision> + <revnumber>5.5.0</revnumber> + <revremark> + Function introduced. + </revremark> + </revision> + </revhistory> + </refsection> +</refentry> + diff --git a/modules/dynamic_link/help/en_US/ilib_compile.xml b/modules/dynamic_link/help/en_US/ilib_compile.xml new file mode 100755 index 000000000..36bc34f61 --- /dev/null +++ b/modules/dynamic_link/help/en_US/ilib_compile.xml @@ -0,0 +1,114 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" scilab:needs-examples="no" xml:lang="en" xml:id="ilib_compile"> + <refnamediv> + <refname>ilib_compile</refname> + <refpurpose>ilib_build utility: executes the Makefile produced by ilib_gen_Make</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>libn=ilib_compile(lib_name,makename [,files,ldflags,cflags,fflags,cc])</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>lib_name</term> + <listitem> + <para>a character string, the generic name of the library without path and extension.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>makename</term> + <listitem> + <para>character string. The path of the Makefile file without extension.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>files</term> + <listitem> + <para>optional vector of character strings. If files is given the make is performed on each + target contained in files then a whole make is performed + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>libn</term> + <listitem> + <para>character string. The path of the actual generated shared library file.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>ldflags,cflags,fflags,cc</term> + <listitem> + <para>character strings to provide options/flags for the loader, the C compiler, the Fortran compiler. cc provides the name of the compiler.</para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para> + Utility function used by <literal>ilib_build</literal> + </para> + <para> + <warning>This function should not be used directly.</warning> + </para> + <para> + This executes the Makefile produced by <literal>ilib_gen_Make</literal>, compiles + the C and fortran files and generates the shared library. + </para> + <para> + Shared libraries can then be used with the <literal>link</literal> and + <literal>addinter</literal> Scilab function for incremental/dynamic link. + </para> + <para> + <emphasis role="bold">Note that a compiler must be available on the system to use this function.</emphasis> + </para> + <para> + On the internal technical level, under GNU/Linux and Mac OS X, the ilib_* function are based on the autotools. First, a configure is executed to detect compilers available. Then, a make is launched with the provided arguments. For more information: <ulink url="http://wiki.scilab.org/Full%20technical%20description%20of%20the%20incremental%20link">Full technical description of the incremental link / dynamic link</ulink> + </para> + <para> + Since version 5.3.2, under GNU/Linux, Scilab detects where the libstdc++ is located (thanks to the command <emphasis role="italic">gcc -print-search-dirs|grep ^install:|awk '{print $2}'</emphasis>). Previously, the dynamic link was using the libstdc++ embedded in Scilab. + </para> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="addinter">addinter</link> + </member> + <member> + <link linkend="link">link</link> + </member> + <member> + <link linkend="ilib_build">ilib_build</link> + </member> + <member> + <link linkend="ilib_gen_Make">ilib_gen_Make</link> + </member> + <member> + <link linkend="ilib_gen_gateway">ilib_gen_gateway</link> + </member> + <member> + <link linkend="ilib_gen_loader">ilib_gen_loader</link> + </member> + <member> + <link linkend="ilib_for_link">ilib_for_link</link> + </member> + <member> + <link linkend="api_scilab">api_scilab</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/ilib_for_link.xml b/modules/dynamic_link/help/en_US/ilib_for_link.xml new file mode 100755 index 000000000..f41f00774 --- /dev/null +++ b/modules/dynamic_link/help/en_US/ilib_for_link.xml @@ -0,0 +1,215 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="ilib_for_link"> + <refnamediv> + <refname>ilib_for_link</refname> + <refpurpose>utility for shared library management with link</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>libn=ilib_for_link(names,files,libs,flag [,makename [,loadername [,libname [,ldflags [,cflags [,fflags [,cc]]]]]]])</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>names</term> + <listitem> + <para>a string matrix giving the entry names which are to be linked.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>files</term> + <listitem> + <para>string matrix giving source files needed for shared library creation.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>libs</term> + <listitem> + <para>string matrix giving extra libraries needed for shared library creation</para> + </listitem> + </varlistentry> + <varlistentry> + <term>flag</term> + <listitem> + <para>a string flag ("c" or "f") for C or Fortran entry points.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>makename</term> + <listitem> + <para> + character string. The pathname of the Makefile file without extension (default value <literal>''</literal>). + </para> + <para>This parameter is useless since Scilab 5.0.</para> + <para>A warning will be displayed in Scilab 5.3 if you use another value that the default.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>loadername</term> + <listitem> + <para>character string. The pathname of the loader file (default + value is <literal>loader.sce</literal>). + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>libname</term> + <listitem> + <para>optional character string. The name of the generated shared + library (default value is "", and in this case the name is derived + from <literal>names(1)</literal>). + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>ldflags</term> + <listitem> + <para>optional character string. It can be used to add specific linker options in the + generated Makefile. Default value is "" + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>cflags</term> + <listitem> + <para>optional character string. It can be used to add specific C compiler options in the + generated Makefile. Default value is "" + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>fflags</term> + <listitem> + <para>optional character string. It can be used to add specific Fortran compiler options in the + generated Makefile. Default value is "" + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>cc</term> + <listitem> + <para>optional character string. It can be used to specify a C compiler. Default value is ""</para> + </listitem> + </varlistentry> + <varlistentry> + <term>libn</term> + <listitem> + <para>character string. The path of the really generated shared library file.</para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para> + 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 <literal>link</literal> function. New entry points + given by <literal>names</literal> are then accessible through the <literal>call</literal> + function or with non linear tools <literal>ode</literal>, <literal>optim</literal>,... + </para> + <para> + The file to compile are supposed to be located given by + <literal>makename</literal>. If <literal>makename</literal> sets a path different to the + current directory, <literal>loader</literal> script must be located in + the same directory using the <literal>loadername</literal> variable. + </para> + <para> + Many examples are provided in <literal>SCI/modules/dynamic_link/examples</literal> + directory. They are all released into the public domain. + </para> + <para> + <emphasis role="bold">Note that a compiler must be available on the system to use this function.</emphasis> + </para> + <para> + <emphasis role="bold">Languages handle by this function are: C, C++, Fortran and Fortran 90.</emphasis> + </para> + <para> + On the internal technical level, under GNU/Linux and Mac OS X, the ilib_* function are based on the autotools. First, a configure is executed to detect compilers available. Then, a make is launched with the provided arguments. For more information: <ulink url="http://wiki.scilab.org/Full%20technical%20description%20of%20the%20incremental%20link">Full technical description of the incremental link / dynamic link</ulink> + </para> + <para> + Since version 5.3.2, under GNU/Linux, Scilab detects where the libstdc++ is located (thanks to the command <emphasis role="italic">gcc -print-search-dirs|grep ^install:|awk '{print $2}'</emphasis>). Previously, the dynamic link was using the libstdc++ embedded in Scilab. + </para> + </refsection> + <refsection> + <title>Examples (C code)</title> + <programlisting role="example"><![CDATA[ +if haveacompiler() then + +chdir(TMPDIR) +f1=['int ext1c(int *n, double *a, double *b, double *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.c',[],"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 + +end + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="addinter">addinter</link> + </member> + <member> + <link linkend="link">link</link> + </member> + <member> + <link linkend="ilib_compile">ilib_compile</link> + </member> + <member> + <link linkend="ilib_gen_Make">ilib_gen_Make</link> + </member> + <member> + <link linkend="ilib_gen_gateway">ilib_gen_gateway</link> + </member> + <member> + <link linkend="ilib_gen_loader">ilib_gen_loader</link> + </member> + <member> + <link linkend="ilib_build">ilib_build</link> + </member> + <member> + <link linkend="api_scilab">api_scilab</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>History</title> + <revhistory> + <revision> + <revnumber>5.4.0</revnumber> + <revremark>This function no more accepts files with ".o" or ".obj" extensions as source files.</revremark> + </revision> + </revhistory> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/ilib_gen_Make.xml b/modules/dynamic_link/help/en_US/ilib_gen_Make.xml new file mode 100755 index 000000000..6f36c18e7 --- /dev/null +++ b/modules/dynamic_link/help/en_US/ilib_gen_Make.xml @@ -0,0 +1,150 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" scilab:needs-examples="no" xml:lang="en" xml:id="ilib_gen_Make"> + <refnamediv> + <refname>ilib_gen_Make</refname> + <refpurpose>utility for ilib_build: produces a Makefile for building shared libraries</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>Makename=ilib_gen_Make(name,files,libs,makename [,with_gateway,ldflags,cflags,fflags,cc])</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>lib_name</term> + <listitem> + <para>a character string, the generic name of the library without path and extension.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>files</term> + <listitem> + <para>a vector of character string. The names of the C or Fortran files without the extension and the path part.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>libs</term> + <listitem> + <para>a vector of character string. additional libraries paths or [].</para> + </listitem> + </varlistentry> + <varlistentry> + <term>makename</term> + <listitem> + <para>character string. The path of the Makefile file.</para> + <para>This parameter is useless since Scilab 5.0.</para> + <para>A warning will be displayed in Scilab 5.3 if you use another value that the default.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>with_gateway</term> + <listitem> + <para>a boolean. If true a file with name <lib_name>_gateway is + added. Default value is %t + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>ldflags</term> + <listitem> + <para>a string. It can be used to add specific linker options in the + generated Makefile. Default value is "" + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>cflags</term> + <listitem> + <para>a string. It can be used to add specific C compiler options in the + generated Makefile. Default value is "" + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>fflags</term> + <listitem> + <para>a string. It can be used to add specific Fortran compiler options in the + generated Makefile. Default value is "" + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>cc</term> + <listitem> + <para>a string. The name of the C compiler. Default value is the C compiler detected on the host.</para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para> + Utility function used by <literal>ilib_build</literal> + </para> + <para> + <warning>This function should not be used directly.</warning> + </para> + <para> + This function generates a Makefile adapted to the Operating System for + building shared libraries to be loaded in Scilab. Proper options and + paths are set. + </para> + <para> + Shared libraries can then be used with the <literal>link</literal> and + <literal>addinter</literal> scilab function for incremental/dynamic linking. + </para> + <para> + The shared library is build from a set of C or Fortran routines + stored in a directory and if required from a set of external + libraries. + </para> + <para> + Files are not required to exist, when Makefile is generated, but of + course are required for executing the Makefile. + </para> + <para> + <emphasis role="bold">Only use this function is you know what you are doing (it is a semi-private function).</emphasis> + </para> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="addinter">addinter</link> + </member> + <member> + <link linkend="link">link</link> + </member> + <member> + <link linkend="ilib_build">ilib_build</link> + </member> + <member> + <link linkend="ilib_compile">ilib_compile</link> + </member> + <member> + <link linkend="ilib_gen_gateway">ilib_gen_gateway</link> + </member> + <member> + <link linkend="ilib_gen_loader">ilib_gen_loader</link> + </member> + <member> + <link linkend="ilib_for_link">ilib_for_link</link> + </member> + <member> + <link linkend="api_scilab">api_scilab</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/ilib_gen_cleaner.xml b/modules/dynamic_link/help/en_US/ilib_gen_cleaner.xml new file mode 100755 index 000000000..b3032d953 --- /dev/null +++ b/modules/dynamic_link/help/en_US/ilib_gen_cleaner.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) DIGITEO - 2009 - Allan CORNET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" scilab:needs-examples="no" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="ilib_gen_cleaner"> + <refnamediv> + <refname>ilib_gen_cleaner</refname> + <refpurpose>utility for ilib_build: generates a cleaner file</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>ilib_gen_cleaner(makename,[loadername],[files])</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>makename</term> + <listitem> + <para> + character string. The pathname of the Makefile file without extension (default value <literal>''</literal>). + </para> + <para>This parameter is useless since Scilab 5.0.</para> + <para>A warning will be displayed in Scilab 5.3 if you use another value that the default.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>loadername</term> + <listitem> + <para> + character string. The pathname of the loader file (default value is <literal>loader.sce</literal>). + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>files</term> + <listitem> + <para>matrix of character string. files to delete.</para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para> + This is internal function used by <literal>ilib_build and ilib_for_link</literal> + This function generates a cleaner file. + </para> + <para> + <warning>This function should not be used directly.</warning> + </para> + <para> + <emphasis role="bold">Only use this function is you know what you are doing (it is a semi-private function).</emphasis> + </para> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="ilib_gen_loader">ilib_gen_loader</link> + </member> + <member> + <link linkend="ilib_build">ilib_build</link> + </member> + <member> + <link linkend="ilib_for_link">ilib_for_link</link> + </member> + <member> + <link linkend="api_scilab">api_scilab</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/ilib_gen_gateway.xml b/modules/dynamic_link/help/en_US/ilib_gen_gateway.xml new file mode 100755 index 000000000..3e93077c0 --- /dev/null +++ b/modules/dynamic_link/help/en_US/ilib_gen_gateway.xml @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - + * Copyright (C) DIGITEO - 2009 - Allan CORNET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="ilib_gen_gateway" xml:lang="en"> + <refnamediv> + <refname>ilib_gen_gateway</refname> + <refpurpose>utility for ilib_build, generates a gateway file.</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>ilib_gen_gateway(name,table)</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>name</term> + <listitem> + <para>a character string, the generic name of the library without + path and extension. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>table</term> + <listitem> + <para>2 column string matrix giving the table of pairs 'scilab-name' + 'interface name' + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para> + Utility function used by <literal>ilib_build</literal> This function + generates a gateway file used by <literal>addinter</literal>. + </para> + <para>if WITHOUT_AUTO_PUTLHSVAR variable is defined and equals to %t, + PutLhsVar(); will need to manage PutLhsVar in each interface as internal + scilab functions. + </para> + <para>In another case (default, for compatibility with previous version) , + PutLhsVar(); is added in each interface. + </para> + <para>You can also see + SCI/contrib/toolbox_skeleton/sci_gateway/c/builder_gateway_c.sce (as + example about WITHOUT_AUTO_PUTLHSVAR) + </para> + </refsection> + <refsection> + <title>Example about WITHOUT_AUTO_PUTLHSVAR = %t</title> + <programlisting role="example"><![CDATA[ +cd TMPDIR +WITHOUT_AUTO_PUTLHSVAR = %t; +name = 'gw_example1'; +table = ['sci_func1', 'func1'] +ilib_gen_gateway(name,table) + +// generated gateway +mgetl(TMPDIR+'/gw_example1.c') +]]></programlisting> + <programlisting role="example"><![CDATA[ +int sci_func1(char *fname) +{ + // ... your C code + // you need to add a explicit PutLhsVar(); + // as internal all gateways of scilab + + PutLhsVar(); + return 0; +} +]]></programlisting> + </refsection> + <refsection> + <title>Example about WITHOUT_AUTO_PUTLHSVAR = %f (default)</title> + <programlisting role="example"><![CDATA[ +cd TMPDIR +WITHOUT_AUTO_PUTLHSVAR = %f; +name = 'gw_example2'; +table = ['sci_func2', 'func2'] +ilib_gen_gateway(name,table) + +// generated gateway +mgetl(TMPDIR+'/gw_example2.c') +]]></programlisting> + <programlisting role="example"><![CDATA[ +int sci_func2(char *fname) +{ + // ... your code + // you do NOT need to add a explicit PutLhsVar(); + // added by scilab after call to sci_func2 + // default mode in scilab 4 + + return 0; +} +]]></programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="addinter">addinter</link> + </member> + <member> + <link linkend="link">link</link> + </member> + <member> + <link linkend="ilib_build">ilib_build</link> + </member> + <member> + <link linkend="ilib_compile">ilib_compile</link> + </member> + <member> + <link linkend="ilib_gen_Make">ilib_gen_Make</link> + </member> + <member> + <link linkend="ilib_gen_loader">ilib_gen_loader</link> + </member> + <member> + <link linkend="ilib_for_link">ilib_for_link</link> + </member> + <member> + <link linkend="api_scilab">api_scilab</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/ilib_gen_loader.xml b/modules/dynamic_link/help/en_US/ilib_gen_loader.xml new file mode 100755 index 000000000..3835b73be --- /dev/null +++ b/modules/dynamic_link/help/en_US/ilib_gen_loader.xml @@ -0,0 +1,84 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" scilab:needs-examples="no" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="ilib_gen_loader"> + <refnamediv> + <refname>ilib_gen_loader</refname> + <refpurpose>utility for ilib_build: generates a loader file</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>ilib_gen_loader(name,table,[libs])</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>name</term> + <listitem> + <para>a character string, the generic name of the library without path and extension.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>table</term> + <listitem> + <para>2 column string matrix giving the table of pairs 'scilab-name' 'interface name'</para> + </listitem> + </varlistentry> + <varlistentry> + <term>libs</term> + <listitem> + <para>a string matrix, externals dynamic libraries filenames to load by loader file (optional).</para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para> + Utility function used by <literal>ilib_build</literal> + This function generates a loader file. + </para> + <para> + <warning>This function should not be used directly.</warning> + </para> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="addinter">addinter</link> + </member> + <member> + <link linkend="link">link</link> + </member> + <member> + <link linkend="ilib_build">ilib_build</link> + </member> + <member> + <link linkend="ilib_compile">ilib_compile</link> + </member> + <member> + <link linkend="ilib_gen_Make">ilib_gen_Make</link> + </member> + <member> + <link linkend="ilib_gen_loader">ilib_gen_loader</link> + </member> + <member> + <link linkend="ilib_for_link">ilib_for_link</link> + </member> + <member> + <link linkend="api_scilab">api_scilab</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/ilib_include_flag.xml b/modules/dynamic_link/help/en_US/ilib_include_flag.xml new file mode 100755 index 000000000..f89aa7e7c --- /dev/null +++ b/modules/dynamic_link/help/en_US/ilib_include_flag.xml @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab * + Copyright (C) 2008 - INRIA * * This file must be used under the terms of + the CeCILL. * This source file is licensed as described in the file COPYING, + which * you should have received as part of this distribution. The terms + * are also available at * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="ilib_include_flag"> + <refnamediv> + <refname>ilib_include_flag</refname> + <refpurpose>Return a formated includes related string to pass to + system compiler + </refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Call Sequence</title> + <synopsis>compiler_flag = ilib_include_flag(path_strings)</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>path_strings</term> + <listitem> + <para>Vector of relative or absolute path as string.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>compiler_flag</term> + <listitem> + <para>Compiler flag as string</para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para>This function is an utility function provided to handle several + includes path. The result can be passed to tbx_build_gateway. + </para> + </refsection> + <refsection> + <title>Exemples</title> + <programlisting role="example"><![CDATA[ + + includes_path = ["../src/includes";"/usr/include/somelib/includes";"."]; + includes_src_c = ilib_include_flag(includes_path); + + ilib_build('somelib',['myfun',sci_myfun'],['myfile.c'],[],[],includes_src_c); + +]]></programlisting> + </refsection> + <refsection> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="tbx_build_gateway">tbx_build_gateway</link> + <link linkend="ilib_build">ilib_build</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/ilib_mex_build.xml b/modules/dynamic_link/help/en_US/ilib_mex_build.xml new file mode 100755 index 000000000..84a617413 --- /dev/null +++ b/modules/dynamic_link/help/en_US/ilib_mex_build.xml @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="ilib_mex_build"> + <refnamediv> + <refname>ilib_mex_build</refname> + <refpurpose>utility for mex library management</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>ilib_mex_build(lib_name,table,files,libs [,makename,ldflags,cflags,fflags,cc])</synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>lib_name</term> + <listitem> + <para>a character string, the generic name of the library without path and extension.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>table</term> + <listitem> + <para>3 column string matrix giving the table of 'scilab-name', 'interface name', 'cmex' or 'fmex'</para> + </listitem> + </varlistentry> + <varlistentry> + <term>files</term> + <listitem> + <para>string matrix giving objects files needed for shared library creation</para> + </listitem> + </varlistentry> + <varlistentry> + <term>libs</term> + <listitem> + <para>string matrix giving extra libraries needed for shared library creation</para> + </listitem> + </varlistentry> + <varlistentry> + <term>makename</term> + <listitem> + <para>character string. The path of the Makefile file without extension.</para> + <para>This parameter is useless since Scilab 5.0. Default value to use: [].</para> + <para>A warning will be displayed in Scilab 5.3 if you use another value that the default.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>ldflags,cflags,fflags,cc</term> + <listitem> + <para>character strings to provide options/flags for the loader, the C compiler, the Fortran compiler. cc provides the name of the compiler.</para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para> + This function is used to create mex libraries and to generate a + loader file which can be used to dynamically load the mex shared library. + </para> + <para> + Note that the file name containing the mex code can be set in the third input argument (<literal>files</literal>) or the second value of the <literal>table</literal> input argument. + </para> + <para> + <emphasis role="bold">Note that a compiler must be available on the system to use this function.</emphasis> + </para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example"><![CDATA[ +cd(TMPDIR); + +mputl(['#include ""mex.h""' + 'void mexFunction(int nlhs, mxArray *plhs[], int nrhs, mxArray *prhs[])' + '{' + ' int *dims = mxGetDimensions(prhs[0]);' + ' sciprint(""%d %d %d\n"",dims[0],dims[1],dims[2]);' + '}'],'mexfunction16.c'); +ilib_mex_build('libmex',['mexf16','mexfunction16','cmex'],[],[],'','','',''); + +exec(TMPDIR+'/loader.sce'); +mexf16(rand(2,3,2)); + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="addinter">addinter</link> + </member> + <member> + <link linkend="link">link</link> + </member> + <member> + <link linkend="ilib_compile">ilib_compile</link> + </member> + <member> + <link linkend="ilib_gen_Make">ilib_gen_Make</link> + </member> + <member> + <link linkend="ilib_gen_gateway">ilib_gen_gateway</link> + </member> + <member> + <link linkend="ilib_gen_loader">ilib_gen_loader</link> + </member> + <member> + <link linkend="ilib_for_link">ilib_for_link</link> + </member> + <member> + <link linkend="api_scilab">api_scilab</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/ilib_verbose.xml b/modules/dynamic_link/help/en_US/ilib_verbose.xml new file mode 100755 index 000000000..68ac89a2b --- /dev/null +++ b/modules/dynamic_link/help/en_US/ilib_verbose.xml @@ -0,0 +1,122 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) DIGITEO - Allan CORNET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="ilib_verbose" xml:lang="en"> + <refnamediv> + <refname>ilib_verbose</refname> + <refpurpose>set level of display used by dynamic link + functions. + </refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis> + level = ilib_verbose() + ilib_verbose(level) + </synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>level :</term> + <listitem> + <para>level of verbose for dynamic link functions.</para> + <para>0 : no message</para> + <para>1 : default level (as previous version of scilab)</para> + <para>2 : maximum verbose level (configure , makefile, debug + information, ...) + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para>"ilib_verbose" set level of display used by dynamic link + functions. + </para> + <para>All dynamic functions in dynamic link module check this value and + display or not some information. + </para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example"><![CDATA[ +if haveacompiler() then + cur_verbose = ilib_verbose(); + ilib_verbose(0); + + chdir(TMPDIR); + f1=['int ext1c(int *n, double *a, double *b, double *c)' + '{int k;' + ' for (k = 0; k < *n; ++k) ' + ' c[k] = a[k] + b[k];' + ' return(0);}']; + + mputl(f1,'fun1.c'); + + ilib_for_link('ext1c','fun1.c',[],"c"); + 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 + + ilib_verbose(1); + + f2=['int ext2c(int *n, double *a, double *b, double *c)' + '{int k;' + ' for (k = 0; k < *n; ++k) ' + ' c[k] = a[k] + b[k];' + ' return(0);}']; + + mputl(f2,'fun2.c'); + + ilib_for_link('ext2c','fun2.c',[],"c") + exec loader.sce; + + //using the new primitive + a = [1,2,3]; b = [4,5,6];n = 3; + c = call('ext2c',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d'); + if norm(c-(a+b)) > %eps then pause,end + + ilib_verbose(cur_verbose); + +end + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="mode">mode</link> + </member> + <member> + <link linkend="link">link</link> + </member> + <member> + <link linkend="ilib_compile">ilib_compile</link> + </member> + <member> + <link linkend="ilib_gen_Make">ilib_build</link> + </member> + <member> + <link linkend="ilib_for_link">ilib_for_link</link> + </member> + <member> + <link linkend="api_scilab">api_scilab</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/link.xml b/modules/dynamic_link/help/en_US/link.xml new file mode 100755 index 000000000..b2e821779 --- /dev/null +++ b/modules/dynamic_link/help/en_US/link.xml @@ -0,0 +1,184 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="link" xml:lang="en"> + <refnamediv> + <refname>link</refname> + <refpurpose>dynamic linker</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>x = link(files [, sub-names,flag]); + link(x , sub-names [, flag]); + lstID = link("show") + lst = link() + </synopsis> + </refsynopsisdiv> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>files</term> + <listitem> + <para>a character string or a vector of character strings, the files + names used to define the new entry point (compiled routines, user + libraries, system libraries,..) + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>sub-names</term> + <listitem> + <para>a character string or a vector of character strings . Name of + the entry points in <literal>files</literal> to be linked. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>x</term> + <listitem> + <para>an integer which gives the id of a shared library linked into + Scilab with a previous call to <literal>link</literal>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>flag</term> + <listitem> + <para> + character string <literal>'f'</literal> or + <literal>'c'</literal> for Fortran (default) or C code. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>listID</term> + <listitem> + <para>returns the current linked ID routines.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>list</term> + <listitem> + <para> returns names of functions linked.</para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para> + <literal>link</literal> is a incremental/dynamic link facility: this + command allows to add new compiled Fortran or C routines to Scilab + executable code. Linked routines can be called interactively by the + function <literal>call</literal>. Linked routines can also be used as + "external" for e.g. non linear problem solvers (<literal>ode</literal>, + <literal>optim</literal>, <literal>intg</literal>, + <literal>dassl</literal>...). + </para> + <para> + <literal>link()</literal> returns a string matrix with linked + functions. + </para> + <para> + a call to <literal>link</literal> returns an integer which gives the + id of the shared library which is loaded into Scilab. This number can then + be used as the first argument of the link function in order to link + additional function from the linked shared library. The shared library is + removed with the <link linkend="ulink">ulink</link> command. + </para> + <para> + A routine can be unlinked with <link linkend="ulink">ulink</link>. + If the linked function has been modified between two links, it is required + to <link linkend="ulink">ulink</link> the previous instance before the new + link. + </para> + <para> + <literal>link('show')</literal> returns the current linked + routines. + </para> + <para>To be able to link routines in a system independent way, it is + convenient to use the <literal>ilib_for_link</literal> utility function + instead of <literal>link</literal>. + </para> + <para> + (Experienced) users may also <literal>link</literal> a new Scilab + interface routine to add a set of new functions. See <link linkend="ilib_build">ilib_build</link> and <link linkend="addinter">addinter</link> functions. + </para> + <para>Number of 'link' in a scilab session can be limited by the operating + system. On Windows, you cannot load more than 80 dynamic libraries at the + same time. + </para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example"><![CDATA[ +//Example of the use of ilib_for_link with a simple C code +cd TMPDIR +f1=['#include <math.h>' + 'void fooc(double c[],double a[],double *b,int *m,int *n)' + '{' + ' int i;' + ' for ( i =0 ; i < (*m)*(*n) ; i++) ' + ' c[i] = sin(a[i]) + *b; ' + '}']; + +mputl(f1,'fooc.c'); + +//creating the shared library: a Makefile and a loader are +//generated, the code is compiled and a shared library built. +ilib_for_link('fooc','fooc.c',[],"c") + +// display the loader.sce file which calls link +mprintf('%s\n',mgetl('loader.sce')) +// load the shared library +exec loader.sce; + +link('show') +// call the new linked entry point +a=linspace(0,%pi,10);b=5; +y1=call('fooc',a,2,'d',b,3,'d',size(a,1),4,'i',size(a,2),5,'i','out',size(a),1,'d') +// check +y1-(sin(a)+b) +exec cleaner.sce; + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="ulink">ulink</link> + </member> + <member> + <link linkend="call">call</link> + </member> + <member> + <link linkend="external">external</link> + </member> + <member> + <link linkend="c_link">c_link</link> + </member> + <member> + <link linkend="addinter">addinter</link> + </member> + <member> + <link linkend="ilib_for_link">ilib_for_link</link> + </member> + <member> + <link linkend="ilib_build">ilib_build</link> + </member> + <member> + <link linkend="api_scilab">api_scilab</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/supported_compilers.xml b/modules/dynamic_link/help/en_US/supported_compilers.xml new file mode 100755 index 000000000..4c1587e67 --- /dev/null +++ b/modules/dynamic_link/help/en_US/supported_compilers.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) DIGITEO - 2010-2011 - Allan CORNET + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" scilab:needs-examples="no" xmlns:scilab="http://www.scilab.org" xml:id="supported_compilers" xml:lang="en"> + <refnamediv> + <refname>Supported and compatible compilers</refname> + <refpurpose>supported and compatible compilers by Scilab</refpurpose> + </refnamediv> + <refsection> + <title>Scilab supported and compatible compilers</title> + <para>Some features of Scilab require that you have a third-party compiler + installed on your system. + </para> + </refsection> + <refsection> + <title>Windows</title> + <para>-- Visual studio C++ 2005, 2008, 2010, 2012, 2013 Professionnal 32 and 64 bits</para> + <para>-- Visual studio C++ 2012, 2013 Express Edition (available at no charge)</para> + <para> + More information is available on <ulink url="http://wiki.scilab.org/How_can_I_set_up_Microsoft_Visual_Studio_2008/2010_Express_Edition_for_use_with_Scilab_x64_on_64-bit_Windows%3F">Scilab Wiki</ulink>. + </para> + <para>-- Intel Fortran 9, 10, 11, XE 2011, XE 2012, XE 2013</para> + <para> + -- LCC-Win32 requires to install a ATOMS module:<programlisting role="exec">atomsInstall('lcc_windows'); atomsLoad('lcc_windows');</programlisting> + </para> + <para> + -- MinGW requires to install a ATOMS module:<programlisting role="exec">atomsInstall('mingw'); atomsLoad('mingw');</programlisting> + </para> + </refsection> + <refsection> + <title>GNU/Linux</title> + <para>On GNU/Linux, GNU compilers (gcc, g++ and gfortran) are packaged in all distributions.</para> + <para> + While they are not official supported, Scilab supports <ulink url="http://clang.llvm.org/">LLVM/clang</ulink> and Intel compilers. + </para> + </refsection> + <refsection> + <title>Mac OS X</title> + <para> + Apple's development environment for OS X, <ulink url="http://developer.apple.com/technologies/tools/xcode.html">Xcode</ulink>, is available from + Apple at no charge. + </para> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="haveacompiler">haveacompiler</link> + </member> + <member> + <link linkend="atomsInstall">atomsInstall</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/en_US/ulink.xml b/modules/dynamic_link/help/en_US/ulink.xml new file mode 100755 index 000000000..753f66d0e --- /dev/null +++ b/modules/dynamic_link/help/en_US/ulink.xml @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="ulink"> + <refnamediv> + <refname>ulink</refname> + <refpurpose>unlink/unload a dynamically linked shared object</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Calling Sequence</title> + <synopsis>ulink(x) + ulink() + </synopsis> + </refsynopsisdiv> + <refsection> + <refsection> + <title>Arguments</title> + <variablelist> + <varlistentry> + <term>x</term> + <listitem> + <para> + a ID returned by <literal>link</literal> + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <title>Description</title> + <para> + see <literal>link</literal> + </para> + <para> + If you plan to use <literal>valgrind</literal> to profile + your module, you must first set the environment + variable <literal>PROFILE_SCILAB_DYNAMIC_LINK</literal> before + starting scilab: + </para> + <programlisting role="example"><![CDATA[ +# under bash shell: +export PROFILE_SCILAB_DYNAMIC_LINK=1 +export SCILAB_VALGRIND_OPT="--db-attach=no --show-below-main=yes --log-fd=2 --log-file=scilab.txt --num-callers=50 -v --trace-redir=yes --read-var-info=yes --trace-children=yes --show-reachable=yes --smc-check=all --child-silent-after-fork=no --leak-check=full --track-origins=yes" +scilab -nwni -profile + ]]></programlisting> + <para>This environment variable force Scilab not to release the + loaded dynamic libraries. This will + allow <literal>valgrind</literal> to perform its sum-up analysis. + </para> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="example"><![CDATA[ +cd TMPDIR +f1=['#include <math.h>' + 'void fooc(double c[],double a[],double *b,int *m,int *n)' + '{' + ' int i;' + ' for ( i =0 ; i < (*m)*(*n) ; i++) ' + ' c[i] = sin(a[i]) + *b; ' + '}']; +mputl(f1,'fooc.c'); + +ilib_for_link('fooc','fooc.c',[],"c"); +exec loader.sce; + +link() // Will should fooc +link("show") // Will should the value 0 + +ulink(0) // ulink fooc + ]]></programlisting> + </refsection> + + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + <link linkend="link">link</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/fr_FR/addchapter.sce b/modules/dynamic_link/help/fr_FR/addchapter.sce new file mode 100755 index 000000000..464e42729 --- /dev/null +++ b/modules/dynamic_link/help/fr_FR/addchapter.sce @@ -0,0 +1,11 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009 - DIGITEO +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +add_help_chapter("Link dynamique/incremental",SCI+"/modules/dynamic_link/help/fr_FR",%T); + diff --git a/modules/dynamic_link/help/fr_FR/ilib_build_jar.xml b/modules/dynamic_link/help/fr_FR/ilib_build_jar.xml new file mode 100755 index 000000000..ec882381f --- /dev/null +++ b/modules/dynamic_link/help/fr_FR/ilib_build_jar.xml @@ -0,0 +1,145 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +* +* ====================================================================== +* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +* Copyright (C) 2013 - Scilab Enterprises - Simon MARCHETTO +* +* This file is distributed under the same license as the Scilab package. +* ======================================================================= +* +--> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:lang="fr" xml:id="ilib_build_jar"> + <refnamediv> + <refname>ilib_build_jar</refname> + <refpurpose>Construit une archive JAR de packages Java</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Séquence d'appel</title> + <synopsis> + ilib_build_jar(jarFilePath, packageNames[, sourcePath[, classPath, [, manifestFilePath]]]) + </synopsis> + </refsynopsisdiv> + <refsection> + <title>Paramètres</title> + <variablelist> + <varlistentry> + <term>jarFilePath</term> + <listitem> + <para>Une chaine de caractères, contenant le chemin d'accès complet du fichier JAR destination.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>packageNames</term> + <listitem> + <para>Une matrice de chaines de caractères, définissant les noms des packages Java à construire et à stocker dans le fichier JAR.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>sourcePaths</term> + <listitem> + <para>Une matrice de chaines de caractères, contenant les chemins d'accès des répertoires contenant les sources Java.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>classPaths</term> + <listitem> + <para>Une matrice de chaines de caractères (optionelle), qui contient les chemins d'accès des dépendences de compilation.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>manifestFilePath</term> + <listitem> + <para>Une chaine de caractères, (optionelle), contenant le chemin d'accès complet d'un fichier manifeste à inclure dans le fichier JAR.</para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Description</title> + <para> + <literal>ilib_build_jar</literal> étend au language Java la fonction <link linkend="ilib_build">ilib_build</link>, qui sert à construire des libraries C/C++/Fortran. En d'autres termes, <literal>ilib_build_jar</literal> permet de construire des librairies Java à partir de sources Java. En Java, une librairie est un fichier JAR (archive Java, dont l'extension est <literal>.jar</literal>), qui contient des packages Java compilés (un package Java regroupe un ensemble de classes) et un fichier manifeste, qui décrit le contenu du fichier JAR. + </para> + <para> + <literal>ilib_build_jar</literal> fonctionne comme suit. Tous les fichiers sources Java trouvés dans les chemins de répertoires donnés par l'argument <literal>sourcePaths</literal> sont compilés. Ensuite le fichier JAR cible dont le chemin est donné par l'argument <literal>jarFilePath</literal> est créé à partir de toutes les classes compilées correspondant aux packages déclarés dans l'argument <literal>packageNames</literal>. <literal>ilib_build_jar</literal> se base sur la fonction <link linkend="jcompile">jcompile</link> pour la compilation et sur <link linkend="jcreatejar">jcreatejar</link> pour la création d'archive JAR. Aucun autre outil externe supplémentaire n'est requis. + </para> + <para> + Rappelons quelques informations à propos des packages Java, essentielles pour utiliser <literal>ilib_build_jar</literal>. + Les pakages Java sont structurés de façon hiérarchique, et Java impose que l'emplacement des fichiers sources correspond à la hiérarchie des packages, par exemple un package portant le nom monpackage doit être stocké dans un répertoire du même nom. + La convention est qu'un fichier JAR contient habituellement une seule hiérarchie de packages Java, et son nom de fichier correspond au nom de package racine, qui sera de type <literal>org.company.software.package</literal>. + <literal>ilib_build_jar</literal> peut être utilisée pour créer un fichier JAR contenant plusieurs hiérarchies de packages Java, avec un nom de fichier arbitraire. Les seules obligations sont qu'un nom de package au moins doit être déclaré à <literal>ilib_build_jar</literal>, et que chacune des classes Java doit appartenir à un package. + </para> + <para> + Les dépendances nécessaires pour la compilation peuvent être déclarées dans l'argument <literal>classPaths</literal>. Cela peut être des chemins complets à des fichiers JAR contenant des packages Java, ou à des répertoires contenant des classes Java compilées. + </para> + <para> + On peut aussi spécifier un chemin d'accès à un fichier manifeste, via l'argument <literal>manifestFilePath</literal>, dont les données seront stockées dans le fichier JAR, dans le fichier <literal>MANIFEST.MF</literal>, dans le sous-répertoire <literal>META-INF</literal>. Si le fichier manifeste n'est pas spécifié ou n'existe pas, un manifeste sera créé par défaut. Note: si on spécifie un manifeste, celui doit contenir un attribut de version, autrement le manifeste dans le fichier JAR risque d'être vide. + </para> + </refsection> + <refsection> + <title>Exemples</title> + <programlisting role="example"><![CDATA[ +// Exemple pour ilib_build_jar + +// Crée les sources du package org.scilab.test.mypackage package dans TMPDIR +packageName = 'org.scilab.test.mypackage'; +packageSrcPath = fullfile(TMPDIR, packageName); + +// Crée un fichier source du package (dans le répertoire org/scilab/test/mypackage) +function addJavaSourceToPackage(className, packageName) + packagePath = strsubst(packageName, '.', filesep()); + packagePath = fullfile(packageSrcPath, packagePath); + mkdir(packagePath); + filePath = fullfile(packagePath, className + '.java'); + + sourceCode = [msprintf('package %s;', packageName); .. + msprintf('public class %s {}\n', className); + ]; + fd = mopen(filePath, 'wt'); + mputl(sourceCode, fd); + mclose(fd); +endfunction + +// Ajoute les classes 'Foo' and 'bar.Bar' au package +addJavaSourceToPackage('Foo', packageName); +addJavaSourceToPackage('Bar', packageName + '.bar'); + +// Construit le package +jarFilePath = fullfile(TMPDIR, packageName + '.jar'); +ilib_build_jar(jarFilePath, packageName, packageSrcPath); + +// Import et teste la package +javaclasspath(jarFilePath); +jimport org.scilab.test.mypackage.Foo; +foo = Foo.new(); +jimport org.scilab.test.mypackage.bar.Bar; +bar = Bar.new(); + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>Voir aussi</title> + <simplelist type="inline"> + <member> + <link linkend="jcompile">jcompile</link> + </member> + <member> + <link linkend="jcreatejar">jcreatejar</link> + </member> + <member> + <link linkend="javaclasspath">javaclasspath</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>Historique</title> + <revhistory> + <revision> + <revnumber>5.5.0</revnumber> + <revremark> + Fonction introduite. + </revremark> + </revision> + </revhistory> + </refsection> +</refentry> + diff --git a/modules/dynamic_link/help/ja_JP/addchapter.sce b/modules/dynamic_link/help/ja_JP/addchapter.sce new file mode 100755 index 000000000..a27bf6d08 --- /dev/null +++ b/modules/dynamic_link/help/ja_JP/addchapter.sce @@ -0,0 +1,11 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009 - DIGITEO +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +add_help_chapter("Dynamic/incremental Link",SCI+"/modules/dynamic_link/help/ja_JP",%T); + diff --git a/modules/dynamic_link/help/pt_BR/addchapter.sce b/modules/dynamic_link/help/pt_BR/addchapter.sce new file mode 100755 index 000000000..ea45bb783 --- /dev/null +++ b/modules/dynamic_link/help/pt_BR/addchapter.sce @@ -0,0 +1,11 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009 - DIGITEO +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +add_help_chapter("Link Dinâmico/incremental",SCI+"/modules/dynamic_link/help/pt_BR",%T); + diff --git a/modules/dynamic_link/help/pt_BR/call.xml b/modules/dynamic_link/help/pt_BR/call.xml new file mode 100755 index 000000000..5b8c081f9 --- /dev/null +++ b/modules/dynamic_link/help/pt_BR/call.xml @@ -0,0 +1,243 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) INRIA - + * + * This file must be used under the terms of the CeCILL. + * This source file is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="call" xml:lang="en"> + <refnamediv> + <refname>call</refname> + <refpurpose>chamada a rotinas de usuário FORTRAN ou C</refpurpose> + </refnamediv> + <refsynopsisdiv> + <title>Seqüência de Chamamento</title> + <synopsis>// forma longa: 'out' está presente + [y1,...,yk] = call("ident",x1,px1,"tx1",...,xn,pxn,"txn","out",[ny1,my1],py1,"ty1",...,[nyl,myl],pyl,"tyl") + // forma curta : nenhum parâmetro 'out' + [y1,....,yk] = call("ident",x1,...,xn) + </synopsis> + </refsynopsisdiv> + <refsection> + <title>Parâmetros</title> + <variablelist> + <varlistentry> + <term>"ident"</term> + <listitem> + <para>string.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>xi</term> + <listitem> + <para>real matrix or string</para> + </listitem> + </varlistentry> + <varlistentry> + <term>pxi, pyi</term> + <listitem> + <para>inteiro</para> + </listitem> + </varlistentry> + <varlistentry> + <term>txi, tyi</term> + <listitem> + <para> + string <literal>"d"</literal>, <literal>"r"</literal>, + <literal>"i"</literal> ou <literal>"c"</literal>. + </para> + </listitem> + </varlistentry> + </variablelist> + </refsection> + <refsection> + <title>Descrição</title> + <para>Chamada interativa ao programa do usuário FORTRAN (ou C) do Scilab. + A rotina deve estar previamente linkada ("ligada") ao Scilab. Este link + pode ser feito: + </para> + <itemizedlist> + <listitem> + <para> + Com o comando "<literal>link</literal>" do Scilab (linkagem + "suave" ("soft") incremental) durante a sessão Scilab. (ver + <literal>link</literal>) + </para> + </listitem> + </itemizedlist> + <para>Há duas formas de sintaxe de chamamento, uma curta e uma longa. A + curta fornece um código mais rápido e uma sintaxe de chamamento mais + fácil, mas deve-se escrever uma pequena interface (C ou FORTRAN) para que + esta forma seja possível. A forma longa torna possível uma chamada a uma + rotina FORTRAN (ou C) sem modificação do código, mas a sintaxe é mais + complexa e o código interpretado mais devagar. + </para> + <para>O significado de cada parâmetro é descrito abaixo: </para> + <variablelist> + <varlistentry> + <term>"ident"</term> + <listitem> + <para>é o nome da subrotina chamada. </para> + </listitem> + </varlistentry> + <varlistentry> + <term>x1,...,xn</term> + <listitem> + <para>são as variáveis de entrada (strings ou matrizes de reais) + enviados à rotina + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>px1,...,pxn</term> + <listitem> + <para>são as respectivas posições destas variáveis na seqüência de + chamamento da rotina <literal>"ident"</literal> e + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>tx1,...,txn</term> + <listitem> + <para> + são seus tipos (<literal>"r"</literal>, + <literal>"i"</literal>, <literal>"d"</literal> e + <literal>"c"</literal> para ponto flutuante real , inteiro, dupla + precisão e strings) + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>"out"</term> + <listitem> + <para>é a palavra-chave usada para separar variáveis de entrada das + variáveis de saída. Quando esta palavra-chave está presente, ela + indica que a forma longa será usada e quando não está presente, + indica que a forma curta será usada. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>[ny1, my1]</term> + <listitem> + <para>são os tamanhos (número de linhas e colunas. Para argumentos + 'c',<literal> m1*n1</literal> é o número de caracteres) das + variáveis de saída e + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>py1, ...</term> + <listitem> + <para>são as posições das variáveis de saída (possivelmente iguais a + <literal>pxi</literal> ) na seqüência de chamamento da rotina. Os + inteiros <literal>pyi</literal>'s devem estar em ordem + crescente. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>"ty1", ...</term> + <listitem> + <para>são os tipos FORTRAN das variáveis de saída. As + <literal>k</literal> primeiras variáveis de saída são postas em + <literal>y1,..., yk</literal>. + </para> + </listitem> + </varlistentry> + </variablelist> + <para>Se uma variável de saída coincide com uma variável de entrada (i.e., + <literal>pyi=pxj</literal> ) pode-se apenas passar sua posição + <literal>pyi</literal> . O tamanho e tipo de <literal>yi</literal> são + então os mesmos que os de<literal>xi</literal>. Se uma variável de saída + coincide com uma variável de entrada e são especificadas as dimensões da + variável de saída, <literal>[myl,nyl]</literal> deve satisfazer a condição + de compatibilidade <literal>mxk*nxk >= myl*nyl</literal>. + </para> + </refsection> + <refsection> + <title>Exemplos</title> + <programlisting role="example"><![CDATA[ +//Exemplo 1 com um código C simples +f1=['#include <math.h>;' + 'void fooc(c,a,b,m,n)' + 'double a[],*b,c[];' + 'int *m,*n;' + '{' + ' int i;' + ' for ( i =0 ; i < (*m)*(*n) ; i++) ' + ' c[i] = sin(a[i]) + *b; ' + '}']; + +mputl(f1,'fooc.c') + +//criando a biblioteca compartilhada (um gateway (ligação), um Makefile e um loader (carregador) são +//gerados.) + +ilib_for_link('fooc','fooc.c',[],"c") + +// carregando a biblioteca compartilhada + +exec loader.sce + +//usando a nova primitiva +a=[1,2,3;4,5,6];b= %pi; +[m,n]=size(a); + +// Entradas: +// a está na posição 2 e double +// b 3 double +// n 4 integer +// m 5 integer +// Saídas: +// c está na posição 1 e double com tamanho [m,n] +c=call("fooc",a,2,"d",b,3,"d",m,4,"i",n,5,"i","out",[m,n],1,"d"); + +//Exemplo 2 com um código FORTRAN simples +f1=[' subroutine foof(c,a,b,n,m)' + ' integer n,m' + ' double precision a(*),b,c(*)' + ' do 10 i=1,m*n ' + ' c(i) = sin(a(i))+b' + ' 10 continue' + ' end']; +mputl(f1,'foof.f') + +//criando a biblioteca compartilhada (um gateway, um Makefile e um loader são +//gerados.) + +ilib_for_link('foof','foof.f',[],"f") + +// carrega a biblioteca compartilhada + +exec loader.sce + +//usando a nova primitiva +a=[1,2,3;4,5,6];b= %pi; +[m,n]=size(a); +c=call("foof",a,2,"d",b,3,"d",m,4,"i",n,5,"i","out",[m,n],1,"d"); + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>Ver Também</title> + <simplelist type="inline"> + <member> + <link linkend="link">link</link> + </member> + <member> + <link linkend="c_link">c_link</link> + </member> + <member> + <link linkend="intersci">intersci</link> + </member> + <member> + <link linkend="addinter">addinter</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/dynamic_link/help/ru_RU/addchapter.sce b/modules/dynamic_link/help/ru_RU/addchapter.sce new file mode 100755 index 000000000..06661346d --- /dev/null +++ b/modules/dynamic_link/help/ru_RU/addchapter.sce @@ -0,0 +1,11 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009 - DIGITEO +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +add_help_chapter("Dynamic/incremental Link",SCI+"/modules/dynamic_link/help/ru_RU",%T); + |