- Windows : temporary files (objects) are generated in a intermediate subdirectory (Release or Debug)
ilib_for_link and ilib_gen_Make (with Visual studio) use a same makefile template.
(SCI/modules/dynamic_link/src/scripts/TEMPLATE_MAKEFILE.VC)
+
+ - ilib_verbose (SEP #17) Set level of display returned by dynamic link functions.
Bug fixes:
==========
// load gateways
disp('Load gateways');
-warning_mode = warning('query');
-warning('off');
+ilib_verbose(0);
// load gateways
exec( root_tlbx + '/sci_gateway/loader_gateway.sce' );
-warning(warning_mode);
+
disp('Load help');
//
// <-- Short Description -->
//
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of sci_completeline.c
- Compilation of sci_getpartlevel.c
- Compilation of sci_getfilepartlevel.c
- Compilation of sci_getcommonpart.c
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
+ilib_verbose(0);
// gethi<Tab>
currentline = 'gethi';
ref = ['gethistory';'gethistoryfile'];
// <-- Short Description -->
//
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
+
exec('SCI/modules/completion/tests/utilities/build_primitives.sce',-1);
exec('SCI/modules/completion/tests/utilities/loader.sce',-1);
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- Non-regression test for bug 3051 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3051
-//
-// <-- Short Description -->
-//
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy sci_completeline.c to TMPDIR
- ilib_gen_Make: Copy sci_getpartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getfilepartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getcommonpart.c to TMPDIR
- ilib_gen_Make: Copy libcompletion_c.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
-// gethi<Tab>
-currentline = 'gethi';
-ref = ['gethistory';'gethistoryfile'];
-r = completion(currentline);
-if ~and(r == ref) then bugmes();quit;end
-if getcommonpart(r) <> 'gethistory' then bugmes();quit;end
-cd SCI/contrib/;
-//cd toolbo[TAB]
-currentline = 'cd toolbo';
-r = getfilepartlevel(currentline);
-if r <> 'toolbo' then bugmes();quit;end;
-r2 = completion(r,'files');
-if r2 <> 'toolbox_skeleton' + filesep() then bugmes();quit;end
-r = completeline(currentline,r2,getpartlevel(currentline),getfilepartlevel(currentline),%t);
-if r <> 'cd toolbox_skeleton' + filesep() then bugmes();quit;end
//
// <-- Short Description -->
// Wildcards should not be interpreted as such in completion, but as literal text.
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of sci_completeline.c
- Compilation of sci_getpartlevel.c
- Compilation of sci_getfilepartlevel.c
- Compilation of sci_getcommonpart.c
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
+ilib_verbose(0);
// get*<TAB>
currentline = 'get*';
r = getpartlevel(currentline);
// <-- Short Description -->
// Wildcards should not be interpreted as such in completion, but as literal text.
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
+
exec('SCI/modules/completion/tests/utilities/build_primitives.sce',-1);
exec('SCI/modules/completion/tests/utilities/loader.sce',-1);
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- Non-regression test for bug 3306 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3306
-//
-// <-- Short Description -->
-// Wildcards should not be interpreted as such in completion, but as literal text.
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy sci_completeline.c to TMPDIR
- ilib_gen_Make: Copy sci_getpartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getfilepartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getcommonpart.c to TMPDIR
- ilib_gen_Make: Copy libcompletion_c.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
-// get*<TAB>
-currentline = 'get*';
-r = getpartlevel(currentline);
-if r <> '' then bugmes();quit;end
-r = getfilepartlevel(currentline);
-if r <> '' then bugmes();quit;end
-r = completeline(currentline,'',getpartlevel(currentline),getfilepartlevel(currentline),%f);
-if r <> currentline then bugmes();quit;end;
//
// <-- Short Description -->
// Automatic completion swallows the first completed letter when using double quotes (") around a string, while it gives good
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of sci_completeline.c
- Compilation of sci_getpartlevel.c
- Compilation of sci_getfilepartlevel.c
- Compilation of sci_getcommonpart.c
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
+ilib_verbose(0);
fd = mopen(TMPDIR+'/foofile.ext','wt');
mclose(fd);
cd TMPDIR;
// <-- Short Description -->
// Automatic completion swallows the first completed letter when using double quotes (") around a string, while it gives good
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
+
exec('SCI/modules/completion/tests/utilities/build_primitives.sce',-1);
exec('SCI/modules/completion/tests/utilities/loader.sce',-1);
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- Non-regression test for bug 3306 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3306
-//
-// <-- Short Description -->
-// Automatic completion swallows the first completed letter when using double quotes (") around a string, while it gives good
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy sci_completeline.c to TMPDIR
- ilib_gen_Make: Copy sci_getpartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getfilepartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getcommonpart.c to TMPDIR
- ilib_gen_Make: Copy libcompletion_c.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
-fd = mopen(TMPDIR+'/foofile.ext','wt');
-mclose(fd);
-cd TMPDIR;
-//scipad('foof[TAB]
-currentline = "scipad(''foof";
-r = getfilepartlevel(currentline);
-if r <> 'foof' then bugmes();quit;end;
-r = completion(getfilepartlevel(currentline));
-if r <> 'foofile.ext' then bugmes();quit;end
-r = completeline(currentline,'foofile.ext',getpartlevel(currentline),getfilepartlevel(currentline),%t);
-if r <> 'scipad(''foofile.ext' then bugmes();quit;end;
-//scipad("foof[TAB]
-currentline = "scipad(""foof";
-r = getfilepartlevel(currentline);
-if r <> 'foof' then bugmes();quit;end
-r = completion(getfilepartlevel(currentline));
-if r <> 'foofile.ext' then bugmes();quit;end
-r = completeline(currentline,'foofile.ext',getfilepartlevel(currentline),getpartlevel(currentline),%t);
-if r <> 'scipad(""foofile.ext' then bugmes();quit;end;
// A bug in the completion:
// it removes the line. It should add it at the end instead instead.
// exec le<TAB>
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of sci_completeline.c
- Compilation of sci_getpartlevel.c
- Compilation of sci_getfilepartlevel.c
- Compilation of sci_getcommonpart.c
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
+ilib_verbose(0);
currentline = 'exec le';
r = getpartlevel(currentline);
if r <> 'le' then bugmes();quit;end
// it removes the line. It should add it at the end instead instead.
// exec le<TAB>
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
+
exec('SCI/modules/completion/tests/utilities/build_primitives.sce',-1);
exec('SCI/modules/completion/tests/utilities/loader.sce',-1);
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- Non-regression test for bug 3398 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3398
-//
-// <-- Short Description -->
-// A bug in the completion:
-// it removes the line. It should add it at the end instead instead.
-// exec le<TAB>
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy sci_completeline.c to TMPDIR
- ilib_gen_Make: Copy sci_getpartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getfilepartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getcommonpart.c to TMPDIR
- ilib_gen_Make: Copy libcompletion_c.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
-currentline = 'exec le';
-r = getpartlevel(currentline);
-if r <> 'le' then bugmes();quit;end
-if size(completion(r),'*') == [] then bugmes();quit;end
-r = completeline(currentline,'',getpartlevel(currentline),getfilepartlevel(currentline),%f);
-if r <> currentline then bugmes();quit;end
//
// <-- Short Description -->
// Completion is eating a character.
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of sci_completeline.c
- Compilation of sci_getpartlevel.c
- Compilation of sci_getfilepartlevel.c
- Compilation of sci_getcommonpart.c
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
+ilib_verbose(0);
//cd /h<TAB>
currentline = 'cd /h';
newline = completeline(currentline,'home',getfilepartlevel(currentline),getpartlevel(currentline),%t);
// <-- Short Description -->
// Completion is eating a character.
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
+
exec('SCI/modules/completion/tests/utilities/build_primitives.sce',-1);
exec('SCI/modules/completion/tests/utilities/loader.sce',-1);
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- Non-regression test for bug 3399 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3399
-//
-// <-- Short Description -->
-// Completion is eating a character.
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy sci_completeline.c to TMPDIR
- ilib_gen_Make: Copy sci_getpartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getfilepartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getcommonpart.c to TMPDIR
- ilib_gen_Make: Copy libcompletion_c.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
-//cd /h<TAB>
-currentline = 'cd /h';
-newline = completeline(currentline,'home',getfilepartlevel(currentline),getpartlevel(currentline),%t);
-if newline <> 'cd /home' then bugmes();quit;end
//
// <-- Short Description -->
// Under Scilex, the completion of paths is incorrect
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of sci_completeline.c
- Compilation of sci_getpartlevel.c
- Compilation of sci_getfilepartlevel.c
- Compilation of sci_getcommonpart.c
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
+ilib_verbose(0);
// cd d:\Pro[TAB]
currentline = 'cd d:\Pro';
newline = completeline(currentline,'Projects',getfilepartlevel(currentline),getpartlevel(currentline),%t);
// <-- Short Description -->
// Under Scilex, the completion of paths is incorrect
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
+
exec('SCI/modules/completion/tests/utilities/build_primitives.sce',-1);
exec('SCI/modules/completion/tests/utilities/loader.sce',-1);
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- Non-regression test for bug 3757 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3757
-//
-// <-- Short Description -->
-// Under Scilex, the completion of paths is incorrect
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy sci_completeline.c to TMPDIR
- ilib_gen_Make: Copy sci_getpartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getfilepartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getcommonpart.c to TMPDIR
- ilib_gen_Make: Copy libcompletion_c.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
-// cd d:\Pro[TAB]
-currentline = 'cd d:\Pro';
-newline = completeline(currentline,'Projects',getfilepartlevel(currentline),getpartlevel(currentline),%t);
-if newline <> 'cd d:\Projects' then bugmes();quit;end
// <-- Short Description -->
// Problem of completion with version 5.1:
// (With NW mode).
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of sci_completeline.c
- Compilation of sci_getpartlevel.c
- Compilation of sci_getfilepartlevel.c
- Compilation of sci_getcommonpart.c
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
+ilib_verbose(0);
// wavread("/ho[TAB]
currentline = 'wavread(""/ho';
r = getfilepartlevel(currentline);
// Problem of completion with version 5.1:
// (With NW mode).
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
+
exec('SCI/modules/completion/tests/utilities/build_primitives.sce',-1);
exec('SCI/modules/completion/tests/utilities/loader.sce',-1);
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- Non-regression test for bug 4039 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=4039
-//
-// <-- Short Description -->
-// Problem of completion with version 5.1:
-// (With NW mode).
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy sci_completeline.c to TMPDIR
- ilib_gen_Make: Copy sci_getpartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getfilepartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getcommonpart.c to TMPDIR
- ilib_gen_Make: Copy libcompletion_c.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
-// wavread("/ho[TAB]
-currentline = 'wavread(""/ho';
-r = getfilepartlevel(currentline);
-if r <> '/ho' then bugmes();quit;end
-newline = completeline(currentline,'home',getfilepartlevel(currentline),getpartlevel(currentline),%t);
-if newline <> 'wavread(""/home' then bugmes();quit;end
-// wavread("/home/sy[TAB]
-currentline = 'wavread(""/home/sy';
-r = getfilepartlevel(currentline);
-if r <> '/home/sy' then bugmes();quit;end
-newline = completeline(currentline,'sylvestre',getfilepartlevel(currentline),getpartlevel(currentline),%t);
-if newline <> 'wavread(""/home/sylvestre' then bugmes();quit;end
//
// <-- Short Description -->
// Completion STD mode.
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of sci_completeline.c
- Compilation of sci_getpartlevel.c
- Compilation of sci_getfilepartlevel.c
- Compilation of sci_getcommonpart.c
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
+ilib_verbose(0);
chdir(TMPDIR);
mkdir('bug_4067');
chdir('bug_4067');
// <-- Short Description -->
// Completion STD mode.
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
+
exec('SCI/modules/completion/tests/utilities/build_primitives.sce',-1);
exec('SCI/modules/completion/tests/utilities/loader.sce',-1);
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2009 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- Non-regression test for bug 4067 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=4067
-//
-// <-- Short Description -->
-// Completion STD mode.
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy sci_completeline.c to TMPDIR
- ilib_gen_Make: Copy sci_getpartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getfilepartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getcommonpart.c to TMPDIR
- ilib_gen_Make: Copy libcompletion_c.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
-chdir(TMPDIR);
-mkdir('bug_4067');
-chdir('bug_4067');
-fd = mopen('bugA.sce','wt');
-mclose(fd);
-fd = mopen('bugB.sce','wt');
-mclose(fd);
-//exec bug<tab>
-currentline = 'exec bug';
-r = getfilepartlevel(currentline);
-if r <> 'bug' then bugmes();quit;end
-r = completion(getfilepartlevel(currentline),'files');
-if and(gsort(r) <> gsort(['bugA.sce';'bugB.sce'])) then bugmes();quit;end
-newline = completeline(currentline,'bugA.sce',getfilepartlevel(currentline),getpartlevel(currentline),%t);
-if newline<>'exec bugA.sce' then bugmes();quit;end
-// -->cd /h<TAB>
-currentline = 'cd /h';
-r = getfilepartlevel(currentline);
-if r <> '/h' then bugmes();quit;end
-newline = completeline(currentline,'/home',getfilepartlevel(currentline),getpartlevel(currentline),%t);
-if newline<>'cd /home' then bugmes();quit;end
//
// <-- Short Description -->
// Completion delete some characters of the string we are typing (With NW mode).
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of sci_completeline.c
- Compilation of sci_getpartlevel.c
- Compilation of sci_getfilepartlevel.c
- Compilation of sci_getcommonpart.c
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
+ilib_verbose(0);
// cd SCI/mod<TAB>
currentline = 'cd SCI/mod';
r = getfilepartlevel(currentline);
// <-- Short Description -->
// Completion delete some characters of the string we are typing (With NW mode).
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
+
exec('SCI/modules/completion/tests/utilities/build_primitives.sce',-1);
exec('SCI/modules/completion/tests/utilities/loader.sce',-1);
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- Non-regression test for bug 4095 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=4095
-//
-// <-- Short Description -->
-// Completion delete some characters of the string we are typing (With NW mode).
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy sci_completeline.c to TMPDIR
- ilib_gen_Make: Copy sci_getpartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getfilepartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getcommonpart.c to TMPDIR
- ilib_gen_Make: Copy libcompletion_c.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
-// cd SCI/mod<TAB>
-currentline = 'cd SCI/mod';
-r = getfilepartlevel(currentline);
-if r <> 'SCI/mod' then bugmes();quit;end
-r = completion(getfilepartlevel(currentline),'files');
-if r <> 'modules' + filesep() then bugmes();quit;end
-newline = completeline(currentline,r,getfilepartlevel(currentline),getpartlevel(currentline),%t);
-if newline <> 'cd SCI/modules' + filesep() then bugmes();quit;end
-// cd SCI/modules/file<TAB>
-currentline = 'cd SCI/modules/file';
-r = getfilepartlevel(currentline);
-if r <> 'SCI/modules/file' then bugmes();quit;end
-r = completion(getfilepartlevel(currentline),'files');
-if r <> 'fileio' + filesep() then bugmes();quit;end
-newline = completeline(currentline,r,getfilepartlevel(currentline),getpartlevel(currentline),%t);
-if newline <> 'cd SCI/modules/fileio' + filesep() then bugmes();quit;end
-// cd SCI/modules/fileio/te<TAB>
-currentline = 'cd SCI/modules/fileio/te';
-r = getfilepartlevel(currentline);
-if r <> 'SCI/modules/fileio/te' then bugmes();quit;end
-r = completion(getfilepartlevel(currentline),'files');
-if r <> 'tests' + filesep() then bugmes();quit;end
-newline = completeline(currentline,r,getfilepartlevel(currentline),getpartlevel(currentline),%t);
-if newline <> 'cd SCI/modules/fileio/tests' + filesep() then bugmes();quit;end
-// cd SCI/modules/fileio/tests/u<TAB>
-currentline = 'cd SCI/modules/fileio/tests/u';
-r = getfilepartlevel(currentline);
-if r <> 'SCI/modules/fileio/tests/u' then bugmes();quit;end
-r = completion(getfilepartlevel(currentline),'files');
-if r <> 'unit_tests' + filesep() then bugmes();quit;end
-newline = completeline(currentline,r,getfilepartlevel(currentline),getpartlevel(currentline),%t);
-if newline <> 'cd SCI/modules/fileio/tests/unit_tests' + filesep() then bugmes();quit;end
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of sci_completeline.c
- Compilation of sci_getpartlevel.c
- Compilation of sci_getfilepartlevel.c
- Compilation of sci_getcommonpart.c
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
+ilib_verbose(0);
currentline = 'cd /home/sy';
r = completeline(currentline,'sylvestre',getfilepartlevel(currentline),getpartlevel(currentline),%t);
if r <> 'cd /home/sylvestre' then bugmes();quit;end
// This file is distributed under the same license as the Scilab package.
// =============================================================================
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
+
exec('SCI/modules/completion/tests/utilities/build_primitives.sce',-1);
exec('SCI/modules/completion/tests/utilities/loader.sce',-1);
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2009 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy sci_completeline.c to TMPDIR
- ilib_gen_Make: Copy sci_getpartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getfilepartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getcommonpart.c to TMPDIR
- ilib_gen_Make: Copy libcompletion_c.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
-currentline = 'cd /home/sy';
-r = completeline(currentline,'sylvestre',getfilepartlevel(currentline),getpartlevel(currentline),%t);
-if r <> 'cd /home/sylvestre' then bugmes();quit;end
-currentline = 'cd d:\GIT-scilab-';
-r = completeline(currentline,'d:\GIT-scilab-branch',getpartlevel(currentline),getfilepartlevel(currentline),%t);
-if r <> 'cd d:\GIT-scilab-branch' then bugmes();quit;end
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of sci_completeline.c
- Compilation of sci_getpartlevel.c
- Compilation of sci_getfilepartlevel.c
- Compilation of sci_getcommonpart.c
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
+ilib_verbose(0);
r = getcommonpart(['home','homer']);
if r <> 'home' then bugmes();quit;end;
r = getcommonpart(['gethistory','gethistoryfile','gethis']);
// This file is distributed under the same license as the Scilab package.
// =============================================================================
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
+
exec('SCI/modules/completion/tests/utilities/build_primitives.sce',-1);
exec('SCI/modules/completion/tests/utilities/loader.sce',-1);
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2009 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy sci_completeline.c to TMPDIR
- ilib_gen_Make: Copy sci_getpartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getfilepartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getcommonpart.c to TMPDIR
- ilib_gen_Make: Copy libcompletion_c.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
-r = getcommonpart(['home','homer']);
-if r <> 'home' then bugmes();quit;end;
-r = getcommonpart(['gethistory','gethistoryfile','gethis']);
-if r <> 'gethis' then bugmes();quit;end;
-r = getcommonpart(['gethistory','gethistoryfile','geths']);
-if r <> 'geth' then bugmes();quit;end;
-ws = ['umf_ludel', 'umf_lufact', 'umf_luget', 'umf_luinfo', 'umf_lusolve', 'umfpack', 'umfpacklib'];
-r = getcommonpart(ws);
-if r <> 'umf' then bugmes();quit;end;
-ws = ['umf_ludel', 'umf_lufact', 'umf_luget', 'umf_luinfo', 'umf_lusolve'];
-r = getcommonpart(ws);
-if r <> 'umf_lu' then bugmes();quit;end;
-ws = ['c:\Program files\GIT-scilab-branch-5.1','c:\Program files\GIT-scilab-master'];
-r = getcommonpart(ws);
-if r <> 'c:\Program files\GIT-scilab-' then bugmes();quit;end;
-ws = ['/home/sylvestre/GIT-scilab-branch-5.1','/home/sylvestre/GIT-scilab-master'];
-r = getcommonpart(ws);
-if r <> '/home/sylvestre/GIT-scilab-' then bugmes();quit;end;
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of sci_completeline.c
- Compilation of sci_getpartlevel.c
- Compilation of sci_getfilepartlevel.c
- Compilation of sci_getcommonpart.c
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
+ilib_verbose(0);
r = getfilepartlevel('cd c:\Program Files\scilab-5.1');
if r <>'c:\Program Files\scilab-5.1' then bugmes();quit;end;
r = getfilepartlevel('cd(""c:\Program Files\scilab-5.1');
// This file is distributed under the same license as the Scilab package.
// =============================================================================
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
+
exec('SCI/modules/completion/tests/utilities/build_primitives.sce',-1);
exec('SCI/modules/completion/tests/utilities/loader.sce',-1);
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2009 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy sci_completeline.c to TMPDIR
- ilib_gen_Make: Copy sci_getpartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getfilepartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getcommonpart.c to TMPDIR
- ilib_gen_Make: Copy libcompletion_c.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
-r = getfilepartlevel('cd c:\Program Files\scilab-5.1');
-if r <>'c:\Program Files\scilab-5.1' then bugmes();quit;end;
-r = getfilepartlevel('cd(""c:\Program Files\scilab-5.1');
-if r <>'c:\Program Files\scilab-5.1' then bugmes();quit;end;
-r = getfilepartlevel('cd(''c:\Program Files\scilab-5.1');
-if r <>'c:\Program Files\scilab-5.1' then bugmes();quit;end;
-r = getfilepartlevel('cd /home/scilabs/scilab-5.1');
-if r <>'/home/scilabs/scilab-5.1' then bugmes();quit;end;
-r = getfilepartlevel('cd(""/home/scilabs/scilab-5.1');
-if r <>'/home/scilabs/scilab-5.1' then bugmes();quit;end;
-r = getfilepartlevel('cd(''/home/scilabs/scilab-5.1');
-if r <>'/home/scilabs/scilab-5.1' then bugmes();quit;end;
-r = getfilepartlevel('cd ../');
-if r <>'../' then bugmes();quit;end;
-r = getfilepartlevel('cd ~/');
-if r <>'~/' then bugmes();quit;end;
-r = getfilepartlevel('cd ~');
-if r <>'~' then bugmes();quit;end;
-r = getfilepartlevel('cd ');
-if r <>'' then bugmes();quit;end;
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of sci_completeline.c
- Compilation of sci_getpartlevel.c
- Compilation of sci_getfilepartlevel.c
- Compilation of sci_getcommonpart.c
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
+ilib_verbose(0);
r = getpartlevel('cd c:\Program Files\scilab-5.1');
if r <>'1' then bugmes();quit;end;
-r = getpartlevel('cd(""c:\Program Files\scilab-5.1')
- r =
-
- 1
+r = getpartlevel('cd(""c:\Program Files\scilab-5.1');
if r <>'1' then bugmes();quit;end;
r = getpartlevel('printf(""hello"")');
if r <>'' then bugmes();quit;end;
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
-
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
+
exec('SCI/modules/completion/tests/utilities/build_primitives.sce',-1);
exec('SCI/modules/completion/tests/utilities/loader.sce',-1);
r = getpartlevel('cd c:\Program Files\scilab-5.1');
if r <>'1' then pause,end;
-r = getpartlevel('cd(""c:\Program Files\scilab-5.1')
+r = getpartlevel('cd(""c:\Program Files\scilab-5.1');
if r <>'1' then pause,end;
r = getpartlevel('printf(""hello"")');
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2009 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy sci_completeline.c to TMPDIR
- ilib_gen_Make: Copy sci_getpartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getfilepartlevel.c to TMPDIR
- ilib_gen_Make: Copy sci_getcommonpart.c to TMPDIR
- ilib_gen_Make: Copy libcompletion_c.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-Shared archive loaded.
-Link done.
-Shared archive loaded.
-Link done.
-r = getpartlevel('cd c:\Program Files\scilab-5.1');
-if r <>'1' then bugmes();quit;end;
-r = getpartlevel('cd(""c:\Program Files\scilab-5.1')
- r =
-
- 1
-if r <>'1' then bugmes();quit;end;
-r = getpartlevel('printf(""hello"")');
-if r <>'' then bugmes();quit;end;
-r = getpartlevel('g.children');
-if r <> 'children' then bugmes();quit;end
-r = getpartlevel('1+myvariable');
-if r <> 'myvariable' then bugmes();quit;end
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2009 - DIGITEO - Allan CORNET
<term>k = 2</term>
<listitem>
- <para>default value on prompt</para>
+ <para>default value on scilab prompt.</para>
+
+ <para>Please notices that mode does not used at prompt, only in an
+ exec-file or a scilab function.</para>
</listitem>
</varlistentry>
<para>Line display is disabled for compiled scilab function (see getf or
comp). By default, Scilab functions are executed using the silent ("-1")
mode.</para>
+
+ <para>functions in a function library are executed using "-1" mode.</para>
</refsection>
<refsection>
<programlisting role="example">
// copy - paste in scilab
-mode(2)
-
-function example_mode_0()
- mode(0)
- a = 3
-endfunction
-
-example_mode_0()
-
-function example_mode_l1()
- mode(-1)
- a = 3
-endfunction
-
-example_mode_l1()
-
-function example_mode_2()
- mode(2)
- a = 3
+function example_mode( level_mode )
+ mode(level_mode)
+ a = 3
+ disp(mode());
endfunction
-example_mode_2()
-
-function example_mode_1()
- mode(1)
- a = 3
-endfunction
-
-example_mode_1()
-
-function example_mode_3()
- mode(3)
- a = 3
-endfunction
-
-example_mode_3()
-
-function example_mode_7()
- mode(7)
- a = 3
-endfunction
+mode(2)
-example_mode_7()
+example_mode(0)
+example_mode(-1)
+example_mode(2)
+example_mode(1)
+example_mode(3)
+example_mode(7)
mode(2)
</simplelist>
</refsection>
</refentry>
-
<term>k = 2</term>
<listitem>
- <para>valeur par défaut retourné au prompt</para>
+ <para>valeur par défaut retourné au prompt de scilab.</para>
+ <para>veuillez noter que ce mode ne doit pas etre utilisé au prompt mais seulement via un script ou une fonction.</para>
</listitem>
</varlistentry>
<para>L'affichage est supprimé dans les fonctions compilées
(voir getf ou comp). Par défaut les fonctions Scilab sont
éxécutées en mode silencieux ("-1").</para>
+
+ <para>Les fonctions incluses dans une librairie de fonctions scilab sont executés avec le mode "-1".</para>
</refsection>
<refsection>
<programlisting role="exemple">
// copier - coller ces lignes dans scilab
-mode(2)
-
-function example_mode_0()
- mode(0)
- a = 3
-endfunction
-
-example_mode_0()
-
-function example_mode_l1()
- mode(-1)
- a = 3
-endfunction
-
-example_mode_l1()
-
-function example_mode_2()
- mode(2)
- a = 3
-endfunction
-
-example_mode_2()
-
-function example_mode_1()
- mode(1)
- a = 3
-endfunction
-
-example_mode_1()
-
-function example_mode_3()
- mode(3)
- a = 3
+function example_mode( level_mode )
+ mode(level_mode)
+ a = 3
+ disp(mode());
endfunction
-example_mode_3()
-
-function example_mode_7()
- mode(7)
- a = 3
-endfunction
+mode(2)
-example_mode_7()
+example_mode(0)
+example_mode(-1)
+example_mode(2)
+example_mode(1)
+example_mode(3)
+example_mode(7)
mode(2)
+
</programlisting>
</refsection>
#include "BOOL.h"
/**
+* by default at Prompt mode == 2
+*/
+#define INITIALIZATION_EXEC_MODE 2
+#define SILENT_EXEC_MODE -1
+#define ECHO_EXEC_MODE 1
+/**
* set a mode in exec file
* @param[in] mode
* @return TRUE if mode is modified
*/
-BOOL set_mode_exec(int mode);
+BOOL setExecMode(int _mode);
/**
* get mode in exec file
* @return current mode
*/
-int get_mode_exec(void);
+int getExecMode(void);
#endif /* __MODE_EXEC_H__ */
/*--------------------------------------------------------------------------*/
if (Rhs == 0)
{
int n = 1 ,l = 0;
- int mode = get_mode_exec();
+ int mode = getExecMode();
CreateVar(Rhs+1, MATRIX_OF_INTEGER_DATATYPE, &n, &n,&l);
*istk(l) = (int)mode;
return 0;
}
- set_mode_exec(mode);
+ setExecMode(mode);
if ( (mode == 7) || (mode == 4) )
{
#include "stack-def.h"
#include "machine.h"
/*--------------------------------------------------------------------------*/
-BOOL set_mode_exec(int mode)
+BOOL setExecMode(int _mode)
{
int *Lct = C2F(iop).lct - 1;
- if ( mode != Lct[4] )
+ if ( _mode != Lct[4] )
{
- Lct[4] = mode;
+ Lct[4] = _mode;
return TRUE;
}
return FALSE;
}
/*--------------------------------------------------------------------------*/
-int get_mode_exec(void)
+int getExecMode(void)
{
int *Lct = C2F(iop).lct - 1;
return Lct[4];
#include "msgs.h"
#include "scilabmode.h"
#include "stack-def.h" /* C2F(basbrk) */
+#include "mode_exec.h"
/*--------------------------------------------------------------------------*/
#undef Lstk
#undef Infstk
static int *Lstk = C2F(vstk).lstk-1;
static int *Lin = C2F(iop).lin-1;
static int *Lpt = C2F(iop).lpt-1;
- static int *Lct = C2F(iop).lct-1;
+ static int *Lct = C2F(iop).lct - 1;
/* System generated locals */
int i__2, i__3;
C2F(recu).icall = 0;
C2F(iop).rio = C2F(iop).rte;
Lct[3] = 0;
- Lct[4] = 2;
+ setExecMode(INITIALIZATION_EXEC_MODE);
Lpt[1] = 1;
if (job == -1) {
goto L13;
/* get a new line */
/* ------------------- */
L12:
- if (Lct[4] <= -10) {
- Lct[4] = -Lct[4] - 11;
+ if (getExecMode() <= -10) {
+ setExecMode( -getExecMode() - 11 );
} else {
- if (Lct[4] / 2 % 2 == 1) {
- i__2 = Lct[4] / 4;
+ if (getExecMode() / 2 % 2 == ECHO_EXEC_MODE) {
+ i__2 = getExecMode() / 4;
/* Manage space between two prompts */
if (!returnFromCallbackExec)
{
Rstk[Pt] = 701;
C2F(basbrk).iflag = FALSE;
Fin = 2;
- if (Lct[4] <= -10) {
+ if (getExecMode() <= -10) {
Fin = -1;
- Lct[4] = -Lct[4] - 11;
+ setExecMode(-getExecMode() - 11);
}
/* *call* macro */
goto L88;
L73:
/* print if required */
/* ---------------------- */
- if (Lct[4] < 0 || Fin == 0) {
+ if (getExecMode() < 0 || Fin == 0) {
goto L76;
}
if (! ((C2F(com).sym != semi && Lct[3] == 0) || (C2F(com).sym == semi &&
#include "core_math.h"
#include "scilabmode.h"
#include "stack-def.h" /* C2F(basbrk) */
+#include "mode_exec.h"
#undef Lstk
#undef Infstk
static int *Lstk = C2F(vstk).lstk-1;
static int *Lin = C2F(iop).lin-1;
static int *Lpt = C2F(iop).lpt-1;
- static int *Lct = C2F(iop).lct-1;
static int *Infstk = C2F(vstk).infstk-1;
+ static int *Lct = C2F(iop).lct - 1;
static double equiv_4[1];
#define x (equiv_4)
Pstk[Pt] = C2F(iop).rio;
C2F(iop).rio = C2F(iop).rte;
Fin = 2;
- if (Lct[4] <= -10) {
+ if (getExecMode() <= -10) {
Fin = -1;
- Lct[4] = -Lct[4] - 11;
+ setExecMode(-getExecMode() - 11);
}
Ids[1 + Pt * nsiz] = lc;
Ids[2 + Pt * nsiz] = Top;
Lpt[2] = Lin[2 + k];
Lpt[3] = Lin[3 + k];
Lpt[4] = Lin[4 + k];
- Lct[4] = Lin[6 + k ];
+ setExecMode(Lin[6 + k ]);
Lpt[6] = k;
if (Rstk[Pt] <= 502) {
if (Pt>1) {
}
L107:
- if (Lct[4] / 2 % 2 == 1) {
- i2 = Lct[4] / 4;
+ if (getExecMode() / 2 % 2 == ECHO_EXEC_MODE) {
+ i2 = getExecMode() / 4;
C2F(prompt)(&i2, &iesc);
}
++Lct[8];
L170:
/* print stored variable */
- if (Lct[4] >= 0 && *istk(1 + lc) != semi && kid != 0) {
+ if (getExecMode() >= 0 && *istk(1 + lc) != semi && kid != 0) {
C2F(print)(id, &kid, &C2F(iop).wte);
}
lc += 2;
goto L253;
}
/* fin points on the newly saved variable */
- if (!(Lct[4] >= 0 && ip != semi && Fin != 0)) goto L253;
+ if (!(getExecMode() >= 0 && ip != semi && Fin != 0)) goto L253;
ifin=Fin;
L232:
C2F(print)(istk(li), &ifin, &C2F(iop).wte);
goto L253;
}
/* fin points on the newly saved variable */
- if (!(Lct[4] >= 0 && ip != semi && Fin != 0)) goto L252;
+ if (!(getExecMode() >= 0 && ip != semi && Fin != 0)) goto L252;
ifin=Fin;
L251:
C2F(print)(istk(li), &ifin, &C2F(iop).wte);
Ids[3 + Pt * nsiz] = C2F(errgst).err2;
Ids[4 + Pt * nsiz] = C2F(errgst).err1;
Ids[5 + Pt * nsiz] = C2F(errgst).errpt;
- Ids[6 + Pt * nsiz] = (Lct[4]+100)+10000*C2F(com).sym;
+ Ids[6 + Pt * nsiz] = (getExecMode()+100)+10000*C2F(com).sym;
/* set error recovery mode without message*/
C2F(errgst).errct = -(900000+1);
C2F(errgst).errpt = Pt;
C2F(errgst).err1 = Ids[4 + Pt * nsiz];
C2F(errgst).errpt = Ids[5 + Pt * nsiz];
C2F(com).sym = Ids[6 + Pt * nsiz]/10000;
- Lct[4] = Ids[6 + Pt * nsiz]-10000*C2F(com).sym-100;
+ setExecMode(Ids[6 + Pt * nsiz]-10000*C2F(com).sym-100);
if (ok) {
/* no error occured in the try part*/
nc = *istk(l0-1);
[yy,nn,hotd]=dae("root",[y01,y0d1],t01,t,rtol,atol,'res2','jac2',ng,'gr2',hotd);
if abs(nn(1)-162.57763)>0.004 then bugmes();quit;end
//same with C code
+ilib_verbose(0);
code=['#include <math.h>'
'void res22(double *t,double *y,double *yd,double *res,int *ires,double *rpar,int *ipar)'
'{res[0] = yd[0] - y[1];'
'{ groot[0] = y[0];}'];
mputl(code,TMPDIR+'/t22.c') ;
ilib_for_link(['res22' 'jac22' 'gr22'],'t22.o',[],'c',TMPDIR+'/Makefile',TMPDIR+'/t22loader.sce');
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy t22.o to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the Makefile
-Shared archive loaded.
-Link done.
rtol=[1.d-6;1.d-6];atol=[1.d-6;1.d-4];
t0=0;y0=[2;0];y0d=[0;-2];t=[20:20:200];ng=1;
%DAEOPTIONS =list([],0,[],[],[],0,0);
'}'];
mputl(ccode,TMPDIR+'/band.c'); //create the C file of myjac
ilib_for_link(['myres','myjac'],'band.o',[],'c',TMPDIR+'/Makefile',TMPDIR+'/bandloader.sce');//compile
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy band.o to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the Makefile
-Shared archive loaded.
-Link done.
y0=ones(n,1);yd0=0*y0;
yb=dae([y0,yd0],0,0:0.1:10,'myres','myjac');
-norm(y-yb)
- ans =
-
- 8.602E-13
+a = norm(y-yb);
+if (a > %eps * 1e5) then bugmes();quit;end
if abs(nn(1)-162.57763)>0.004 then pause,end
//same with C code
+
+ilib_verbose(0);
+
code=['#include <math.h>'
'void res22(double *t,double *y,double *yd,double *res,int *ires,double *rpar,int *ipar)'
'{res[0] = yd[0] - y[1];'
t01=nn(1);t=100:20:200;[pp,qq]=size(yy);y01=yy(2:3,qq);y0d1=yy(3:4,qq);
[yy,nn,hotd]=dae("root",[y01,y0d1],t01,t,atol,rtol,'res22','jac22',ng,'gr22',hotd);
-
-
rtol=[1.d-6;1.d-6];
atol=[1.d-6;1.d-4];
t0=0;y0=[2;0];y0d=[0;-2];t=[20:20:200];ng=1;
t01=nn(1);t=100:20:200;[pp,qq]=size(yy);y01=yy(2:3,qq);y0d1=yy(3:4,qq);
[yy,nn,hotd]=dae("root",[y01,y0d1],t01,t,atol,rtol,'res22','jac22',ng,'gr22',hotd);
-
//banded systems
A=[-17,6,3,0,0,0,0,0,0,0;
exec(TMPDIR+'/bandloader.sce'); //incremental linking
y0=ones(n,1);yd0=0*y0;
yb=dae([y0,yd0],0,0:0.1:10,'myres','myjac');
-norm(y-yb)
+a = norm(y-yb);
+if (a > %eps * 1e5) then pause,end
+++ /dev/null
-// ===========================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - INRIA - Sabinere Gauzere
-//
-// This file is distributed under the same license as the Scilab package.
-// ===========================================================================
-//DASSL
-// PROBLEM 1.. LINEAR DIFFERENTIAL/ALGEBRAIC SYSTEM
-//
-//X1DOT + 10.0*X1 = 0
-//X1 + X2 = 1
-//X1(0) = 1.0, X2(0) = 0.0
-//
-t=1:10;t0=0;y0=[1;0];y0d=[-10;0];
-info=list([],0,[],[],[],0,0);
-// Calling Scilab functions
-deff('[r,ires]=dres1(t,y,ydot)','r=[ydot(1)+10*y(1);y(2)+y(1)-1];ires=0')
-deff('pd=djac1(t,y,ydot,cj)','pd=[cj+10,0;1,1]')
-// scilab function, without jacobian
-yy0=dae([y0,y0d],t0,t,dres1);
-// scilab functions, with jacobian
-yy1=dae([y0,y0d],t0,t,dres1,djac1);
-// fortran routine, without jocabian
-yy2=dae([y0,y0d],t0,t,'dres1'); //=yy0
-if norm(yy2-yy0,1)>1E-5 then bugmes();quit;end
-// fortran routines, with jacobian
-yy3=dae([y0,y0d],t0,t,'dres1','djac1'); //=yy1
-if norm(yy3-yy1,1)>1E-5 then bugmes();quit;end
-yy3bis=dae([y0,y0d],t0,t,'dres1',djac1);
-// call fortran dres1 and scilab's djac1
-yy3ter=dae([y0,y0d],t0,t,dres1,'djac1');
-//
-// with specific atol and rtol parameters
-atol=1.d-6;rtol=0;
-yy4=dae([y0,y0d],t0,t,rtol,atol,dres1);
-yy5=dae([y0,y0d],t0,t,rtol,atol,'dres1'); //=yy4
-if norm(yy5-yy4,1)>1E-9 then bugmes();quit;end
-yy6=dae([y0,y0d],t0,t,rtol,atol,dres1,djac1);
-yy7=dae([y0,y0d],t0,t,rtol,atol,'dres1','djac1'); //==yy6
-if norm(yy7-yy6,1)>1E-12 then bugmes();quit;end
-//
-// Testing E xdot - A x=0
-// x(0)=x0; xdot(0)=xd0
-rand('seed',0);
-nx=5;
-E=rand(nx,1)*rand(1,nx);
-A=rand(nx,nx);
-// Index 1
-[Si,Pi,Di,o]=penlaur(E,A);
-pp=Si*E;
-[q,m]=fullrf(pp);
-x0=q(:,1);
-x0d=pinv(E)*A*x0;
-deff('[r,ires]=g(t,x,xdot)','r=E*xdot-A*x;ires=0');
-t=[1,2,3];t0=0;
-%DAEOPTIONS=list([],0,[],[],[],0,0);
-x=dae([x0,x0d],t0,t,g);
-x=[t;x];
-x1=x(2:nx+1,:);
-if norm(pp*x1-x1,1)>1.d-5 then bugmes();quit;end //bug car on a plus la première ligne
-//x(4) goes through 1 at t=1.5409711;
-%DAEOPTIONS=list([],0,[],[],[],0,0);
-t=1.5409711;
-ww=dae([x0,x0d],t0,t,g);
-ww=[t;ww];
-if abs(ww(5)-1)>0.001 then bugmes();quit;end
-deff('[rt]=surface(t,y,yd)','rt=y(4)-1');
-nbsurf=1;
-[yyy,nnn]=dae("root",[x0,x0d],t0,t,g,nbsurf,surface);
-deff('pd=j(t,y,ydot,cj)','pd=cj*E-A');
-x=dae([x0,x0d],t0,t,g,j);
-x=[t;x];
-x2=x(2:nx+1,1);
-if norm(x2-ww(2:nx+1,1),1)>0.0001 then bugmes();quit;end
-[yyy1,nnn]=dae("root",[x0,x0d],t0,t,g,j,nbsurf,surface);
-//x0d is not known:
-x0d=ones(x0);
-%DAEOPTIONS=list([],0,[],[],[],0,1);
-x=dae([x0,x0d],t0,t,g);
-xn=dae([x0,x0d],t0,t,g,j);
-if norm(x-xn,1)>0.00001 then bugmes();quit;end
-//PROBLEM 2..
-DAEOPTIONS=list([],0,[],[],[],0,0);
-y0=zeros(25,1);y0(1)=1;
-delta=0*y0;
-//link('dres2.o','dres2');
-//y0d=call('dres2',0,1,'d',y0,2,'d',delta,3,'d',0,5,'i',0,6,'d',0,7,'d','out',[25,1],4,'d');
-y0d=zeros(y0);y0d(1)=-2;y0d(2)=1;y0d(6)=1;
-t0=0;t=[0.01,0.1,1,10,100];
-rtol=0;atol=1.d-6;
-y=dae([y0,y0d],t0,t,rtol,atol,'dres2');
-// Root finder
-//
-//-----------------------------------------------------------------------
-// First problem.
-// The initial value problem is..
-// DY/DT = ((2*LOG(Y) + 8)/T - 5)*Y, Y(1) = 1, 1 .LE. T .LE. 6
-// The solution is Y(T) = EXP(-T**2 + 5*T - 4), YPRIME(1) = 3
-// The two root functions are..
-// G1 = ((2*LOG(Y)+8)/T - 5)*Y (= DY/DT) (with root at T = 2.5),
-// G2 = LOG(Y) - 2.2491 (with roots at T = 2.47 and 2.53)
-//-----------------------------------------------------------------------
-y0=1;t=2:6;t0=1;y0d=3;
-%DAEOPTIONS=list([],0,[],[],[],0,0);
-atol=1.d-6;rtol=0;ng=2;
-[yy,nn]=dae("root",[y0,y0d],t0,t,rtol,atol,'res1',ng,'gr1');
-if abs(nn(1)-2.47)>0.001 then bugmes();quit;end
-y0=yy(1,2);y0d=yy(2,2);t0=nn(1);t=[3,4,5,6];
-[yy,nn]=dae("root",[y0,y0d],t0,t,rtol,atol,'res1',ng,'gr1');
-if abs(nn(1)-2.5)>0.001 then bugmes();quit;end
-y0=yy(1,1);y0d=yy(2,1);t0=nn(1);t=[3,4,5,6];
-[yy,nn]=dae("root",[y0,y0d],t0,t,rtol,atol,'res1',ng,'gr1');
-if abs(nn(1)-2.53)>0.001 then bugmes();quit;end
-deff('[delta,ires]=res1(t,y,ydot)','ires=0;delta=ydot-((2*log(y)+8)/t-5)*y')
-deff('[rts]=gr1(t,y,yd)','rts=[((2*log(y)+8)/t-5)*y;log(y)-2.2491]')
-y0=1;t=2:6;t0=1;y0d=3;
-%DAEOPTIONS=list([],0,[],[],[],0,0);
-atol=1.d-6;rtol=0;ng=2;
-[yy,nn]=dae("root",[y0,y0d],t0,t,rtol,atol,res1,ng,gr1);
-if abs(nn(1)-2.47)>0.001 then bugmes();quit;end
-y0=yy(1,2);y0d=yy(2,2);t0=nn(1);t=[3,4,5,6];
-[yy,nn]=dae("root",[y0,y0d],t0,t,rtol,atol,res1,ng,gr1);
-if abs(nn(1)-2.5)>0.001 then bugmes();quit;end
-y0=yy(1,1);y0d=yy(2,1);t0=nn(1);t=[3,4,5,6];
-[yy,nn]=dae("root",[y0,y0d],t0,t,rtol,atol,res1,ng,gr1);
-if abs(nn(1)-2.53)>0.001 then bugmes();quit;end
-//
-//-----------------------------------------------------------------------
-// Second problem (Van Der Pol oscillator).
-// The initial value problem is..
-// DY1/DT = Y2, DY2/DT = 100*(1 - Y1**2)*Y2 - Y1,
-// Y1(0) = 2, Y2(0) = 0, 0 .LE. T .LE. 200
-// Y1PRIME(0) = 0, Y2PRIME(0) = -2
-// The root function is G = Y1.
-// An analytic solution is not known, but the zeros of Y1 are known
-// to 15 figures for purposes of checking the accuracy.
-//-----------------------------------------------------------------------
-rtol=[1.d-6;1.d-6];atol=[1.d-6;1.d-4];
-t0=0;y0=[2;0];y0d=[0;-2];t=[20:20:200];ng=1;
-%DAEOPTIONS=list([],0,[],[],[],0,0);
-[yy,nn]=dae("root",[y0,y0d],t0,t,rtol,atol,'res2','jac2',ng,'gr2');
-if abs(nn(1)-81.163512)>0.001 then bugmes();quit;end
-deff('[delta,ires]=res2(t,y,ydot)',...
-'ires=0;y1=y(1),y2=y(2),delta=[ydot-[y2;100*(1-y1*y1)*y2-y1]]')
-[yy,nn]=dae("root",[y0,y0d],t0,t,rtol,atol,res2,'jac2',ng,'gr2');
-deff('J=jac2(t,y,ydot,c)','y1=y(1);y2=y(2);J=[c,-1;200*y1*y2+1,c-100*(1-y1*y1)]')
-[yy,nn]=dae("root",[y0,y0d],t0,t,rtol,atol,res2,jac2,ng,'gr2');
-deff('s=gr2(t,y,yd)','s=y(1)')
-[yy,nn]=dae("root",[y0,y0d],t0,t,rtol,atol,res2,jac2,ng,gr2);
-// Hot Restart
-[yy,nn,hotd]=dae("root",[y0,y0d],t0,t,rtol,atol,'res2','jac2',ng,'gr2');
-t01=nn(1);t=100:20:200;[pp,qq]=size(yy);y01=yy(1:2,qq);y0d1=yy(2:3,qq);
-%DAEOPTIONS=list([],0,[],[],[],0,0);deff('s=gr2(t,y,yd)','s=y(1)')
-[yy,nn,hotd]=dae("root",[y01,y0d1],t01,t,rtol,atol,'res2','jac2',ng,'gr2',hotd);
-if abs(nn(1)-162.57763)>0.004 then bugmes();quit;end
-//same with C code
-code=['#include <math.h>'
- 'void res22(double *t,double *y,double *yd,double *res,int *ires,double *rpar,int *ipar)'
- '{res[0] = yd[0] - y[1];'
- ' res[1] = yd[1] - (100.0*(1.0 - y[0]*y[0])*y[1] - y[0]);}'
- ' '
- 'void jac22(double *t,double *y,double *yd,double *pd,double *cj,double *rpar,int *ipar)'
- '{pd[0]=*cj - 0.0;'
- ' pd[1]= - (-200.0*y[0]*y[1] - 1.0);'
- ' pd[2]= - 1.0;'
- ' pd[3]=*cj - (100.0*(1.0 - y[0]*y[0]));}'
- ' '
- 'void gr22(int *neq, double *t, double *y, int *ng, double *groot, double *rpar, int *ipar)'
- '{ groot[0] = y[0];}'];
-mputl(code,TMPDIR+'/t22.c') ;
-ilib_for_link(['res22' 'jac22' 'gr22'],'t22.o',[],'c',TMPDIR+'/Makefile',TMPDIR+'/t22loader.sce');
- Generate a loader file
- Generate a Makefile
- Running the Makefile
- Compilation of t22
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
-rtol=[1.d-6;1.d-6];atol=[1.d-6;1.d-4];
-t0=0;y0=[2;0];y0d=[0;-2];t=[20:20:200];ng=1;
-%DAEOPTIONS =list([],0,[],[],[],0,0);
- //hot restart
-t01=nn(1);t=100:20:200;[pp,qq]=size(yy);y01=yy(2:3,qq);y0d1=yy(3:4,qq);
-[yy,nn,hotd]=dae("root",[y01,y0d1],t01,t,atol,rtol,'res22','jac22',ng,'gr22',hotd);
-dassrt encountered trouble
-rtol=[1.d-6;1.d-6];
-atol=[1.d-6;1.d-4];
-t0=0;y0=[2;0];y0d=[0;-2];t=[20:20:200];ng=1;
-%DAEOPTIONS =list([],0,[],[],[],0,0);
- [yy,nn]=dae("root",[y0,y0d],t0,t,atol,rtol,'res22','jac22',ng,'gr22');
-//hot restart
-[yy,nn,hotd]=dae("root",[y0,y0d],t0,t,atol,rtol,'res22','jac22',ng,'gr22');
-t01=nn(1);t=100:20:200;[pp,qq]=size(yy);y01=yy(2:3,qq);y0d1=yy(3:4,qq);
-[yy,nn,hotd]=dae("root",[y01,y0d1],t01,t,atol,rtol,'res22','jac22',ng,'gr22',hotd);
-//banded systems
-A=[-17,6,3,0,0,0,0,0,0,0;
- 8,-12,9,4,0,0,0,0,0,0;
- 0,7,-17,3,8,0,0,0,0,0;
- 0,0,3,-13,2,2,0,0,0,0;
- 0,0,0,4,-18,6,4,0,0,0;
- 0,0,0,0,7,-13,7,0,0,0;
- 0,0,0,0,0,7,-16,7,9,0;
- 0,0,0,0,0,0,5,-17,8,1;
- 0,0,0,0,0,0,0,4,-14,8;
- 0,0,0,0,0,0,0,0,10,-10];
-n=size(A,1);
-//Full jacobian case for reference
-function [r,ires]=res(t,y,yd)
- r=yd-A*y; ires=0
-endfunction
-function pd=jac(x,y,yd,cj)
- pd=A+cj*eye()
-endfunction
-y0=ones(n,1);yd0=0*y0;
-y=dae([y0,yd0],0,0:0.1:10,res,jac);
-//banded estimated jacobian
-y1=dae([y0,yd0],0,0:0.1:10,res);
-ml=1;mu=2;
-%DAEOPTIONS=list([],0,[ml,mu],[],[],0,0);
-yb1=dae([y0,yd0],0,0:0.1:10,res);
-norm(y1-yb1);
-//banded jacobian, C code
-//Residuals computation code
-ccode=['#include <math.h>'
- 'void myres(double *t,double *y,double *yd,double *res,int *ires,double *rpar,int *ipar)'
- '{'
- ' *ires =0;'
- ' res[0]=yd[0]+17.0*y[0]- 6.0*y[1]- 3.0*y[2];'
- ' res[1]=yd[1]-8.0*y[0]+12.0*y[1]- 9.0*y[2]- 4.0*y[3];'
- ' res[2]=yd[2] -7.0*y[1]+17.0*y[2]- 3.0*y[3]- 8.0*y[4];'
- ' res[3]=yd[3] -3.0*y[2]+13.0*y[3]- 2.0*y[4]- 2.0*y[5];'
- ' res[4]=yd[4] -4.0*y[3]+18.0*y[4]- 6.0*y[5]- 4.0*y[6];'
- ' res[5]=yd[5] -7.0*y[4]+13.0*y[5]- 7.0*y[6]- 0.0*y[7];'
- ' res[6]=yd[6] -7.0*y[5]+16.0*y[6]- 7.0*y[7]- 9.0*y[8];'
- ' res[7]=yd[7] -5.0*y[6]+17.0*y[7]- 8.0*y[8]- 1.0*y[9];'
- ' res[8]=yd[8] -4.0*y[7]+14.0*y[8]- 8.0*y[9];'
- ' res[9]=yd[9] -10.0*y[8]+10.0*y[9];'
- '}'
- 'void myjac(double *t,double *y,double *yd,double *res,double *cj,double *rpar,int *ipar)'
- '{'
- ' res[0]=0.0;'
- ' res[1]=0.0;'
- ' res[2]=0.0;'
- ' res[3]=-17.0+*cj;'
- ' res[4]=8.0;'
- ' res[5]=0.0;'
- ' res[6]=0.0;'
- ' res[7]=6.0;'
- ' res[8]=-12.0+*cj;'
- ' res[9]=7.0;'
- ' res[10]=0.0;'
- ' res[11]=3.0;'
- ' res[12]=9.0;'
- ' res[13]=-17.0+*cj;'
- ' res[14]=3.0;'
- ' res[15]=0.0;'
- ' res[16]=4.0;'
- ' res[17]=3.0;'
- ' res[18]=-13.0+*cj;'
- ' res[19]=4.0;'
- ' res[20]=0.0;'
- ' res[21]=8.0;'
- ' res[22]=2.0;'
- ' res[23]=-18.0+*cj;'
- ' res[24]=7.0;'
- ' res[25]=0.0;'
- ' res[26]=2.0;'
- ' res[27]=6.0;'
- ' res[28]=-13.0+*cj;'
- ' res[29]=7.0;'
- ' res[30]=0.0;'
- ' res[31]=4.0;'
- ' res[32]=7.0;'
- ' res[33]=-16.0+*cj;'
- ' res[34]=5.0;'
- ' res[35]=0.0;'
- ' res[36]=0.0;'
- ' res[37]=7.0;'
- ' res[38]=-17.0+*cj;'
- ' res[39]=4.0;'
- ' res[40]=0.0;'
- ' res[41]=9.0;'
- ' res[42]=8.0;'
- ' res[43]=-14.0+*cj;'
- ' res[44]=10.0;'
- ' res[45]=0.0;'
- ' res[46]=1.0;'
- ' res[47]=8.0;'
- ' res[48]=-10.0+*cj;'
- ' res[49]=0.0;'
- '}'];
-mputl(ccode,TMPDIR+'/band.c'); //create the C file of myjac
-ilib_for_link(['myres','myjac'],'band.o',[],'c',TMPDIR+'/Makefile',TMPDIR+'/bandloader.sce');//compile
- Generate a loader file
- Generate a Makefile
- Running the Makefile
- Compilation of band
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
-y0=ones(n,1);yd0=0*y0;
-yb=dae([y0,yd0],0,0:0.1:10,'myres','myjac');
-norm(y-yb)
- ans =
-
- 2.072D-12
DYNAMIC_LINK_C_SOURCES = src/c/addinter.c \
src/c/dynamic_link.c \
src/c/dl_genErrorMessage.c \
-src/c/AddFunctionInTable.c
+src/c/AddFunctionInTable.c \
+src/c/ilib_verbose.c
GATEWAY_C_SOURCES = sci_gateway/c/gw_dynamic_link.c \
sci_gateway/c/sci_getdynlibext.c \
sci_gateway/c/sci_call.c \
sci_gateway/c/sci_link.c \
sci_gateway/c/sci_ulink.c \
-sci_gateway/c/sci_c_link.c
+sci_gateway/c/sci_c_link.c \
+sci_gateway/c/sci_ilib_verbose.c
GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_fort.f
libscidynamic_link_la_include_HEADERS = includes/AddFunctionInTable.h \
includes/addinter.h \
includes/dynamic_link.h \
-includes/gw_dynamic_link.h
+includes/gw_dynamic_link.h \
+includes/ilib_verbose.h
#### dynamic_link : compilation scripts ####
libscidynamic_link_la_scriptdir = $(mydatadir)/src/scripts/
--- /dev/null
+<?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-en.txt
+ *
+ -->
+<refentry version="5.0-subset Scilab" xml:id="ilib_verbose" xml:lang="en"
+ 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">
+ <info>
+ <pubdate>$LastChangedDate: 2006-08-30 13:26:08 +0200 (mer, 30 aoû 2006)
+ $</pubdate>
+ </info>
+
+ <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()</synopsis>
+
+ <synopsis>ilib_verbose(level)</synopsis>
+ </refsynopsisdiv>
+
+ <refsection>
+ <title>Parameters</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 informations.</para>
+ </refsection>
+
+ <refsection>
+ <title>Examples</title>
+
+ <programlisting role="example">
+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>
+ <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>
+ </simplelist>
+ </refsection>
+
+ <refsection>
+ <title>Authors</title>
+
+ <para>Allan CORNET</para>
+ </refsection>
+</refentry>
#ifndef __GW_DYNAMIC_LINK__
#define __GW_DYNAMIC_LINK__
/*--------------------------------------------------------------------------*/
-#include "machine.h"
-/*--------------------------------------------------------------------------*/
int gw_dynamic_link(void);
/*--------------------------------------------------------------------------*/
/* Declaration of all the profile function declared and */
/* used in sci_gateway */
/*--------------------------------------------------------------------------*/
-int C2F(sci_getdynlibext)(char *fname,unsigned long fname_len);
-int C2F(sci_addinter)(char *fname,unsigned long fname_len);
-int C2F(sci_fort)(char *fname,unsigned long fname_len);
-int C2F(sci_call)(char *fname,unsigned long fname_len);
-int C2F(sci_link)(char *fname,unsigned long fname_len);
-int C2F(sci_ulink)(char *fname,unsigned long fname_len);
-int C2F(sci_c_link)(char *fname,unsigned long fname_len);
+int sci_getdynlibext(char *fname,unsigned long fname_len);
+int sci_addinter(char *fname,unsigned long fname_len);
+int sci_fort(char *fname,unsigned long fname_len);
+int sci_call(char *fname,unsigned long fname_len);
+int sci_link(char *fname,unsigned long fname_len);
+int sci_ulink(char *fname,unsigned long fname_len);
+int sci_c_link(char *fname,unsigned long fname_len);
+int sci_ilib_verbose(char *fname,unsigned long fname_len);
/*--------------------------------------------------------------------------*/
#endif /* __GW_DYNAMIC_LINK__ */
/*--------------------------------------------------------------------------*/
--- /dev/null
+/*
+* 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-en.txt
+*
+*/
+
+/*---------------------------------------------------------------------------*/
+#ifndef __ILIB_VERBOSE_H__
+#define __ILIB_VERBOSE_H__
+
+#include "BOOL.h"
+#include "machine.h"
+
+typedef enum {
+ ILIB_VERBOSE_NO_OUTPUT = 0,
+ ILIB_VERBOSE_STANDARD = 1,
+ ILIB_VERBOSE_MAX = 2
+} ilib_verbose_level;
+
+/**
+* set verbose level for dynamic link functions
+* @param[in] level
+* @return TRUE if level is modified
+*/
+BOOL setIlibVerboseLevel(ilib_verbose_level _level);
+
+/**
+* get verbose level for dynamic link functions
+* @return level
+*/
+ilib_verbose_level getIlibVerboseLevel(void);
+
+/**
+* get verbose level for dynamic link functions (for fortran external subroutines)
+* @param[out] level
+*/
+int C2F(getilibverboselevel)(int *_level);
+
+#endif /* __ILIB_VERBOSE_H__ */
+/*---------------------------------------------------------------------------*/
return
end
- mprintf('\nExports from '+libraryname+'.dll\n');
+ if ( ilib_verbose() <> 0 ) then
+ mprintf('\nExports from '+libraryname+'.dll\n');
+ end
ierr = unix('pedump /exp '+libraryname+'.dll >'+TMPDIR+filesep()+libraryname+'.lcc');
if ierr <> 0 then
bOK=%F;
return;
end
- mprintf('Converting Library');
+ if ( ilib_verbose() <> 0 ) then
+ mprintf('Converting Library');
+ end
fw = mopen(TMPDIR+filesep()+libraryname+'.exp',"wt");
fr = mopen(TMPDIR+filesep()+libraryname+'.lcc',"rt");
mclose(fw);
mclose(fr);
- mprintf('\n');
- mprintf(gettext('Build %s.lib (Please waiting).\n'),libraryname);
+ if ( ilib_verbose() <> 0 ) then
+ mprintf('\n');
+ mprintf(gettext('Build %s.lib (Please waiting).\n'),libraryname);
+ end
command = 'buildLib ""'+TMPDIR+filesep()+libraryname+'.exp""'+' ""'+destPath+filesep()+libraryname+'lcc.lib""';
ierr = unix(command);
if ierr <> 0 then
bOK = %f;
return
end
-
- mprintf('\nExports from '+libraryname+'.dll\n');
+
+ if ( ilib_verbose() <> 0 ) then
+ mprintf('\nExports from '+libraryname+'.dll\n');
+ end
ierr = unix('pedump /exp '+libraryname+'.dll >'+TMPDIR+filesep()+libraryname+'.lcc');
if ierr <> 0 then
bOK=%F;
return;
end
- mprintf('Converting Library');
+ if ( ilib_verbose() <> 0 ) then
+ mprintf('Converting Library');
+ end
fw = mopen(TMPDIR+filesep()+libraryname+'.exp',"wt");
fr = mopen(TMPDIR+filesep()+libraryname+'.lcc',"rt");
mclose(fw);
mclose(fr);
- mprintf('\n');
- mprintf(gettext('Build %s.lib (Please waiting).\n'),libraryname);
+ if ( ilib_verbose() <> 0 ) then
+ mprintf('\n');
+ mprintf(gettext('Build %s.lib (Please waiting).\n'),libraryname);
+ end
command = 'buildLib ""'+TMPDIR+filesep()+libraryname+'.exp""'+' ""'+destPath+filesep()+libraryname+'lcc.lib""';
ierr = unix(command);
if ierr <> 0 then
LCCLIB_DIR = SCIHOME+'\lcclib';
if ( (fileinfo(LCCLIB_DIR) == []) | ( findfiles(LCCLIB_DIR,'*.lib') == []) ) then
- mprintf('\n');
- mprintf(gettext('%s: Converts libraries to use LCC-Win32.\n'),'configure_lcc')
+ if ( ilib_verbose() <> 0 ) then
+ mprintf('\n');
+ mprintf(gettext('%s: Converts libraries to use LCC-Win32.\n'),'configure_lcc')
+ end
bOK = VCtoLCCLib();
else
bOK = %T;
return;
end
- [lhs,rhs]=argn(0);
+ [lhs,rhs] = argn(0);
if ~MSDOS & strncpy(ilib_name,3) <> "lib" then
// We add a leading lib under Linux/Unix because it is the way
- ilib_name="lib"+ilib_name
+ ilib_name="lib" + ilib_name;
end
if rhs <= 4 then makename = 'Makelib';end
if rhs <= 7 then fflags = ''; end
if rhs <= 8 then ismex = %f; end
if rhs <= 9 then cc = ''; end
-
- warningmode = warning('query');
-
// generate the gateway file
- if (warningmode == 'on') then
+ if ( ilib_verbose() <> 0 ) then
mprintf(_(" Generate a gateway file\n"));
end
- ilib_gen_gateway(ilib_name,table)
+ ilib_gen_gateway(ilib_name,table);
// generate a loader file
- if (warningmode == 'on') then
+ if ( ilib_verbose() <> 0 ) then
mprintf(_(" Generate a loader file\n"));
end
if ~ismex then
end
// generate a Makefile
- if (warningmode == 'on') then
+ if ( ilib_verbose() <> 0 ) then
if MSDOS
mprintf(_(" Generate a Makefile: %s\n"),'Makelib');
else
- mprintf(_(" Generate a Makefile\n"));
+ mprintf(_(" Generate a Makefile\n"));
end
end
if ~MSDOS then // Needs to copy the libfoo.c which contains important stuff
- files = [files,ilib_name+'.c'];
+ files = [files,ilib_name + '.c'];
end
ilib_gen_Make(ilib_name,table,files,libs,makename,%t,ldflags,cflags,fflags,cc);
// we call make
- if (warningmode == 'on') then
+ if ( ilib_verbose() <> 0 ) then
mprintf(_(" Running the makefile\n"));
end
+
ilib_compile(ilib_name,makename,files);
endfunction
//** ----------- Windows section -----------------
nf = size(files,'*');
- for i=1:nf
- mprintf(_(" Compilation of ") + string(files1(i)) +'\n');
+ for i=1:nf
+ if ( ilib_verbose() <> 0 ) then
+ mprintf(_(" Compilation of ") + string(files1(i)) +'\n');
+ end
unix_s(make_command+makename + ' '+ files(i));
end
// then the shared library
- mprintf(_(" Building shared library (be patient)\n"));
+ if ( ilib_verbose() <> 0 ) then
+ mprintf(_(" Building shared library (be patient)\n"));
+ end
unix_s(make_command + makename + ' '+ lib_name);
else
//** environment where the Makefile are created from a "./configure"
[msg, ierr, stderr] = unix_g(cmd) ;
if ierr <> 0 then
- mprintf(gettext("%s: An error occured during the compilation:\n"),"ilib_compile");
- lines(0)
- disp(stderr);
- mprintf("\n");
- mprintf(gettext("%s: The command was:\n"),"ilib_compile");
- mprintf(cmd);
- mprintf("\n");
- chdir(oldPath); // Go back to the working dir
+ if ( ilib_verbose() <> 0 ) then
+ mprintf(gettext("%s: An error occured during the compilation:\n"),"ilib_compile");
+ lines(0);
+ disp(stderr);
+ mprintf("\n");
+ mprintf(gettext("%s: The command was:\n"),"ilib_compile");
+ mprintf(cmd);
+ mprintf("\n");
+ end
+ chdir(oldPath); // Go back to the working dir
return ;
end
if stderr <> "" then
- msprintf(gettext("%s: Warning: No error code returned by the compilation but the error output is not empty:\n"),"ilib_compile");
- mprintf(stderr);
- return ;
+ if ( ilib_verbose() <> 0 ) then
+ mprintf(gettext("%s: Warning: No error code returned by the compilation but the error output is not empty:\n"),"ilib_compile");
+ mprintf(stderr);
+ end
+ return ;
end
// Copy the produce lib to the working path
if rhs <= 10 then cc = ""; end
// generate a loader file
- mprintf(gettext(" Generate a loader file\n"));
+ if ( ilib_verbose() <> 0 ) then
+ mprintf(gettext(" Generate a loader file\n"));
+ end
ilib_link_gen_loader(names,flag,loadername,libs,libname);
// generate a Makefile
- mprintf(gettext(" Generate a Makefile\n"));
+ if ( ilib_verbose() <> 0 ) then
+ mprintf(gettext(" Generate a Makefile\n"));
+ end
ilib_link_gen_Make(names, ..
files, ..
flag);
// we call make
- mprintf(gettext(" Running the Makefile\n"));
+ if ( ilib_verbose() <> 0 ) then
+ mprintf(gettext(" Running the Makefile\n"));
+ end
if (libname == "") then libname = names(1);end
libn = ilib_compile('lib' + libname, makename, files);
shortlibname_path = libname;
end
- fd=mopen(loadername,"w");
+ fd=mopen(loadername,"wt");
mfprintf(fd,"// ------------------------------------------------------\n");
mfprintf(fd,"// generated by builder.sce: Please do not edit this file\n");
mfprintf(fd,"// ------------------------------------------------------\n");
table = tables(it)
[mt,nt]=size(table);
for i=1:mt ;
- // mex files to be added to the build process
- if table(i,3)=='cmex' | table(i,3)=='fmex' | table(i,3)=='Fmex' then
- disp("add 1")
- if find(files==table(i,2)) == [] then // If not already in the array
- files=[files, table(i,2)] // add it to the file list
+ // mex files to be added to the build process
+ if table(i,3)=='cmex' | table(i,3)=='fmex' | table(i,3)=='Fmex' then
+ if find(files == table(i,2)) == [] then // If not already in the array
+ files = [files, table(i,2)]; // add it to the file list
+ end
end
- end
end
end
- warningmode = warning('query');
-
+
originPath = pwd();
linkBuildDir = TMPDIR;
commandpath = SCI+"/modules/dynamic_link/src/scripts/";
// Copy files => linkBuildDir
chdir(linkBuildDir);
- if (warningmode == 'on') then
+ if ( ilib_verbose() <> 0 ) then
mprintf(gettext(" %s: Copy compilation files (Makefile*, libtool...) to TMPDIR\n"),"ilib_gen_Make");
end
filesMatching = ls(filename+".*");
// The user provided the real filename
if filesMatching == [] then
- if (warningmode == 'on') then
+ if ( ilib_verbose() <> 0 ) then
mprintf(gettext(" %s: Copy %s to TMPDIR\n"),"ilib_gen_Make",x);
end
copyfile(x, linkBuildDir);
ignoredFileExtension=[".lo",".la",".lai"]
for f=filesMatching(:)'
if strindex(f,ignoredFileExtension) == [] then
- if (warningmode == 'on') then
- mprintf(gettext(" %s: Copy %s to TMPDIR\n"),"ilib_gen_Make",f);
+ if ( ilib_verbose() <> 0 ) then
+ mprintf(gettext(" %s: Copy %s to TMPDIR\n"),"ilib_gen_Make",f);
end
copyfile(f, linkBuildDir);
filelist = filelist + " " + f;
else
- if (warningmode == 'on') then
- mprintf(gettext(" %s: File %s ignored.\n"),"ilib_gen_Make",f);
+ if ( ilib_verbose() <> 0 ) then
+ mprintf(gettext(" %s: File %s ignored.\n"),"ilib_gen_Make",f);
end
end
end
end
// Alter the Makefile in order to compile the right files
- if (warningmode == 'on') then
+ if ( ilib_verbose() <> 0 ) then
mprintf(gettext(" %s: Modification of the Makefile in TMPDIR.\n"),"ilib_gen_Make");
end
[msg,ierr, stderr] = unix_g(cmd);
if ierr <> 0 then
- mprintf(gettext("%s: Error while modifing the reference Makefile:\n"),"ilib_gen_Make")
- mprintf(msg+" "+stderr);
+ if ( ilib_verbose() <> 0 ) then
+ mprintf(gettext("%s: Error while modifing the reference Makefile:\n"),"ilib_gen_Make")
+ mprintf(msg + " " + stderr);
+ end
return;
end
// We launch ./configure in order to produce a "generic" Makefile
// for this computer
- if (warningmode == 'on') then
+ if ( ilib_verbose() <> 0 ) then
mprintf(gettext(" %s: configure : Generate Makefile.\n"),"ilib_gen_Make");
end
- cmd=gencompilationflags_unix(ldflags, cflags, fflags, cc)
- cmd=workingPath+"/compilerDetection.sh "+cmd
+ cmd = gencompilationflags_unix(ldflags, cflags, fflags, cc)
+ cmd = workingPath+"/compilerDetection.sh "+cmd
[msg,ierr,stderr] = unix_g(cmd);
if ierr <> 0 then
- mprintf(msg+" "+stderr);
+ if ( ilib_verbose() <> 0 ) then
+ mprintf(msg + " " + stderr);
+ end
return %F;
end
if rhs <= 7 then fflags = ''; end
if rhs <= 8 then cc = ''; end
- // These flags are important... The rename of the fly the name of the
- // function in the C / C++ / Fortran code
- cflags=" -DmexFunction=mex_\$* " + cflags
- fflags=" -Dmexfunction=mex\$* " + fflags
+ if ~MSDOS then
+ // These flags are important... The rename of the fly the name of the
+ // function in the C / C++ / Fortran code
+ cflags=" -DmexFunction=mex_\$* " + cflags
+ fflags=" -Dmexfunction=mex\$* " + fflags
+ end
ilib_build(ilib_name,table,files,libs,makename,ldflags,cflags,fflags,%t,cc);
/*--------------------------------------------------------------------------*/
static gw_generic_table Tab[]=
{
- {C2F(sci_getdynlibext),"getdynlibext"},
- {C2F(sci_addinter),"addinter"},
- {C2F(sci_fort),"fort"},
- {C2F(sci_call),"call"},
- {C2F(sci_link),"link"},
- {C2F(sci_ulink),"ulink"},
- {C2F(sci_c_link),"c_link"},
+ {sci_getdynlibext,"getdynlibext"},
+ {sci_addinter,"addinter"},
+ {sci_fort,"fort"},
+ {sci_call,"call"},
+ {sci_link,"link"},
+ {sci_ulink,"ulink"},
+ {sci_c_link,"c_link"},
+ {sci_ilib_verbose,"ilib_verbose"}
};
/*--------------------------------------------------------------------------*/
int gw_dynamic_link(void)
#include "dl_genErrorMessage.h"
#include "Scierror.h"
/*-----------------------------------------------------------------------------------*/
-int C2F(sci_addinter)(char *fname,unsigned long fname_len)
+int sci_addinter(char *fname,unsigned long fname_len)
{
CheckRhs(3,3);
CheckLhs(1,1);
#include "localization.h"
#include "Scierror.h"
/*--------------------------------------------------------------------------*/
-int C2F(sci_c_link)(char *fname,unsigned long fname_len)
+int sci_c_link(char *fname,unsigned long fname_len)
{
int ilib = 0;
/*--------------------------------------------------------------------------*/
#include "gw_dynamic_link.h"
#include "stack-c.h"
+#include "machine.h" /* C2F */
/*--------------------------------------------------------------------------*/
extern int C2F(intfort)(char *fname,unsigned long fname_len); /* fortran */
/*--------------------------------------------------------------------------*/
-int C2F(sci_fort)(char *fname,unsigned long fname_len)
+int sci_fort(char *fname,unsigned long fname_len)
{
- return C2F(sci_call)(fname,fname_len);
+ return sci_call(fname, fname_len);
}
/*--------------------------------------------------------------------------*/
-int C2F(sci_call)(char *fname,unsigned long fname_len)
+int sci_call(char *fname,unsigned long fname_len)
{
if (Rhs == 0)
{
#include "stack-c.h"
#include "gw_dynamic_link.h"
/*--------------------------------------------------------------------------*/
-int C2F(sci_getdynlibext)(char *fname,unsigned long fname_len)
+int sci_getdynlibext(char *fname,unsigned long fname_len)
{
static int n1 = 0, m1 = 0;
int outIndex = 0 ;
--- /dev/null
+/*
+* 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-en.txt
+*
+*/
+
+/*--------------------------------------------------------------------------*/
+#include "gw_dynamic_link.h"
+#include "stack-c.h"
+#include "ilib_verbose.h"
+#include "localization.h"
+#include "Scierror.h"
+/*--------------------------------------------------------------------------*/
+int sci_ilib_verbose(char *fname,unsigned long fname_len)
+{
+ Rhs = Max(0, Rhs);
+
+ CheckRhs(0,1);
+ CheckLhs(1,1);
+
+ if (Rhs == 0)
+ {
+ int n = 1 ,l = 0;
+ ilib_verbose_level currentLevel = getIlibVerboseLevel();
+
+ CreateVar(Rhs+1, MATRIX_OF_INTEGER_DATATYPE, &n, &n,&l);
+ *istk(l) = (int)currentLevel;
+ LhsVar(1) = Rhs + 1;
+ }
+ else
+ {
+ if ( VarType(1)== sci_matrix )
+ {
+ int m1 = 0, n1 = 0, l1 = 0;
+ GetRhsVar(1, MATRIX_OF_DOUBLE_DATATYPE, &m1, &n1, &l1);
+ if ( (m1 == n1) && (n1 == 1) )
+ {
+ double dlevel = (double)*stk(l1);
+ int level = (int) dlevel;
+
+ if (dlevel != (double)level)
+ {
+ Scierror(999,_("%s: Wrong value for input argument #%d: A int expected.\n"),fname,1);
+ return 0;
+ }
+
+ if ( !setIlibVerboseLevel((ilib_verbose_level)level) )
+ {
+ Scierror(999,_("%s: Wrong value for input argument #%d: Must be in the set {%s}.\n"),fname,1,"0,1,2");
+ return 0;
+ }
+ else
+ {
+ LhsVar(1) = 0;
+ }
+ }
+ else
+ {
+ Scierror(999,_("%s: Wrong size for input argument #%d: A scalar expected.\n"),fname,1);
+ return 0;
+ }
+ }
+ else
+ {
+ Scierror(999,_("%s: Wrong type for input argument #%d: A int expected.\n"),fname,1);
+ return 0;
+ }
+ }
+
+ C2F(putlhsvar)();
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
static int linkNoRhs(void);
static int linkOneRhsShow(void);
/*-----------------------------------------------------------------------------------*/
-int C2F(sci_link)(char *fname,unsigned long fname_len)
+int sci_link(char *fname,unsigned long fname_len)
{
BOOL fflag = FALSE;
int idsharedlibrary = -1;
#include "Scierror.h"
#include "dynamic_link.h"
/*--------------------------------------------------------------------------*/
-int C2F(sci_ulink)(char *fname,unsigned long fname_len)
+int sci_ulink(char *fname,unsigned long fname_len)
{
static int l1,n1,m1;
<PRIMITIVE gatewayId="46" primitiveId="5" primitiveName="link" />
<PRIMITIVE gatewayId="46" primitiveId="6" primitiveName="ulink" />
<PRIMITIVE gatewayId="46" primitiveId="7" primitiveName="c_link" />
+<PRIMITIVE gatewayId="46" primitiveId="8" primitiveName="ilib_verbose" />
</GATEWAY>
getWarningMode
cvname_
funtab_
-ExceptionMessage
\ No newline at end of file
+ExceptionMessage
#include "localization.h"
#include "Scierror.h"
#include "FileExist.h"
+#include "ilib_verbose.h"
#ifdef _MSC_VER
#include "getenvc.h"
#endif
char *pathSearch = searchEnv(filename,"PATH");
if ( (pathSearch) && ((int)strlen(pathSearch) > 0) )
{
- sciprint(_("%s: The file %s does not exist.\n" ),"link",filename);
+ if (getIlibVerboseLevel() != ILIB_VERBOSE_NO_OUTPUT)
+ {
+ sciprint(_("%s: The file %s does not exist.\n" ),"link",filename);
+ }
FREE(pathSearch);
}
}
#else
- sciprint(_("Link failed for dynamic library '%s'.\n"),filename);
- sciprint(_("An error occurred: %s\n"),GetLastDynLibError());
+ if (getIlibVerboseLevel() != ILIB_VERBOSE_NO_OUTPUT)
+ {
+ sciprint(_("Link failed for dynamic library '%s'.\n"),filename);
+ sciprint(_("An error occurred: %s\n"),GetLastDynLibError());
+ }
#endif
}
*ierr = -1;
return IdSharedLib;
}
- if ( (idsharedlibrary == -1) && getWarningMode() )
+ if ( (idsharedlibrary == -1) && (getIlibVerboseLevel() != ILIB_VERBOSE_NO_OUTPUT))
{
sciprint(_("Shared archive loaded.\n"));
sciprint(_("Link done.\n"));
void ShowDynLinks(void)
{
int i=0,count=0;
- if (getWarningMode()) sciprint(_("Number of entry points %d.\nShared libraries :\n"),NEpoints);
- if (getWarningMode())sciprint("[ ");
+ if (getIlibVerboseLevel() != ILIB_VERBOSE_NO_OUTPUT) sciprint(_("Number of entry points %d.\nShared libraries :\n"),NEpoints);
+ if (getIlibVerboseLevel() != ILIB_VERBOSE_NO_OUTPUT) sciprint("[ ");
for ( i = 0 ; i < Nshared ; i++)
{
- if ( hd[i].ok == TRUE) { if (getWarningMode())sciprint("%d ",i);count++;}
+ if ( hd[i].ok == TRUE)
+ {
+ if (getIlibVerboseLevel() != ILIB_VERBOSE_NO_OUTPUT)
+ {
+ sciprint("%d ",i);count++;
+ }
+ }
}
- if (getWarningMode()) sciprint(_("] : %d libraries.\n"),count);
+
+ if (getIlibVerboseLevel() != ILIB_VERBOSE_NO_OUTPUT) sciprint(_("] : %d libraries.\n"),count);
for ( i = NEpoints-1 ; i >=0 ; i--)
{
- if (getWarningMode()) sciprint(_("Entry point %s in shared library %d.\n"),EP[i].name,EP[i].Nshared);
+ if (getIlibVerboseLevel() != ILIB_VERBOSE_NO_OUTPUT) sciprint(_("Entry point %s in shared library %d.\n"),EP[i].name,EP[i].Nshared);
}
}
/*---------------------------------------------------------------------------*/
if ( Nshared == ENTRYMAX )
{
- if (getWarningMode()) sciprint(_("Cannot open shared files max entry %d reached.\n"),ENTRYMAX);
+ if (getIlibVerboseLevel() != ILIB_VERBOSE_NO_OUTPUT) sciprint(_("Cannot open shared files max entry %d reached.\n"),ENTRYMAX);
return(FALSE);
}
/* Warning x64 windows */
EP[NEpoints].epoint = (function) GetDynLibFuncPtr (hd1,enamebuf);
if ( EP[NEpoints].epoint == NULL )
{
- if (getWarningMode()) sciprint(_("%s is not an entry point.\n"),enamebuf);
+ if (getIlibVerboseLevel() != ILIB_VERBOSE_NO_OUTPUT) sciprint(_("%s is not an entry point.\n"),enamebuf);
return -5;
}
else
{
/* we don't add the _ in the table */
- if (debug) sciprint(_("Linking %s.\n"),ename);
+ if (debug) sciprint(_("Linking %s.\n"), ename);
strncpy(EP[NEpoints].name,ename,MAXNAME);
EP[NEpoints].Nshared = ish;
NEpoints++;
>
</File>
<File
+ RelativePath=".\ilib_verbose.c"
+ >
+ </File>
+ <File
RelativePath="..\..\sci_gateway\c\sci_addinter.c"
>
</File>
>
</File>
<File
+ RelativePath="..\..\sci_gateway\c\sci_ilib_verbose.c"
+ >
+ </File>
+ <File
RelativePath="..\..\sci_gateway\c\sci_link.c"
>
</File>
RelativePath="..\..\includes\gw_dynamic_link.h"
>
</File>
+ <File
+ RelativePath="..\..\includes\ilib_verbose.h"
+ >
+ </File>
</Filter>
<Filter
Name="localization"
--- /dev/null
+/*
+* 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-en.txt
+*
+*/
+
+/*---------------------------------------------------------------------------*/
+#include "ilib_verbose.h"
+/*---------------------------------------------------------------------------*/
+ilib_verbose_level verboseLevel = ILIB_VERBOSE_STANDARD;
+/*---------------------------------------------------------------------------*/
+BOOL setIlibVerboseLevel(ilib_verbose_level _level)
+{
+ switch (_level)
+ {
+ case ILIB_VERBOSE_NO_OUTPUT:
+ case ILIB_VERBOSE_STANDARD:
+ case ILIB_VERBOSE_MAX:
+ {
+ verboseLevel = _level;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+/*---------------------------------------------------------------------------*/
+ilib_verbose_level getIlibVerboseLevel(void)
+{
+ return verboseLevel;
+}
+/*---------------------------------------------------------------------------*/
+int C2F(getilibverboselevel)(int *_level)
+{
+ *_level = (int)verboseLevel;
+ return 0;
+}
+/*---------------------------------------------------------------------------*/
ilib_gen_Make: Copy libbug.c to TMPDIR
ilib_gen_Make: Modification of the Makefile in TMPDIR.
Running the makefile
-// disable message
-warning_mode = warning('query');
-warning('off');
// load the shared library
exec loader.sce
];
addinter(libbug_path+'/libbug.dylib','libbug',list_functions);
+Shared archive loaded.
+Link done.
// remove temp. variables on stack
// ------------------------------------------------------
-// enable message
-warning(warning_mode);
chdir(currentpath);
//using the new primitive
r = [1,2,3];
files=['bug_2085.o'];
ilib_build('bug',['ex2c_1','intex2c'],files,[]);
-// disable message
-warning_mode = warning('query');
-warning('off');
-
// load the shared library
exec loader.sce
-// enable message
-warning(warning_mode);
-
chdir(currentpath);
//using the new primitive
ilib_gen_Make: Copy libbug.c to TMPDIR
ilib_gen_Make: Modification of the Makefile in TMPDIR.
Running the makefile
-// disable message
-warning_mode = warning('query');
-warning('off');
// load the shared library
exec loader.sce
];
addinter(libbug_path+'/libbug.so','libbug',list_functions);
-
+Shared archive loaded.
+Link done.
+
// remove temp. variables on stack
clear libbug_path;
// ------------------------------------------------------
-// enable message
-warning(warning_mode);
chdir(currentpath);
//using the new primitive
r = [1,2,3];
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
+// <-- ENGLISH IMPOSED -->
+// <-- JVM NOT MANDATORY -->
// <-- Non-regression test for bug 2085 -->
//
// <-- Bugzilla URL -->
Running the makefile
Compilation of bug_2085
Building shared library (be patient)
-// disable message
-warning_mode = warning('query');
-warning('off');
// load the shared library
exec loader.sce
+
// ------------------------------------------------------
+
// generated by builder.sce: Please do not edit this file
+
// ------------------------------------------------------
+
+
bug_path = get_file_path('loader.sce');
-list_functions = [ 'ex2c_1';
+
+list_functions = [ 'ex2c_1';
];
+
addinter(bug_path+'/bug.dll','bug',list_functions);
+Shared archive loaded.
+Link done.
+
// remove temp. variables on stack
+
clear bug_path;
+
clear list_functions;
+
clear get_file_path;
+
// ------------------------------------------------------
-// enable message
-warning(warning_mode);
+
chdir(currentpath);
//using the new primitive
r = [1,2,3];
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
+// <-- ENGLISH IMPOSED -->
+// <-- JVM NOT MANDATORY -->
// <-- Non-regression test for bug 3191 -->
//
// <-- Bugzilla URL -->
// http://bugzilla.scilab.org/show_bug.cgi?id=3191
//
+ilib_verbose(0);
test_path = get_absolute_file_path('bug_3191.tst');
currentpath = pwd();
cd TMPDIR;
chdir(TEST_DIR);
files=['bug_3191.o'];
ilib_build('libc_fun',['c_fun','c_intfun'],files,[]);
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of bug_3191
- Building shared library (be patient)
-// disable message
-warning_mode = warning('query');
-warning('off');
// load the shared library
-exec loader.sce
-
-// ------------------------------------------------------
-
-// generated by builder.sce: Please do not edit this file
-
-// ------------------------------------------------------
-
-
-libc_fun_path = get_file_path('loader.sce');
-
-list_functions = [ 'c_fun';
-];
-
-addinter(libc_fun_path+'/libc_fun.dll','libc_fun',list_functions);
-
-// remove temp. variables on stack
-
-clear libc_fun_path;
-
-clear list_functions;
-
-clear get_file_path;
-
-// ------------------------------------------------------
-
-// enable message
-warning(warning_mode);
+exec loader.sce;
chdir(currentpath);
//using the new primitive
if c_fun(3,8) <> 3+8 then bugmes();quit;end
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
-// <-- Non-regression test for bug 3191 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3191
-//
-test_path = get_absolute_file_path('bug_3191.tst');
-currentpath = pwd();
-cd TMPDIR;
-cd ../;
-OS_TMP_DIR = pwd();
-mkdir(OS_TMP_DIR,'bug_3191');
-TEST_DIR = OS_TMP_DIR + filesep() + 'bug_3191';
-copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug_3191.c' , TEST_DIR + filesep() + 'bug_3191.c');
-chdir(TEST_DIR);
-files=['bug_3191.o'];
-ilib_build('libc_fun',['c_fun','c_intfun'],files,[]);
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy bug_3191.c to TMPDIR
- ilib_gen_Make: Copy libc_fun.c to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-// disable message
-warning_mode = warning('query');
-warning('off');
-// load the shared library
-exec loader.sce
-
-// ------------------------------------------------------
-
-// generated by builder.sce: Please do not edit this file
-
-// ------------------------------------------------------
-
-
-libc_fun_path = get_file_path('loader.sce');
-
-list_functions = [ 'c_fun';
-];
-
-addinter(libc_fun_path+'/libc_fun.dylib','libc_fun',list_functions);
-
-// remove temp. variables on stack
-
-clear libc_fun_path;
-
-clear list_functions;
-
-clear get_file_path;
-
-// ------------------------------------------------------
-
-// enable message
-warning(warning_mode);
-chdir(currentpath);
-//using the new primitive
-if c_fun(3,8) <> 3+8 then bugmes();quit;end
-// ulink() all libraries
-ulink();
-//remove TMP_DIR
-rmdir(TEST_DIR,'s');
-// =============================================================================
// http://bugzilla.scilab.org/show_bug.cgi?id=3191
//
+ilib_verbose(0);
+
test_path = get_absolute_file_path('bug_3191.tst');
currentpath = pwd();
files=['bug_3191.o'];
ilib_build('libc_fun',['c_fun','c_intfun'],files,[]);
-// disable message
-warning_mode = warning('query');
-warning('off');
-
// load the shared library
-exec loader.sce
-
-// enable message
-warning(warning_mode);
+exec loader.sce;
chdir(currentpath);
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
-// <-- Non-regression test for bug 3191 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3191
-//
-test_path = get_absolute_file_path('bug_3191.tst');
-currentpath = pwd();
-cd TMPDIR;
-cd ../;
-OS_TMP_DIR = pwd();
-mkdir(OS_TMP_DIR,'bug_3191');
-TEST_DIR = OS_TMP_DIR + filesep() + 'bug_3191';
-copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug_3191.c' , TEST_DIR + filesep() + 'bug_3191.c');
-chdir(TEST_DIR);
-files=['bug_3191.o'];
-ilib_build('libc_fun',['c_fun','c_intfun'],files,[]);
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy bug_3191.c to TMPDIR
- ilib_gen_Make: Copy libc_fun.c to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-// disable message
-warning_mode = warning('query');
-warning('off');
-// load the shared library
-exec loader.sce
-
-// ------------------------------------------------------
-
-// generated by builder.sce: Please do not edit this file
-
-// ------------------------------------------------------
-
-
-libc_fun_path = get_file_path('loader.sce');
-
-list_functions = [ 'c_fun';
-];
-
-addinter(libc_fun_path+'/libc_fun.so','libc_fun',list_functions);
-
-// remove temp. variables on stack
-
-clear libc_fun_path;
-
-clear list_functions;
-
-clear get_file_path;
-
-// ------------------------------------------------------
-
-// enable message
-warning(warning_mode);
-chdir(currentpath);
-//using the new primitive
-if c_fun(3,8) <> 3+8 then bugmes();quit;end
-// ulink() all libraries
-ulink();
-//remove TMP_DIR
-rmdir(TEST_DIR,'s');
-// =============================================================================
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
+// <-- ENGLISH IMPOSED -->
+// <-- JVM NOT MANDATORY -->
// <-- Non-regression test for bug 3392 -->
//
// <-- Bugzilla URL -->
TEST_DIR = OS_TMP_DIR + filesep() + 'bug_3392';
copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug_3392.c' , TEST_DIR + filesep() + 'bug_3392.c');
chdir(TEST_DIR);
-files=['bug_3392.o'];
+files=['bug_3392.c'];
ilib_build('libc_fun',['c_sum','c_intsum';'c_sub','c_intsub'],files,[]);
Generate a gateway file
Generate a loader file
Generate a Makefile: Makelib
Running the makefile
- Compilation of bug_3392
+ Compilation of bug_3392.c
Building shared library (be patient)
-// disable message
-warning_mode = warning('query');
-warning('off');
// load the shared library
-exec loader.sce
-
-// ------------------------------------------------------
-
-// generated by builder.sce: Please do not edit this file
-
-// ------------------------------------------------------
-
-
-libc_fun_path = get_file_path('loader.sce');
-
-list_functions = [ 'c_sum';
- 'c_sub';
-];
-
-addinter(libc_fun_path+'/libc_fun.dll','libc_fun',list_functions);
-
-// remove temp. variables on stack
-
-clear libc_fun_path;
-
-clear list_functions;
-
-clear get_file_path;
-
-// ------------------------------------------------------
-
-// enable message
-warning(warning_mode);
+exec loader.sce;
+Shared archive loaded.
+Link done.
chdir(currentpath);
//using the new primitive
if c_sum(3,8) <> 3+8 then bugmes();quit;end
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - INRIA - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
-// <-- Non-regression test for bug 3392 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3392
-//
-test_path = get_absolute_file_path('bug_3392.tst');
-currentpath = pwd();
-cd TMPDIR;
-cd ../;
-OS_TMP_DIR = pwd();
-mkdir(OS_TMP_DIR,'bug_3392');
-TEST_DIR = OS_TMP_DIR + filesep() + 'bug_3392';
-copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug_3392.c' , TEST_DIR + filesep() + 'bug_3392.c');
-chdir(TEST_DIR);
-files=['bug_3392.o'];
-ilib_build('libc_fun',['c_sum','c_intsum';'c_sub','c_intsub'],files,[]);
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy bug_3392.c to TMPDIR
- ilib_gen_Make: Copy libc_fun.c to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-// disable message
-warning_mode = warning('query');
-warning('off');
-// load the shared library
-exec loader.sce
-
-// ------------------------------------------------------
-
-// generated by builder.sce: Please do not edit this file
-
-// ------------------------------------------------------
-
-
-libc_fun_path = get_file_path('loader.sce');
-
-list_functions = [ 'c_sum';
- 'c_sub';
-];
-
-addinter(libc_fun_path+'/libc_fun.dylib','libc_fun',list_functions);
-
-// remove temp. variables on stack
-
-clear libc_fun_path;
-
-clear list_functions;
-
-clear get_file_path;
-
-// ------------------------------------------------------
-
-// enable message
-warning(warning_mode);
-chdir(currentpath);
-//using the new primitive
-if c_sum(3,8) <> 3+8 then bugmes();quit;end
-if c_sub(3,8) <> 3-8 then bugmes();quit;end
-// ulink() all libraries
-ulink();
-//remove TMP_DIR
-rmdir(TEST_DIR,'s');
-// =============================================================================
chdir(TEST_DIR);
-files=['bug_3392.o'];
+files=['bug_3392.c'];
ilib_build('libc_fun',['c_sum','c_intsum';'c_sub','c_intsub'],files,[]);
-// disable message
-warning_mode = warning('query');
-warning('off');
-
// load the shared library
-exec loader.sce
-
-// enable message
-warning(warning_mode);
+exec loader.sce;
chdir(currentpath);
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - INRIA - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
-// <-- Non-regression test for bug 3392 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3392
-//
-test_path = get_absolute_file_path('bug_3392.tst');
-currentpath = pwd();
-cd TMPDIR;
-cd ../;
-OS_TMP_DIR = pwd();
-mkdir(OS_TMP_DIR,'bug_3392');
-TEST_DIR = OS_TMP_DIR + filesep() + 'bug_3392';
-copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug_3392.c' , TEST_DIR + filesep() + 'bug_3392.c');
-chdir(TEST_DIR);
-files=['bug_3392.o'];
-ilib_build('libc_fun',['c_sum','c_intsum';'c_sub','c_intsub'],files,[]);
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy bug_3392.c to TMPDIR
- ilib_gen_Make: Copy libc_fun.c to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-// disable message
-warning_mode = warning('query');
-warning('off');
-// load the shared library
-exec loader.sce
-
-// ------------------------------------------------------
-
-// generated by builder.sce: Please do not edit this file
-
-// ------------------------------------------------------
-
-
-libc_fun_path = get_file_path('loader.sce');
-
-list_functions = [ 'c_sum';
- 'c_sub';
-];
-
-addinter(libc_fun_path+'/libc_fun.so','libc_fun',list_functions);
-
-// remove temp. variables on stack
-
-clear libc_fun_path;
-
-clear list_functions;
-
-clear get_file_path;
-
-// ------------------------------------------------------
-
-// enable message
-warning(warning_mode);
-chdir(currentpath);
-//using the new primitive
-if c_sum(3,8) <> 3+8 then bugmes();quit;end
-if c_sub(3,8) <> 3-8 then bugmes();quit;end
-// ulink() all libraries
-ulink();
-//remove TMP_DIR
-rmdir(TEST_DIR,'s');
-// =============================================================================
//
// <-- Short Description -->
// link does not manage column vector as scilab 4.x
+ilib_verbose(0);
if MSDOS then
warning('off');
Cfunctions = '';
// <-- Short Description -->
// link does not manage column vector as scilab 4.x
+ilib_verbose(0);
+
if MSDOS then
warning('off');
Cfunctions = '';
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- Non-regression test for bug 3532 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3532
-//
-// <-- Short Description -->
-// link does not manage column vector as scilab 4.x
-if MSDOS then
- warning('off');
- Cfunctions = '';
- ierr = execstr("link(SCI+''/bin/scilab_windows.dll'',Cfunctions,''c'');",'errcatch');
- if ierr <> 235 then bugmes();quit;end
- ulink();
- Cfunctions = [];
- ierr = execstr("link(SCI+''/bin/scilab_windows.dll'',Cfunctions,''c'');",'errcatch');
- if ierr <> 999 then bugmes();quit;end
- ulink();
- Cfunctions = ['Windows_Main'];
- link(SCI+'/bin/scilab_windows.dll',Cfunctions,'c');
- ulink();
- Cfunctions = ['Windows_Main','Console_Main','createInnosetupMutex','closeInnosetupMutex'];
- link(SCI+'/bin/scilab_windows.dll',Cfunctions,'c');
- ulink();
- Cfunctions = ['Windows_Main';'Console_Main';'createInnosetupMutex';'closeInnosetupMutex'];
- link(SCI+'/bin/scilab_windows.dll',Cfunctions,'c');
- ulink();
- Cfunctions = ['Windows_Main','Console_Main';'createInnosetupMutex','closeInnosetupMutex'];
- ierr = execstr("link(SCI+''/bin/scilab_windows.dll'',Cfunctions,''c'');",'errcatch');
- if ierr <> 999 then bugmes();quit;end
- ulink();
- warning('on');
-end
-// =============================================================================
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- Non-regression test for bug 3532 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3532
-//
-// <-- Short Description -->
-// link does not manage column vector as scilab 4.x
-if MSDOS then
- warning('off');
- Cfunctions = '';
- ierr = execstr("link(SCI+''/bin/scilab_windows.dll'',Cfunctions,''c'');",'errcatch');
- if ierr <> 235 then bugmes();quit;end
- ulink();
- Cfunctions = [];
- ierr = execstr("link(SCI+''/bin/scilab_windows.dll'',Cfunctions,''c'');",'errcatch');
- if ierr <> 999 then bugmes();quit;end
- ulink();
- Cfunctions = ['Windows_Main'];
- link(SCI+'/bin/scilab_windows.dll',Cfunctions,'c');
- ulink();
- Cfunctions = ['Windows_Main','Console_Main','createInnosetupMutex','closeInnosetupMutex'];
- link(SCI+'/bin/scilab_windows.dll',Cfunctions,'c');
- ulink();
- Cfunctions = ['Windows_Main';'Console_Main';'createInnosetupMutex';'closeInnosetupMutex'];
- link(SCI+'/bin/scilab_windows.dll',Cfunctions,'c');
- ulink();
- Cfunctions = ['Windows_Main','Console_Main';'createInnosetupMutex','closeInnosetupMutex'];
- ierr = execstr("link(SCI+''/bin/scilab_windows.dll'',Cfunctions,''c'');",'errcatch');
- if ierr <> 999 then bugmes();quit;end
- ulink();
- warning('on');
-end
-// =============================================================================
//
// <-- Short Description -->
// My DLL "C" functions returning character strings do not work with SciLab 5.0.x.
+ilib_verbose(0);
if MSDOS then
currentpath = pwd();
cd TMPDIR;
// <-- Short Description -->
// My DLL "C" functions returning character strings do not work with SciLab 5.0.x.
+ilib_verbose(0);
+
if MSDOS then
currentpath = pwd();
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- Non-regression test for bug 3561 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3561
-//
-// <-- Short Description -->
-// My DLL "C" functions returning character strings do not work with SciLab 5.0.x.
-if MSDOS then
-currentpath = pwd();
-cd TMPDIR;
-mkdir(TMPDIR,'bug_3561');
-TEST_DIR = TMPDIR + filesep() + 'bug_3561';
-copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug3561Dll.h' , TEST_DIR + filesep() + 'bug3561Dll.h');
-copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug3561Dll.cpp' , TEST_DIR + filesep() + 'bug3561Dll.cpp');
-chdir(TEST_DIR);
-files=['bug3561Dll.cpp'];
-ilib_for_link('bug_3561',['bug3561Dll.cpp'],[],'cpp');
- Generate a loader file
- Generate a Makefile
- Running the Makefile
- Compilation of bug3561Dll.cpp
- Building shared library (be patient)
-functions = ['Add', 'WriteString'];
-link('libbug_3561.dll', functions, 'c');
-Shared archive loaded.
-Link done.
-rc = call('WriteString', 'out', [5,1], 1, 'c');
-if type(rc) <> 10 then bugmes();quit;end
-if length(rc)<> 5 then bugmes();quit;end
-if rc<>'12345' then bugmes();quit;end
-end
//
// <-- Short Description -->
// functions added by addinter are not visible by 'what'
+ilib_verbose(0);
test_path = get_absolute_file_path('bug_3630.tst');
currentpath = pwd();
cd TMPDIR;
TEST_DIR = OS_TMP_DIR + filesep() + 'bug_3630';
copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug_3630.c' , TEST_DIR + filesep() + 'bug_3630.c');
chdir(TEST_DIR);
-files=['bug_3630.o'];
+files=['bug_3630.c'];
ilib_build('libc_fun',['c_sum','c_intsum';'c_sub','c_intsub'],files,[]);
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy bug_3630.c to TMPDIR
- ilib_gen_Make: Copy libc_fun.c to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-// disable message
-warning_mode = warning('query');
-warning('off');
[primitives1,commandes] = what();
nbprimitives1 = size(primitives1,'*');
// load the shared library
-exec loader.sce
-
-// ------------------------------------------------------
-
-// generated by builder.sce: Please do not edit this file
-
-// ------------------------------------------------------
-
-
-libc_fun_path = get_file_path('loader.sce');
-
-list_functions = [ 'c_sum';
- 'c_sub';
-];
-
-addinter(libc_fun_path+'/libc_fun.so','libc_fun',list_functions);
-
-// remove temp. variables on stack
-
-clear libc_fun_path;
-
-clear list_functions;
-
-clear get_file_path;
-
-// ------------------------------------------------------
-
-// enable message
-warning(warning_mode);
+exec loader.sce;
chdir(currentpath);
[primitives2,commandes] = what();
nbprimitives2 = size(primitives2,'*');
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- Non-regression test for bug 3630 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3630
-//
-// <-- Short Description -->
-// functions added by addinter are not visible by 'what'
-test_path = get_absolute_file_path('bug_3630.tst');
-currentpath = pwd();
-cd TMPDIR;
-cd ../;
-OS_TMP_DIR = pwd();
-mkdir(OS_TMP_DIR,'bug_3630');
-TEST_DIR = OS_TMP_DIR + filesep() + 'bug_3630';
-copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug_3630.c' , TEST_DIR + filesep() + 'bug_3630.c');
-chdir(TEST_DIR);
-files=['bug_3630.o'];
-ilib_build('libc_fun',['c_sum','c_intsum';'c_sub','c_intsub'],files,[]);
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy bug_3630.c to TMPDIR
- ilib_gen_Make: Copy libc_fun.c to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-// disable message
-warning_mode = warning('query');
-warning('off');
-[primitives1,commandes] = what();
-nbprimitives1 = size(primitives1,'*');
-// load the shared library
-exec loader.sce
-
-// ------------------------------------------------------
-
-// generated by builder.sce: Please do not edit this file
-
-// ------------------------------------------------------
-
-
-libc_fun_path = get_file_path('loader.sce');
-
-list_functions = [ 'c_sum';
- 'c_sub';
-];
-
-addinter(libc_fun_path+'/libc_fun.dylib','libc_fun',list_functions);
-
-// remove temp. variables on stack
-
-clear libc_fun_path;
-
-clear list_functions;
-
-clear get_file_path;
-
-// ------------------------------------------------------
-
-// enable message
-warning(warning_mode);
-chdir(currentpath);
-[primitives2,commandes] = what();
-nbprimitives2 = size(primitives2,'*');
-if (nbprimitives2 - nbprimitives1) <> 2 then bugmes();quit;end
-if ~or(primitives2 == 'c_sum') then bugmes();quit;end
-if ~or(primitives2 == 'c_sub') then bugmes();quit;end
-// ulink() all libraries
-ulink();
-clearfun('c_sum');
-clearfun('c_sub');
-[primitives3,commandes] = what();
-nbprimitives3 = size(primitives3,'*');
-if or(primitives3 == 'c_sum') then bugmes();quit;end
-if or(primitives3 == 'c_sub') then bugmes();quit;end
-if (nbprimitives3 - nbprimitives1) <> 0 then bugmes();quit;end
-//remove TMP_DIR
-rmdir(TEST_DIR,'s');
-// =============================================================================
// <-- Short Description -->
// functions added by addinter are not visible by 'what'
+ilib_verbose(0);
test_path = get_absolute_file_path('bug_3630.tst');
chdir(TEST_DIR);
-files=['bug_3630.o'];
+files=['bug_3630.c'];
ilib_build('libc_fun',['c_sum','c_intsum';'c_sub','c_intsub'],files,[]);
-// disable message
-warning_mode = warning('query');
-warning('off');
-
[primitives1,commandes] = what();
nbprimitives1 = size(primitives1,'*');
// load the shared library
-exec loader.sce
-
-// enable message
-warning(warning_mode);
+exec loader.sce;
chdir(currentpath);
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- Non-regression test for bug 3630 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3630
-//
-// <-- Short Description -->
-// functions added by addinter are not visible by 'what'
-test_path = get_absolute_file_path('bug_3630.tst');
-currentpath = pwd();
-cd TMPDIR;
-cd ../;
-OS_TMP_DIR = pwd();
-mkdir(OS_TMP_DIR,'bug_3630');
-TEST_DIR = OS_TMP_DIR + filesep() + 'bug_3630';
-copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug_3630.c' , TEST_DIR + filesep() + 'bug_3630.c');
-chdir(TEST_DIR);
-files=['bug_3630.o'];
-ilib_build('libc_fun',['c_sum','c_intsum';'c_sub','c_intsub'],files,[]);
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of bug_3630
- Building shared library (be patient)
-// disable message
-warning_mode = warning('query');
-warning('off');
-[primitives1,commandes] = what();
-nbprimitives1 = size(primitives1,'*');
-// load the shared library
-exec loader.sce
-
-// ------------------------------------------------------
-
-// generated by builder.sce: Please do not edit this file
-
-// ------------------------------------------------------
-
-
-libc_fun_path = get_file_path('loader.sce');
-
-list_functions = [ 'c_sum';
- 'c_sub';
-];
-
-addinter(libc_fun_path+'/libc_fun.dll','libc_fun',list_functions);
-
-// remove temp. variables on stack
-
-clear libc_fun_path;
-
-clear list_functions;
-
-clear get_file_path;
-
-// ------------------------------------------------------
-
-// enable message
-warning(warning_mode);
-chdir(currentpath);
-[primitives2,commandes] = what();
-nbprimitives2 = size(primitives2,'*');
-if (nbprimitives2 - nbprimitives1) <> 2 then bugmes();quit;end
-if ~or(primitives2 == 'c_sum') then bugmes();quit;end
-if ~or(primitives2 == 'c_sub') then bugmes();quit;end
-// ulink() all libraries
-ulink();
-clearfun('c_sum');
-clearfun('c_sub');
-[primitives3,commandes] = what();
-nbprimitives3 = size(primitives3,'*');
-if or(primitives3 == 'c_sum') then bugmes();quit;end
-if or(primitives3 == 'c_sub') then bugmes();quit;end
-if (nbprimitives3 - nbprimitives1) <> 0 then bugmes();quit;end
-//remove TMP_DIR
-rmdir(TEST_DIR,'s');
-// =============================================================================
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - DIGITEO - Allan CORNET
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- ENGLISH IMPOSED -->
+// <-- JVM NOT MANDATORY -->
+// <-- Non-regression test for bug 3639 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=3639
+//
+// <-- Short Description -->
+// link without parameters can crash
+ilib_verbose(0);
+test_path = get_absolute_file_path('bug_3639.tst');
+currentpath = pwd();
+cd TMPDIR;
+cd ../;
+OS_TMP_DIR = pwd();
+mkdir(OS_TMP_DIR,'bug_3639');
+TEST_DIR = OS_TMP_DIR + filesep() + 'bug_3639';
+copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug_3639.c' , TEST_DIR + filesep() + 'bug_3639.c');
+chdir(TEST_DIR);
+files=['bug_3639.c'];
+ilib_build('libc_fun1',['c_sum1','c_intsum';'c_sub1','c_intsub'],files,[]);
+copyfile('loader.sce','loader1.sce');
+ilib_build('libc_fun2',['c_sum2','c_intsum';'c_sub2','c_intsub'],files,[]);
+// load the shared library
+info_link = link();
+if info_link <> [] then bugmes();quit;end
+exec loader1.sce;
+info_link = link();
+if info_link <> 'libc_fun1' then bugmes();quit;end
+exec loader.sce;
+info_link = link();
+if or(info_link <> ['libc_fun2','libc_fun1']) then bugmes();quit;end
+chdir(currentpath);
+// ulink() all libraries
+ulink();
+clearfun('c_sum1');
+clearfun('c_sub1');
+clearfun('c_sum2');
+clearfun('c_sub2');
+//remove TMP_DIR
+rmdir(TEST_DIR,'s');
+// =============================================================================
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
-// <-- Non-regression test for bug 3639 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3639
-//
-// <-- Short Description -->
-// link without parameters can crash
-test_path = get_absolute_file_path('bug_3639.tst');
-currentpath = pwd();
-cd TMPDIR;
-cd ../;
-OS_TMP_DIR = pwd();
-mkdir(OS_TMP_DIR,'bug_3639');
-TEST_DIR = OS_TMP_DIR + filesep() + 'bug_3639';
-copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug_3639.c' , TEST_DIR + filesep() + 'bug_3639.c');
-chdir(TEST_DIR);
-files=['bug_3639.o'];
-ilib_build('libc_fun1',['c_sum1','c_intsum';'c_sub1','c_intsub'],files,[]);
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy bug_3639.c to TMPDIR
- ilib_gen_Make: Copy libc_fun1.c to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-copyfile('loader.sce','loader1.sce');
-ilib_build('libc_fun2',['c_sum2','c_intsum';'c_sub2','c_intsub'],files,[]);
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy bug_3639.c to TMPDIR
- ilib_gen_Make: Copy libc_fun2.c to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-// disable message
-warning_mode = warning('query');
-warning('off');
-// load the shared library
-info_link = link();
-if info_link <> [] then bugmes();quit;end
-exec loader1.sce
-
-// ------------------------------------------------------
-
-// generated by builder.sce: Please do not edit this file
-
-// ------------------------------------------------------
-
-
-libc_fun1_path = get_file_path('loader.sce');
-
-list_functions = [ 'c_sum1';
- 'c_sub1';
-];
-
-addinter(libc_fun1_path+'/libc_fun1.dylib','libc_fun1',list_functions);
-
-// remove temp. variables on stack
-
-clear libc_fun1_path;
-
-clear list_functions;
-
-clear get_file_path;
-
-// ------------------------------------------------------
-
-info_link = link();
-if info_link <> 'libc_fun1' then bugmes();quit;end
-exec loader.sce
-
-// ------------------------------------------------------
-
-// generated by builder.sce: Please do not edit this file
-
-// ------------------------------------------------------
-
-
-libc_fun2_path = get_file_path('loader.sce');
-
-list_functions = [ 'c_sum2';
- 'c_sub2';
-];
-
-addinter(libc_fun2_path+'/libc_fun2.dylib','libc_fun2',list_functions);
-
-// remove temp. variables on stack
-
-clear libc_fun2_path;
-
-clear list_functions;
-
-clear get_file_path;
-
-// ------------------------------------------------------
-
-info_link = link();
-if or(info_link <> ['libc_fun2','libc_fun1']) then bugmes();quit;end
-// enable message
-warning(warning_mode);
-chdir(currentpath);
-// ulink() all libraries
-ulink();
-clearfun('c_sum1');
-clearfun('c_sub1');
-clearfun('c_sum2');
-clearfun('c_sub2');
-//remove TMP_DIR
-rmdir(TEST_DIR,'s');
-// =============================================================================
// <-- Short Description -->
// link without parameters can crash
+ilib_verbose(0);
test_path = get_absolute_file_path('bug_3639.tst');
chdir(TEST_DIR);
-files=['bug_3639.o'];
+files=['bug_3639.c'];
ilib_build('libc_fun1',['c_sum1','c_intsum';'c_sub1','c_intsub'],files,[]);
copyfile('loader.sce','loader1.sce');
ilib_build('libc_fun2',['c_sum2','c_intsum';'c_sub2','c_intsub'],files,[]);
-
-// disable message
-warning_mode = warning('query');
-warning('off');
-
// load the shared library
info_link = link();
if info_link <> [] then pause,end
-exec loader1.sce
+exec loader1.sce;
info_link = link();
if info_link <> 'libc_fun1' then pause,end
-exec loader.sce
+exec loader.sce;
info_link = link();
if or(info_link <> ['libc_fun2','libc_fun1']) then pause,end
-// enable message
-warning(warning_mode);
-
chdir(currentpath);
// ulink() all libraries
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
-// <-- Non-regression test for bug 3639 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3639
-//
-// <-- Short Description -->
-// link without parameters can crash
-test_path = get_absolute_file_path('bug_3639.tst');
-currentpath = pwd();
-cd TMPDIR;
-cd ../;
-OS_TMP_DIR = pwd();
-mkdir(OS_TMP_DIR,'bug_3639');
-TEST_DIR = OS_TMP_DIR + filesep() + 'bug_3639';
-copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug_3639.c' , TEST_DIR + filesep() + 'bug_3639.c');
-chdir(TEST_DIR);
-files=['bug_3639.o'];
-ilib_build('libc_fun1',['c_sum1','c_intsum';'c_sub1','c_intsub'],files,[]);
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy bug_3639.c to TMPDIR
- ilib_gen_Make: Copy libc_fun1.c to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-copyfile('loader.sce','loader1.sce');
-ilib_build('libc_fun2',['c_sum2','c_intsum';'c_sub2','c_intsub'],files,[]);
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy bug_3639.c to TMPDIR
- ilib_gen_Make: Copy libc_fun2.c to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-// disable message
-warning_mode = warning('query');
-warning('off');
-// load the shared library
-info_link = link();
-if info_link <> [] then bugmes();quit;end
-exec loader1.sce
-
-// ------------------------------------------------------
-
-// generated by builder.sce: Please do not edit this file
-
-// ------------------------------------------------------
-
-
-libc_fun1_path = get_file_path('loader.sce');
-
-list_functions = [ 'c_sum1';
- 'c_sub1';
-];
-
-addinter(libc_fun1_path+'/libc_fun1.so','libc_fun1',list_functions);
-
-// remove temp. variables on stack
-
-clear libc_fun1_path;
-
-clear list_functions;
-
-clear get_file_path;
-
-// ------------------------------------------------------
-
-info_link = link();
-if info_link <> 'libc_fun1' then bugmes();quit;end
-exec loader.sce
-
-// ------------------------------------------------------
-
-// generated by builder.sce: Please do not edit this file
-
-// ------------------------------------------------------
-
-
-libc_fun2_path = get_file_path('loader.sce');
-
-list_functions = [ 'c_sum2';
- 'c_sub2';
-];
-
-addinter(libc_fun2_path+'/libc_fun2.so','libc_fun2',list_functions);
-
-// remove temp. variables on stack
-
-clear libc_fun2_path;
-
-clear list_functions;
-
-clear get_file_path;
-
-// ------------------------------------------------------
-
-info_link = link();
-if or(info_link <> ['libc_fun2','libc_fun1']) then bugmes();quit;end
-// enable message
-warning(warning_mode);
-chdir(currentpath);
-// ulink() all libraries
-ulink();
-clearfun('c_sum1');
-clearfun('c_sub1');
-clearfun('c_sum2');
-clearfun('c_sub2');
-//remove TMP_DIR
-rmdir(TEST_DIR,'s');
-// =============================================================================
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- Non-regression test for bug 3639 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3639
-//
-// <-- Short Description -->
-// link without parameters can crash
-test_path = get_absolute_file_path('bug_3639.tst');
-currentpath = pwd();
-cd TMPDIR;
-cd ../;
-OS_TMP_DIR = pwd();
-mkdir(OS_TMP_DIR,'bug_3639');
-TEST_DIR = OS_TMP_DIR + filesep() + 'bug_3639';
-copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug_3639.c' , TEST_DIR + filesep() + 'bug_3639.c');
-chdir(TEST_DIR);
-files=['bug_3639.o'];
-ilib_build('libc_fun1',['c_sum1','c_intsum';'c_sub1','c_intsub'],files,[]);
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of bug_3639
- Building shared library (be patient)
-copyfile('loader.sce','loader1.sce');
-ilib_build('libc_fun2',['c_sum2','c_intsum';'c_sub2','c_intsub'],files,[]);
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of bug_3639
- Building shared library (be patient)
-// disable message
-warning_mode = warning('query');
-warning('off');
-// load the shared library
-info_link = link();
-if info_link <> [] then bugmes();quit;end
-exec loader1.sce
-
-// ------------------------------------------------------
-
-// generated by builder.sce: Please do not edit this file
-
-// ------------------------------------------------------
-
-
-libc_fun1_path = get_file_path('loader.sce');
-
-list_functions = [ 'c_sum1';
- 'c_sub1';
-];
-
-addinter(libc_fun1_path+'/libc_fun1.dll','libc_fun1',list_functions);
-
-// remove temp. variables on stack
-
-clear libc_fun1_path;
-
-clear list_functions;
-
-clear get_file_path;
-
-// ------------------------------------------------------
-
-info_link = link();
-if info_link <> 'libc_fun1' then bugmes();quit;end
-exec loader.sce
-
-// ------------------------------------------------------
-
-// generated by builder.sce: Please do not edit this file
-
-// ------------------------------------------------------
-
-
-libc_fun2_path = get_file_path('loader.sce');
-
-list_functions = [ 'c_sum2';
- 'c_sub2';
-];
-
-addinter(libc_fun2_path+'/libc_fun2.dll','libc_fun2',list_functions);
-
-// remove temp. variables on stack
-
-clear libc_fun2_path;
-
-clear list_functions;
-
-clear get_file_path;
-
-// ------------------------------------------------------
-
-info_link = link();
-if or(info_link <> ['libc_fun2','libc_fun1']) then bugmes();quit;end
-// enable message
-warning(warning_mode);
-chdir(currentpath);
-// ulink() all libraries
-ulink();
-clearfun('c_sum1');
-clearfun('c_sub1');
-clearfun('c_sum2');
-clearfun('c_sub2');
-//remove TMP_DIR
-rmdir(TEST_DIR,'s');
-// =============================================================================
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
+// <-- ENGLISH IMPOSED -->
+// <-- JVM NOT MANDATORY -->
// <-- Non-regression test for bug 3647 -->
//
// <-- Bugzilla URL -->
//
// <-- Short Description -->
// C functions having more than 23 characters are not usable with scilab
+ilib_verbose(0);
foo=['void verylongfunctionnamewithmore24characters(double *a,double *b,double *c)';
'{ *c = *a + *b; }' ];
// we use TMPDIR for compilation
curPath = getcwd();
chdir(TMPDIR);
mputl(foo,'foo.c');
- ilib_for_link(['verylongfunctionnamewithmore24characters'],'foo.o',[],"c");
- Generate a loader file
- Generate a Makefile
- Running the Makefile
- Compilation of foo
- Building shared library (be patient)
- // disable message
- warning_mode = warning('query');
- warning('off');
+ ilib_for_link(['verylongfunctionnamewithmore24characters'],'foo.c',[],"c");
// load the shared library
exec loader.sce ;
- // enable message
- warning(warning_mode);
- chdir(curPath)
- ans =
-
- T
+ chdir(curPath) ;
end
//5+7 by C function
-v = call('verylongfunctionnamewithmore24characters',5,1,'d',7,2,'d','out',[1,1],3,'d')
- v =
-
- 12.
+v = call('verylongfunctionnamewithmore24characters',5,1,'d',7,2,'d','out',[1,1],3,'d');
if v <> 12 then bugmes();quit;end
//================================================
// <-- Short Description -->
// C functions having more than 23 characters are not usable with scilab
+ilib_verbose(0);
foo=['void verylongfunctionnamewithmore24characters(double *a,double *b,double *c)';
'{ *c = *a + *b; }' ];
chdir(TMPDIR);
mputl(foo,'foo.c');
- ilib_for_link(['verylongfunctionnamewithmore24characters'],'foo.o',[],"c");
+ ilib_for_link(['verylongfunctionnamewithmore24characters'],'foo.c',[],"c");
- // disable message
- warning_mode = warning('query');
- warning('off');
// load the shared library
exec loader.sce ;
- // enable message
- warning(warning_mode);
- chdir(curPath)
+ chdir(curPath) ;
end
//5+7 by C function
-v = call('verylongfunctionnamewithmore24characters',5,1,'d',7,2,'d','out',[1,1],3,'d')
+v = call('verylongfunctionnamewithmore24characters',5,1,'d',7,2,'d','out',[1,1],3,'d');
if v <> 12 then pause,end
//================================================
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Allan CORNET
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
-// <-- Non-regression test for bug 3647 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3647
-//
-// <-- Short Description -->
-// C functions having more than 23 characters are not usable with scilab
-foo=['void verylongfunctionnamewithmore24characters(double *a,double *b,double *c)';
- '{ *c = *a + *b; }' ];
-// we use TMPDIR for compilation
-
-if ~c_link('foo') then
- curPath = getcwd();
- chdir(TMPDIR);
- mputl(foo,'foo.c');
- ilib_for_link(['verylongfunctionnamewithmore24characters'],'foo.o',[],"c");
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy foo.c to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the Makefile
- // disable message
- warning_mode = warning('query');
- warning('off');
- // load the shared library
- exec loader.sce ;
- // enable message
- warning(warning_mode);
- chdir(curPath)
- ans =
-
- T
-end
-//5+7 by C function
-v = call('verylongfunctionnamewithmore24characters',5,1,'d',7,2,'d','out',[1,1],3,'d')
- v =
-
- 12.
-if v <> 12 then bugmes();quit;end
-//================================================
// <-- Short Description -->
// ilib_mex_build() wasn't using the content of the
// variable tables to compile other files
+ilib_verbose(0);
cd(TMPDIR);
mputl('ilib_mex_build(''libmex'',[''mexf16'',''mexfunction16'',''cmex''],[],[],''Makelib'','''','''','''')','builder.sce');
mputl([
' sciprint(""%d %d %d\n"",dims[0],dims[1],dims[2]);'
'}'
],'mexfunction16.c');
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
mexf16(rand(2,3,2));
2 3 2
// <-- Short Description -->
// ilib_mex_build() wasn't using the content of the
// variable tables to compile other files
+
+ilib_verbose(0);
+
cd(TMPDIR);
mputl('ilib_mex_build(''libmex'',[''mexf16'',''mexfunction16'',''cmex''],[],[],''Makelib'','''','''','''')','builder.sce');
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - DIGITEO - Sylvestre LEDRU
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
-// <-- Non-regression test for bug 3944 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=3944
-//
-// <-- Short Description -->
-// ilib_mex_build() wasn't using the content of the
-// variable tables to compile other files
-cd(TMPDIR);
-mputl('ilib_mex_build(''libmex'',[''mexf16'',''mexfunction16'',''cmex''],[],[],''Makelib'','''','''','''')','builder.sce');
-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');
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
-
- add 1
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy libmex.c to TMPDIR
- ilib_gen_Make: Copy mexfunction16.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-Shared archive loaded.
-Link done.
-mexf16(rand(2,3,2));
-2 3 2
ilib_gen_Make: Copy libintertest.c to TMPDIR
ilib_gen_Make: Modification of the Makefile in TMPDIR.
Running the makefile
- // disable message
- warning_mode = warning('query');
- warning('off');
// load the shared library
exec loader.sce ;
- // enable message
- warning(warning_mode);
+Shared archive loaded.
+Link done.
// check addinter add scifun1
if ( funptr('scifun1') == 0 ) then bugmes();quit;end
if norm(scifun1(%pi)- sin(%pi+1)/%pi ) > %eps then bugmes();quit;end
files=['addinter.o'];
ilib_build('libintertest',['scifun1','intfun1'],files,[]);
- // disable message
- warning_mode = warning('query');
- warning('off');
// load the shared library
exec loader.sce ;
- // enable message
- warning(warning_mode);
-
// check addinter add scifun1
if ( funptr('scifun1') == 0 ) then pause;end
ilib_gen_Make: Copy libintertest.c to TMPDIR
ilib_gen_Make: Modification of the Makefile in TMPDIR.
Running the makefile
- // disable message
- warning_mode = warning('query');
- warning('off');
// load the shared library
exec loader.sce ;
- // enable message
- warning(warning_mode);
+Shared archive loaded.
+Link done.
// check addinter add scifun1
if ( funptr('scifun1') == 0 ) then bugmes();quit;end
if norm(scifun1(%pi)- sin(%pi+1)/%pi ) > %eps then bugmes();quit;end
Running the makefile
Compilation of addinter
Building shared library (be patient)
- // disable message
- warning_mode = warning('query');
- warning('off');
// load the shared library
exec loader.sce ;
- // enable message
- warning(warning_mode);
+Shared archive loaded.
+Link done.
// check addinter add scifun1
if ( funptr('scifun1') == 0 ) then bugmes();quit;end
if norm(scifun1(%pi)- sin(%pi+1)/%pi ) > %eps then bugmes();quit;end
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
//================================================
// test call
//================================================
chdir(TMPDIR);
mputl(foo,'foo.c');
ilib_for_link(['foo'],'foo.o',[],"c");
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy foo.c to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the Makefile
- // disable message
- warning_mode = warning('query');
- warning('off');
// load the shared library
exec loader.sce ;
- // enable message
- warning(warning_mode);
- chdir(curPath)
- ans =
-
- T
+ chdir(curPath) ;
end
//5+7 by C function
-v = call('foo',5,1,'d',7,2,'d','out',[1,1],3,'d')
- v =
-
- 12.
+v = call('foo',5,1,'d',7,2,'d','out',[1,1],3,'d');
if v <> 12 then bugmes();quit;end
//================================================
// This file is distributed under the same license as the Scilab package.
// =============================================================================
-// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
+
//================================================
// test call
//================================================
mputl(foo,'foo.c');
ilib_for_link(['foo'],'foo.o',[],"c");
-
- // disable message
- warning_mode = warning('query');
- warning('off');
+
// load the shared library
exec loader.sce ;
- // enable message
- warning(warning_mode);
- chdir(curPath)
+ chdir(curPath) ;
end
//5+7 by C function
-v = call('foo',5,1,'d',7,2,'d','out',[1,1],3,'d')
+v = call('foo',5,1,'d',7,2,'d','out',[1,1],3,'d');
if v <> 12 then pause,end
//================================================
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) ????-2008 - INRIA
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-//================================================
-// test call
-//================================================
-foo=['void foo(double *a,double *b,double *c)';
- '{ *c = *a + *b; }' ];
-// we use TMPDIR for compilation
-
-if ~c_link('foo') then
- curPath = getcwd();
- chdir(TMPDIR);
- mputl(foo,'foo.c');
- ilib_for_link(['foo'],'foo.o',[],"c");
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy foo.c to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the Makefile
- // disable message
- warning_mode = warning('query');
- warning('off');
- // load the shared library
- exec loader.sce ;
- // enable message
- warning(warning_mode);
- chdir(curPath)
- ans =
-
- T
-end
-//5+7 by C function
-v = call('foo',5,1,'d',7,2,'d','out',[1,1],3,'d')
- v =
-
- 12.
-if v <> 12 then bugmes();quit;end
-//================================================
+++ /dev/null
-//================================================
-// test call
-//================================================
-foo=['void foo(double *a,double *b,double *c)';
- '{ *c = *a + *b; }' ];
-// we use TMPDIR for compilation
-
-if ~c_link('foo') then
- curPath = getcwd();
- chdir(TMPDIR);
- mputl(foo,'foo.c');
- ilib_for_link(['foo'],'foo.o',[],"c");
- Generate a loader file
- Generate a Makefile
- Running the Makefile
- Compilation of foo
- Building shared library (be patient)
- // disable message
- warning_mode = warning('query');
- warning('off');
- // load the shared library
- exec loader.sce ;
- // enable message
- warning(warning_mode);
- chdir(curPath)
- ans =
-
- T
-end
-//5+7 by C function
-v = call('foo',5,1,'d',7,2,'d','out',[1,1],3,'d')
- v =
-
- 12.
-if v <> 12 then bugmes();quit;end
-//================================================
ilib_gen_Make: Copy libfoo.c to TMPDIR
ilib_gen_Make: Modification of the Makefile in TMPDIR.
Running the makefile
-// disable message
-warning_mode = warning('query');
-warning('off');
// load the shared library
exec loader.sce
];
addinter(libfoo_path+'/libfoo.dylib','libfoo',list_functions);
+Shared archive loaded.
+Link done.
// remove temp. variables on stack
// ------------------------------------------------------
-// enable message
-warning(warning_mode);
chdir(cur_dir);
//using the new primitive
if ( norm(scifun1(33) - .0160328) > 1 ) then bugmes();quit;end
files=['fun1.o','fun2.o','intfun1.o'];
ilib_build('foo',['scifun1','intfun1'],files,[]);
-
-// disable message
-warning_mode = warning('query');
-warning('off');
-
// load the shared library
exec loader.sce
-// enable message
-warning(warning_mode);
-
chdir(cur_dir);
//using the new primitive
ilib_gen_Make: Copy libfoo.c to TMPDIR
ilib_gen_Make: Modification of the Makefile in TMPDIR.
Running the makefile
-// disable message
-warning_mode = warning('query');
-warning('off');
// load the shared library
exec loader.sce
];
addinter(libfoo_path+'/libfoo.so','libfoo',list_functions);
+Shared archive loaded.
+Link done.
// remove temp. variables on stack
// ------------------------------------------------------
-// enable message
-warning(warning_mode);
chdir(cur_dir);
//using the new primitive
if ( norm(scifun1(33) - .0160328) > 1 ) then bugmes();quit;end
Compilation of fun2
Compilation of intfun1
Building shared library (be patient)
-// disable message
-warning_mode = warning('query');
-warning('off');
// load the shared library
exec loader.sce
];
addinter(foo_path+'/foo.dll','foo',list_functions);
+Shared archive loaded.
+Link done.
// remove temp. variables on stack
// ------------------------------------------------------
-// enable message
-warning(warning_mode);
chdir(cur_dir);
//using the new primitive
if ( norm(scifun1(33) - .0160328) > 1 ) then bugmes();quit;end
ilib_gen_Make: Copy libfoo.c to TMPDIR
ilib_gen_Make: Modification of the Makefile in TMPDIR.
Running the makefile
-// disable message
-warning_mode = warning('query');
-warning('off');
// load the shared library
exec loader.sce
];
addinter(libfoo_path+'/libfoo.dylib','libfoo',list_functions);
+Shared archive loaded.
+Link done.
// remove temp. variables on stack
chdir(cur_dir);
// ulink() all libraries
ulink();
-// enable message
-warning(warning_mode);
//remove TMP_DIR
rmdir(TMP_DIR,'s');
ilib_build('foo',['c_sum','sci_csum';'c_sub','sci_csub'],files,[]);
-// disable message
-warning_mode = warning('query');
-warning('off');
-
// load the shared library
exec loader.sce
// ulink() all libraries
ulink();
-// enable message
-warning(warning_mode);
//remove TMP_DIR
rmdir(TMP_DIR,'s');
-// =============================================================================
+// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2008 - DIGITEO - Allan CORNET
// Copyright (C) 2009 - DIGITEO
ilib_gen_Make: Copy libfoo.c to TMPDIR
ilib_gen_Make: Modification of the Makefile in TMPDIR.
Running the makefile
-// disable message
-warning_mode = warning('query');
-warning('off');
// load the shared library
exec loader.sce
];
addinter(libfoo_path+'/libfoo.so','libfoo',list_functions);
+Shared archive loaded.
+Link done.
// remove temp. variables on stack
chdir(cur_dir);
// ulink() all libraries
ulink();
-// enable message
-warning(warning_mode);
//remove TMP_DIR
rmdir(TMP_DIR,'s');
Compilation of c_sum.c
Compilation of sci_csum.c
Building shared library (be patient)
-// disable message
-warning_mode = warning('query');
-warning('off');
// load the shared library
exec loader.sce
];
addinter(foo_path+'/foo.dll','foo',list_functions);
+Shared archive loaded.
+Link done.
// remove temp. variables on stack
chdir(cur_dir);
// ulink() all libraries
ulink();
-// enable message
-warning(warning_mode);
//remove TMP_DIR
rmdir(TMP_DIR,'s');
ans =
libext1c.dylib
-// disable message
-warning_mode = warning('query');
-warning('off');
// load the shared library
exec loader.sce
link(ext1c_path+'libext1c.dylib',['ext1c'],'c');
+Shared archive loaded.
+Link done.
// remove temp. variables on stack
// ------------------------------------------------------
-// enable message
-warning(warning_mode);
chdir(cur_dir);
//using the new primitive
a=[1,2,3];b=[4,5,6];n=3;
ilib_for_link('ext1c','fun1.o',[],"c")
-// disable message
-warning_mode = warning('query');
-warning('off');
-
// load the shared library
exec loader.sce
-// enable message
-warning(warning_mode);
-
chdir(cur_dir);
//using the new primitive
ans =
libext1c.so
-// disable message
-warning_mode = warning('query');
-warning('off');
// load the shared library
exec loader.sce
link(ext1c_path+'libext1c.so',['ext1c'],'c');
+Shared archive loaded.
+Link done.
// remove temp. variables on stack
// ------------------------------------------------------
-// enable message
-warning(warning_mode);
chdir(cur_dir);
//using the new primitive
a=[1,2,3];b=[4,5,6];n=3;
ans =
libext1c.dll
-// disable message
-warning_mode = warning('query');
-warning('off');
// load the shared library
exec loader.sce
link(ext1c_path+'libext1c.dll',['ext1c'],'c');
+Shared archive loaded.
+Link done.
// remove temp. variables on stack
// ------------------------------------------------------
-// enable message
-warning(warning_mode);
chdir(cur_dir);
//using the new primitive
a=[1,2,3];b=[4,5,6];n=3;
// ============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2008 - INRIA - Michael Baudin
+// Copyright (C) 2009 - DIGITEO
//
// This file is distributed under the same license as the Scilab package.
// ============================================================================
//
// Test fortran 77 dynamic link.
//
+ilib_verbose(0);
cwd = pwd();
cd TMPDIR;
sourcecode=[' subroutine incrdoublef77(x,y)'
' end'];
mputl(sourcecode,'incrdoublef77.f');
libpath=ilib_for_link('incrdoublef77','incrdoublef77.o',[],'f','Makefile');
- Generate a loader file
- Generate a Makefile
- Running the Makefile
- Compilation of incrdoublef77
- Building shared library (be patient)
exec loader.sce;
-Shared archive loaded.
-Link done.
-n=1.
- n =
-
- 1.
-m=call("incrdoublef77",n,1,"d","out",[1,1],2,"d");
+n = 1;
+m = call("incrdoublef77",n,1,"d","out",[1,1],2,"d");
if abs(m-2.)>%eps then bugmes();quit;end
chdir(cwd);
//
// Test fortran 77 dynamic link.
//
+
+ilib_verbose(0);
+
cwd = pwd();
cd TMPDIR;
sourcecode=[' subroutine incrdoublef77(x,y)'
mputl(sourcecode,'incrdoublef77.f');
libpath=ilib_for_link('incrdoublef77','incrdoublef77.o',[],'f','Makefile');
exec loader.sce;
-n=1.
-m=call("incrdoublef77",n,1,"d","out",[1,1],2,"d");
+n = 1;
+m = call("incrdoublef77",n,1,"d","out",[1,1],2,"d");
if abs(m-2.)>%eps then pause,end
chdir(cwd);
+++ /dev/null
-// ============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2008 - INRIA - Michael Baudin
-// Copyright (C) 2009 - DIGITEO
-//
-// This file is distributed under the same license as the Scilab package.
-// ============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
-//
-// Test fortran 77 dynamic link.
-//
-cwd = pwd();
-cd TMPDIR;
-sourcecode=[' subroutine incrdoublef77(x,y)'
- ' implicit none'
- ' double precision x'
- ' double precision y'
- ' y=x+1'
- ' end'];
-mputl(sourcecode,'incrdoublef77.f');
-libpath=ilib_for_link('incrdoublef77','incrdoublef77.o',[],'f','Makefile');
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy incrdoublef77.f to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the Makefile
-exec loader.sce;
-Shared archive loaded.
-Link done.
-n=1.
- n =
-
- 1.
-m=call("incrdoublef77",n,1,"d","out",[1,1],2,"d");
-if abs(m-2.)>%eps then bugmes();quit;end
-chdir(cwd);
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) ????-2008 - INRIA
+// Copyright (C) 2009 - DIGITEO
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
+// <-- ENGLISH IMPOSED -->
+// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
cd(TMPDIR);
mputl([
'#include ""mex.h""'
'}'
],'mexfunction16.c');
ilib_mex_build('libmex',['mexf16','mexfunction16','cmex'],['mexfunction16.c'],[],'Makelib','','','');
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of mexfunction16.c
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
mexf16(rand(2,3,2));
2 3 2
// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
+
cd(TMPDIR);
mputl([
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) ????-2008 - INRIA
-// Copyright (C) 2009 - DIGITEO
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
-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'],['mexfunction16.c'],[],'Makelib','','','');
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy mexfunction16.c to TMPDIR
- ilib_gen_Make: Copy libmex.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-Shared archive loaded.
-Link done.
-mexf16(rand(2,3,2));
-2 3 2
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Allan CORNET
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- ENGLISH IMPOSED -->
+// <-- JVM NOT MANDATORY -->
+// test set/get ilib_verbose
+ref = 1; // default value
+r = ilib_verbose();
+if r <> ref then bugmes();quit;end
+ierr = execstr('ilib_verbose([1 2]);','errcatch');
+if ierr <> 999 then bugmes();quit;end
+ierr = execstr('ilib_verbose(''foo'');','errcatch');
+if ierr <> 999 then bugmes();quit;end
+ierr = execstr('ilib_verbose(54);','errcatch');
+if ierr <> 999 then bugmes();quit;end
+ierr = execstr('ilib_verbose(5.4);','errcatch');
+if ierr <> 999 then bugmes();quit;end
+ref = 0;
+ilib_verbose(ref)
+r = ilib_verbose();
+if r <> ref then bugmes();quit;end
+ref = 1;
+ilib_verbose(ref)
+r = ilib_verbose();
+if r <> ref then bugmes();quit;end
+ref = 2;
+ilib_verbose(ref)
+r = ilib_verbose();
+if r <> ref then bugmes();quit;end
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Allan CORNET
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- ENGLISH IMPOSED -->
+// <-- JVM NOT MANDATORY -->
+
+// test set/get ilib_verbose
+
+ref = 1; // default value
+r = ilib_verbose();
+if r <> ref then pause,end
+
+ierr = execstr('ilib_verbose([1 2]);','errcatch');
+if ierr <> 999 then pause,end
+
+ierr = execstr('ilib_verbose(''foo'');','errcatch');
+if ierr <> 999 then pause,end
+
+ierr = execstr('ilib_verbose(54);','errcatch');
+if ierr <> 999 then pause,end
+
+ierr = execstr('ilib_verbose(5.4);','errcatch');
+if ierr <> 999 then pause,end
+
+ref = 0;
+ilib_verbose(ref)
+r = ilib_verbose();
+if r <> ref then pause,end
+
+ref = 1;
+ilib_verbose(ref)
+r = ilib_verbose();
+if r <> ref then pause,end
+
+ref = 2;
+ilib_verbose(ref)
+r = ilib_verbose();
+if r <> ref then pause,end
+
// =============================================================================
// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
if MSDOS then
TMP_OS_DIR = getenv('TMP','err');
if (TMP_OS_DIR == 'err') then bugmes();quit;end;
mputl(f1,TMP_DIR+filesep()+'fooc.c');
cur_dir = pwd();
chdir(TMP_DIR);
-// disable message
-warning_mode = warning('query');
-warning('off');
//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.o',[],"c");
- Generate a loader file
- Generate a Makefile
- Running the Makefile
// display the loader.sce file which calls link
mprintf('%s\n',mgetl('loader.sce'))
// ------------------------------------------------------
fooc_path = get_absolute_file_path('loader.sce');
-link(fooc_path+'libfooc.so',['fooc'],'c');
+link(fooc_path+'libfooc.dll',['fooc'],'c');
// remove temp. variables on stack
clear fooc_path;
clear get_file_path;
// load the shared library
exec loader.sce;
link('show');
-// enable message
-warning(warning_mode);
// 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');
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) ????-2008 - INRIA
-// Copyright (C) 2009 - DIGITEO
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
-if MSDOS then
- TMP_OS_DIR = getenv('TMP','err');
- if (TMP_OS_DIR == 'err') then bugmes();quit;end;
-else
- TMP_OS_DIR = '/tmp';
- if ~isdir(TMP_OS_DIR) then bugmes();quit;end;
-end
-TMP_DIR = TMP_OS_DIR+filesep()+'link';
-rmdir(TMP_DIR,'s');
-mkdir(TMP_OS_DIR,'link');
-if ~isdir(TMP_DIR) then bugmes();quit;end;
-//Example of the use of ilib_for_link 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,TMP_DIR+filesep()+'fooc.c');
-cur_dir = pwd();
-chdir(TMP_DIR);
-// disable message
-warning_mode = warning('query');
-warning('off');
-//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.o',[],"c");
- Generate a loader file
- Generate a Makefile
- Running the Makefile
-// display the loader.sce file which calls link
-mprintf('%s\n',mgetl('loader.sce'))
-// ------------------------------------------------------
-// generated by builder.sce: Please do not edit this file
-// ------------------------------------------------------
-
-fooc_path = get_absolute_file_path('loader.sce');
-
-link(fooc_path+'libfooc.dylib',['fooc'],'c');
-// remove temp. variables on stack
-clear fooc_path;
-clear get_file_path;
-// ------------------------------------------------------
-// load the shared library
-exec loader.sce;
-link('show');
-// enable message
-warning(warning_mode);
-// 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
-r = y1-(sin(a)+b);
-if or( r <> zeros(1,10) ) then bugmes();quit;end
-// ulink() all libraries
-ulink();
-//remove TMP_DIR
-rmdir(TMP_DIR,'s');
// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
+
if MSDOS then
TMP_OS_DIR = getenv('TMP','err');
if (TMP_OS_DIR == 'err') then pause,end;
cur_dir = pwd();
chdir(TMP_DIR);
-// disable message
-warning_mode = warning('query');
-warning('off');
-
//creating the shared library: a Makefile and a loader are
//generated, the code is compiled and a shared library built.
link('show');
-// enable message
-warning(warning_mode);
-
// 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');
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) ????-2008 - INRIA
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-if MSDOS then
- TMP_OS_DIR = getenv('TMP','err');
- if (TMP_OS_DIR == 'err') then bugmes();quit;end;
-else
- TMP_OS_DIR = '/tmp';
- if ~isdir(TMP_OS_DIR) then bugmes();quit;end;
-end
-TMP_DIR = TMP_OS_DIR+filesep()+'link';
-rmdir(TMP_DIR,'s');
-mkdir(TMP_OS_DIR,'link');
-if ~isdir(TMP_DIR) then bugmes();quit;end;
-//Example of the use of ilib_for_link 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,TMP_DIR+filesep()+'fooc.c');
-cur_dir = pwd();
-chdir(TMP_DIR);
-// disable message
-warning_mode = warning('query');
-warning('off');
-//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.o',[],"c");
- Generate a loader file
- Generate a Makefile
- Running the Makefile
- Compilation of fooc
- Building shared library (be patient)
-// display the loader.sce file which calls link
-mprintf('%s\n',mgetl('loader.sce'))
-// ------------------------------------------------------
-// generated by builder.sce: Please do not edit this file
-// ------------------------------------------------------
-
-fooc_path = get_absolute_file_path('loader.sce');
-
-link(fooc_path+'libfooc.dll',['fooc'],'c');
-// remove temp. variables on stack
-clear fooc_path;
-clear get_file_path;
-// ------------------------------------------------------
-// load the shared library
-exec loader.sce;
-link('show');
-// enable message
-warning(warning_mode);
-// 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
-r = y1-(sin(a)+b);
-if or( r <> zeros(1,10) ) then bugmes();quit;end
-// ulink() all libraries
-ulink();
-//remove TMP_DIR
-rmdir(TMP_DIR,'s');
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) ????-2008 - INRIA
+// Copyright (C) 2009 - DIGITEO
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
+// <-- ENGLISH IMPOSED -->
+// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
curPath = getcwd();
pref='ext';
suf='f';
copyfile(SCI+filesep()+'modules'+filesep()+'dynamic_link'+filesep()+'tests'+filesep()+'unit_tests'+filesep()+'externals.f', TMPDIR);
chdir(TMPDIR);
ilib_for_link(routines,'externals.o',[],"f");
- Generate a loader file
- Generate a Makefile
- Running the Makefile
- Compilation of externals
- Building shared library (be patient)
-// disable message
-warning_mode = warning('query');
-warning('off');
// load the shared library
exec loader.sce ;
-// enable message
-warning(warning_mode);
//===========================================================
//(very) simple example 1
//===========================================================
// <-- ENGLISH IMPOSED -->
// <-- JVM NOT MANDATORY -->
+ilib_verbose(0);
+
curPath = getcwd();
pref='ext';
suf='f';
chdir(TMPDIR);
ilib_for_link(routines,'externals.o',[],"f");
-// disable message
-warning_mode = warning('query');
-warning('off');
-
// load the shared library
exec loader.sce ;
-// enable message
-warning(warning_mode);
//===========================================================
//(very) simple example 1
//===========================================================
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) ????-2008 - INRIA
-// Copyright (C) 2009 - DIGITEO
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- ENGLISH IMPOSED -->
-// <-- JVM NOT MANDATORY -->
-curPath = getcwd();
-pref='ext';
-suf='f';
-routines=[pref(ones(1,12))+string(1:12)+suf(ones(1,12))];
-copyfile(SCI+filesep()+'modules'+filesep()+'dynamic_link'+filesep()+'tests'+filesep()+'unit_tests'+filesep()+'externals.f', TMPDIR);
-chdir(TMPDIR);
-ilib_for_link(routines,'externals.o',[],"f");
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy externals.f to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the Makefile
-// disable message
-warning_mode = warning('query');
-warning('off');
-// load the shared library
-exec loader.sce ;
-// enable message
-warning(warning_mode);
-//===========================================================
-//(very) simple example 1
-//===========================================================
-a=[1,2,3];b=[4,5,6];n=3;
-c=call('ext1f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d');
-if norm(c-(a+b)) > %eps then bugmes();quit;end
-//===========================================================
-//Simple example #2
-//===========================================================
-a=[1,2,3];b=[4,5,6];n=3;
-c=call('ext2f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d');
-if norm(c-(sin(a)+cos(b))) > %eps then bugmes();quit;end
-//===========================================================
-//Example #3
-//===========================================================
-a=[1,2,3];b=[4,5,6];n=3;
-c=call('ext3f','yes',1,'c',n,2,'i',a,3,'d',b,4,'d','out',[1,3],5,'d');
-if norm(c-(sin(a)+cos(b)))> %eps then bugmes();quit;end
-c=call('ext3f','no',1,'c',n,2,'i',a,3,'d',b,4,'d','out',[1,3],5,'d');
-if norm(c-(a+b)) > %eps then bugmes();quit;end
-//===========================================================
-//Example #4
-//===========================================================
-a=[1,2,3];b=[4,5,6];n=3;yes='yes';
-c=call('ext4f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d');
-if norm(c-(sin(a)+cos(b))) > %eps then bugmes();quit;end
-yes='no';
-c=call('ext4f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d');
-if norm(c-(a+b)) > %eps then bugmes();quit;end
-//clear yes --> undefined variable : yes
-//===========================================================
-//Example #5
-//===========================================================
-// reading vector a in scilab internal stack
-a=[1,2,3];b=[2,3,4];
-c=call('ext5f',b,1,'d','out',[1,3],2,'d');
-if norm(c-(a+2*b)) > %eps then bugmes();quit;end
-//===========================================================
-//Example #6
-//===========================================================
-//reading vector with name='a' in scilab internal stack
-a=[1,2,3];b=[2,3,4];
-c=call('ext6f','a',1,'c',b,2,'d','out',[1,3],3,'d');
-if norm(c-(a+2*b)) > %eps then bugmes();quit;end
-//===========================================================
-//Example #7
-//===========================================================
-//creating vector c in scilab internal stack
-clear c;
-a=[1,2,3]; b=[2,3,4];
-//c does not exist (c made by ext7f)
-c1=call('ext7f',a,1,'d',b,2,'d','out',2);
-if norm(c1-b) > %eps then bugmes();quit;end
-//c now exists
-if norm(c-(a+2*b)) > %eps then bugmes();quit;end
-//d exists
-if d<>"test" then bugmes();quit;end
-//===========================================================
-//Example #8
-//===========================================================
-//call ext8f argument function with dynamic link
-yref=ode([1;0;0],0,[0.4,4],'ext8f');
-//===========================================================
-//Example #9
-//===========================================================
-//passing a parameter to ext9f routine by a list:
-param=[0.04,10000,3d+7];
-y=ode([1;0;0],0,[0.4,4],list('ext9f',param));
-if norm(y-yref) > 10000*%eps then bugmes();quit;end
-//===========================================================
-//Example #10
-//===========================================================
-//Passing a parameter to argument funtion of ode
-param=[0.04,10000,3d+7];
-y=ode([1;0;0],0,[0.4,4],'ext10f');
-//param must be defined as a scilab variable upon calling ode
-if norm(y-yref) > 10000*%eps then bugmes();quit;end
-//===========================================================
-//Example #11
-//===========================================================
-//sharing common data
-a=1:10;
-n=10;a=1:10;
-call('ext11f',n,1,'i',a,2,'r','out',2); //loads b with a
-c=call('ext12f',n,1,'i','out',[1,10],2,'r'); //loads c with b
-if norm(c-a) > %eps then bugmes();quit;end
-//===========================================================
-chdir(curPath);
<para>if object is a size implicit polynom used for indexing.</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>"library"</term>
+ <listitem>
+ <para>if object is function library.</para>
+ </listitem>
+ </varlistentry>
</variablelist>
</refsection>
<refsection>
L=tlist(['V','a','b'],18,'Scilab');
typeof(L)
+
+typeof(corelib)
]]></programlisting>
</refsection>
// Serge Steer - Scilab Project
// Copyright INRIA
// 19/02/2007
+ilib_verbose(0);
cur=pwd();
cd(TMPDIR);
//first create a function changetype
'}'];
mputl(code,'intchangetype.c');
ilib_build('libtest',['changetype','intchangetype'],'intchangetype',[]);
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy intchangetype.c to TMPDIR
- ilib_gen_Make: Copy libtest.c to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-
-// ------------------------------------------------------
-
-// generated by builder.sce: Please do not edit this file
-
-// ------------------------------------------------------
-
-
-libtest_path = get_file_path('loader.sce');
-
-list_functions = [ 'changetype';
-];
-
-addinter(libtest_path+'/libtest.so','libtest',list_functions);
-Shared archive loaded.
-Link done.
-
-// remove temp. variables on stack
-
-clear libtest_path;
-
-clear list_functions;
-
-clear get_file_path;
-
-// ------------------------------------------------------
-
cd(cur);
//create variables of type 222
A=rand(3,2);
// Copyright INRIA
// 19/02/2007
+ilib_verbose(0);
+
cur=pwd();
cd(TMPDIR);
//first create a function changetype
'}'];
mputl(code,'intchangetype.c');
ilib_build('libtest',['changetype','intchangetype'],'intchangetype',[]);
-exec('loader.sce')
+exec('loader.sce');
cd(cur);
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2007-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- Non-regression test for bug 2052 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=2052
-//
-// <-- Short Description -->
-// Bug dans la primitive "isequal" (au moins) avec des type de donn�es
-// utilisateur
-// Serge Steer - Scilab Project
-// Copyright INRIA
-// 19/02/2007
-cur=pwd();
-cd(TMPDIR);
-//first create a function changetype
-code=['#include ""stack-c.h""'
-'int intchangetype(fname)'
-' char *fname;'
-'{'
-' int m1,n1,l1;'
-' CheckRhs(2,2);'
-' CheckLhs(1,1);'
-' GetRhsVar(2,""i"",&m1,&n1,&l1)'
-' /* change the type */'
-' *istk(iadr(*Lstk(Top-1)))=*istk(l1);'
-' C2F(intersci).ntypes[0] = ''$'';'
-' LhsVar(1)=1;'
-' return 0;'
-'}'];
-mputl(code,'intchangetype.c');
-ilib_build('libtest',['changetype','intchangetype'],'intchangetype',[]);
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of intchangetype
- Building shared library (be patient)
-
-// ------------------------------------------------------
-
-// generated by builder.sce: Please do not edit this file
-
-// ------------------------------------------------------
-
-
-libtest_path = get_file_path('loader.sce');
-
-list_functions = [ 'changetype';
-];
-
-addinter(libtest_path+'/libtest.dll','libtest',list_functions);
-Shared archive loaded.
-Link done.
-
-// remove temp. variables on stack
-
-clear libtest_path;
-
-clear list_functions;
-
-clear get_file_path;
-
-// ------------------------------------------------------
-
-cd(cur);
-//create variables of type 222
-A=rand(3,2);
-a=changetype(A,222);
-//associate a typename to 222
-typename("bug2052", 222)
-//define overloading function for isequal
-function r=%bug2052_isequal(x,y)
- r=type(x)==222&type(y)==222
- if r then
- x=changetype(x,1)
- y=changetype(y,1)
- r=r&and(x==y)
- end
-endfunction
-//Check if everything is ok
-l=list(1,2,3);
-if ~isequal(a,a) then bugmes();quit;end
-if isequal(a,A) then bugmes();quit;end
-if isequal(A,a) then bugmes();quit;end
-if ~isequal(A,A) then bugmes();quit;end
-if ~isequal(l,l) then bugmes();quit;end
-if isequal(l,A) then bugmes();quit;end
if norm(evstr(a1)- matrix(a(:,ind),N1,P1)) > %eps then bugmes();quit;end;
// a and string(a) are in the same order in the previous example
if norm(evstr(a1)- a2 ) > %eps then bugmes();quit;end;
-exit
// double format.
//
// Also occur in other OS's.
+ilib_verbose(0);
my_current_directory = pwd();
cd(TMPDIR);
mputl('ilib_mex_build(''libmex'',[''mexf16'',''mexfunction16'',''cmex''],[''mexfunction16.c''],[],''Makelib'','''','''','''')','builder.sce');
' sciprint(""%d %d %d\n"",dims[0],dims[1],dims[2]);'
'}'
],'mexfunction16.c');
- Generate a gateway file
- Generate a loader file
- Generate a Makefile: Makelib
- Running the makefile
- Compilation of mexfunction16.c
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
mexf16(rand(2,3,2))
2 3 2
cd(my_current_directory);
//
// Also occur in other OS's.
+ilib_verbose(0);
+
my_current_directory = pwd();
cd(TMPDIR);
mputl('ilib_mex_build(''libmex'',[''mexf16'',''mexfunction16'',''cmex''],[''mexfunction16.c''],[],''Makelib'','''','''','''')','builder.sce');
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2006-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- Non-regression test for bug 614 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=614
-//
-// <-- Short Description -->
-// mxGetDimensions() from mex.h and mexlib.c do not work
-// properly. The reason is that it returns a pointer to int
-// like Matlab, but in fact, the dimensions in scilab are in
-// double format.
-//
-// Also occur in other OS's.
-my_current_directory = pwd();
-cd(TMPDIR);
-mputl('ilib_mex_build(''libmex'',[''mexf16'',''mexfunction16'',''cmex''],[''mexfunction16.c''],[],''Makelib'','''','''','''')','builder.sce');
-mputl([
-'#include ""mex.h""'
-'void mexFunction(nlhs, plhs, nrhs, prhs)'
-' int nlhs, nrhs;'
-' mxArray *plhs[]; mxArray *prhs[];'
-'{'
-' int *dims = mxGetDimensions(prhs[0]);'
-' sciprint(""%d %d %d\n"",dims[0],dims[1],dims[2]);'
-'}'
-],'mexfunction16.c');
- Generate a gateway file
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy mexfunction16.c to TMPDIR
- ilib_gen_Make: Copy libmex.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the makefile
-Shared archive loaded.
-Link done.
-mexf16(rand(2,3,2))
-2 3 2
-cd(my_current_directory);
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
+// <-- ENGLISH IMPOSED -->
//
// optim.tst --
// Test the optim command with the Rosenbrock test case
// Thus, the "genros" function from Ex-optim.f is not needed anymore.
//
// This is the precision measured with experiments.
+ilib_verbose(0);
Leps=10^12*%eps;
n=3;
xopt=ones(n,1);
mputl(F,TMPDIR+'/rosenf.f');
// compile the Fortran code
libpath=ilib_for_link('rosenf','rosenf.o',[],'f',TMPDIR+'/Makefile');
- Generate a loader file
- Generate a Makefile
- Running the Makefile
- Compilation of rosenf
- Building shared library (be patient)
// incremental linking
linkid=link(libpath,'rosenf','f');
-Shared archive loaded.
-Link done.
//solve the problem
x0=1.2*ones(n,1);
valtd=100;
// Thus, the "genros" function from Ex-optim.f is not needed anymore.
//
// This is the precision measured with experiments.
+
+ilib_verbose(0);
+
Leps=10^12*%eps;
n=3;
xopt=ones(n,1);
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) ????-2008 - INRIA - Michael Baudin
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-//
-// optim.tst --
-// Test the optim command with the Rosenbrock test case
-// in the case where the cost function is provided as a Fortran
-// routine and the parameter is given as a scilab variable, using the "td" option.
-//
-// Note : the following source code was copied from optimization/sci_gateway/fortran/Ex-optim.f
-// Thus, the "genros" function from Ex-optim.f is not needed anymore.
-//
-// This is the precision measured with experiments.
-Leps=10^12*%eps;
-n=3;
-xopt=ones(n,1);
-//
-// Define a fortran source code and compile it (fortran compiler required)
-//
-// External function written in Fortran (Fortran compiler required)
-// write down the Fortran code (Rosenbrock problem)
-F=[ ' subroutine rosenf(ind, n, x, f, g, ti, tr, td)'
-' integer ind,n,ti(*)'
-' double precision x(n),f,g(n),td(*)'
-' real tr(*)'
-'c'
-' double precision y,p'
-' p=td(1)'
-' if (ind.eq.2.or.ind.eq.4) then'
-' f=1.0d0'
-' do i=2,n'
-' f=f+p*(x(i)-x(i-1)**2)**2+(1.0d0-x(i))**2'
-' enddo'
-' endif'
-' if (ind.eq.3.or.ind.eq.4) then'
-' g(1)=-4.0d0*p*(x(2)-x(1)**2)*x(1)'
-' if(n.gt.2) then'
-' do i=2,n-1'
-' g(i)=2.0d0*p*(x(i)-x(i-1)**2)-4.0d0*p*(x(i+1)-x(i)**2)*x(i)'
-' & -2.0d0*(1.0d0-x(i))'
-' enddo'
-' endif'
-' g(n)=2.0d0*p*(x(n)-x(n-1)**2)-2.0d0*(1.0d0-x(n))'
-' endif'
-' return'
-' end'];
-mputl(F,TMPDIR+'/rosenf.f');
-// compile the Fortran code
-libpath=ilib_for_link('rosenf','rosenf.o',[],'f',TMPDIR+'/Makefile');
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy rosenf.o to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the Makefile
-// incremental linking
-linkid=link(libpath,'rosenf','f');
-Shared archive loaded.
-Link done.
-//solve the problem
-x0=1.2*ones(n,1);
-valtd=100;
-[f,xo,go]=optim('rosenf',x0,'td',valtd);
-// Test with all solvers
-solverlist=["gc" "qn" "nd"];
-for solver=solverlist
- [f,x,g]=optim('rosenf',x0,solver,'td',valtd);
- if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-end
-// Test all verbose levels with all possible solvers
-verboselevels=[0 1 2 3];
-for verbose=verboselevels
- for solver=solverlist
- [f,x,g]=optim('rosenf',x0,solver,'td',valtd,imp=verbose);
- if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
- end
-end
-Optim stops: maximum number of calls to f is reached.
-
-Norm of projected gradient lower than 0.0000000D+00.
-
-entry in n1fc1 . n= 3 memax= 10
-minimal array sizes: iz( 22) rz( 85) dz( 198)
-n1fc1 Incorrect end of fprf2
-End of optimization.
-
-Optim stops: maximum number of calls to f is reached.
-
-Norm of projected gradient lower than 0.0000000D+00.
-
-entry in n1fc1 . n= 3 memax= 10
-minimal array sizes: iz( 22) rz( 85) dz( 198)
- n1fc1 diam1= 0.497D+00 eta2= 0.000D+00 ap= 0.201D-28
- n1fc1 10 25 0.1000126D+01 faisceau reduit a 2 gradients
- n1fc1 18 45 0.1000000D+01 faisceau reduit a 3 gradients
-n1fc1 eta2 assigned to 0.000D+00
- n1fc1 21 50 0.1000000D+01 convergence a 0.297D-08 pres (-0.00D+00)
-n1fc1 Incorrect end of fprf2
-End of optimization.
-
-Optim stops: maximum number of calls to f is reached.
-
-Norm of projected gradient lower than 0.0000000D+00.
-
-entry in n1fc1 . n= 3 memax= 10
-minimal array sizes: iz( 22) rz( 85) dz( 198)
-n1fc1 1 1 0.1260000D+02 0.10D+01 0.20D+05 0.00D+00 2
- n1fc1 diam1= 0.497D+00 eta2= 0.000D+00 ap= 0.201D-28
-n1fc1 2 3 0.1412656D+01 0.10D+01 0.49D+03 0.00D+00 2
-n1fc1 3 7 0.1082768D+01 0.67D+00 0.67D+01 0.00D+00 3
-n1fc1 4 10 0.1081042D+01 0.66D-02 0.31D+00 0.00D+00 4
-n1fc1 5 13 0.1020070D+01 0.15D+00 0.30D+00 0.00D+00 4
-n1fc1 6 15 0.1010168D+01 0.21D-01 0.12D+02 0.20D+03 3
-n1fc1 7 16 0.1001164D+01 0.20D-01 0.44D+00 0.69D+01 3
-n1fc1 8 18 0.1000717D+01 0.18D-02 0.14D-02 0.36D+00 4
-n1fc1 9 20 0.1000191D+01 0.18D-02 0.38D-04 0.56D-01 4
-n1fc1 10 23 0.1000169D+01 0.44D-04 0.96D-01 0.19D+03 2
- n1fc1 10 25 0.1000126D+01 faisceau reduit a 2 gradients
-n1fc1 11 25 0.1000126D+01 0.87D-04 0.20D-02 0.14D+02 3
-n1fc1 12 27 0.1000121D+01 0.99D-05 0.45D-03 0.71D+00 4
-n1fc1 13 30 0.1000002D+01 0.24D-03 0.17D-04 0.00D+00 4
-n1fc1 14 34 0.1000002D+01 0.38D-06 0.35D-02 0.54D+02 2
-n1fc1 15 36 0.1000000D+01 0.30D-05 0.19D-03 0.77D+01 3
-n1fc1 16 38 0.1000000D+01 0.40D-06 0.13D-05 0.45D+00 3
-n1fc1 17 41 0.1000000D+01 0.40D-08 0.30D-04 0.19D+03 2
-n1fc1 18 43 0.1000000D+01 0.20D-07 0.70D-06 0.26D+02 3
- n1fc1 18 45 0.1000000D+01 faisceau reduit a 3 gradients
-n1fc1 19 45 0.1000000D+01 0.24D-08 0.55D-06 0.56D+02 3
-n1fc1 20 47 0.1000000D+01 0.11D-08 0.35D-07 0.00D+00 4
-n1fc1 eta2 assigned to 0.000D+00
- n1fc1 21 50 0.1000000D+01 convergence a 0.297D-08 pres (-0.00D+00)
-n1fc1 21 50 0.1000000D+01 0.30D-09 0.16D-08 0.62D+00 3
-n1fc1 22 54 0.1000000D+01 0.19D-10 0.18D-08 0.74D+00 3
-n1fc1 Incorrect end of fprf2
-End of optimization.
-
-// Clean-up
-ulink(linkid);
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
+// <-- ENGLISH IMPOSED -->
//
// optim.tst --
// Test the optim command with the Rosenbrock test case
//
// Define a fortran source code and compile it (fortran compiler required)
//
+ilib_verbose(0);
fortransource=[' subroutine rosenf(ind,n,x,f,g,izs,rzs,dzs)'
'C -------------------------------------------'
'c (DLL Digital Visual Fortran)'
mputl(fortransource,TMPDIR+'/rosenf.f');
// compile the C code
libpath=ilib_for_link('rosenf','rosenf.o',[],'f',TMPDIR+'/Makefile');
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy rosenf.o to TMPDIR
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the Makefile
// incremental linking
linkid=link(libpath,'rosenf','f');
-Shared archive loaded.
-Link done.
//
// Define some constants
//
//
// Define a fortran source code and compile it (fortran compiler required)
//
+
+ilib_verbose(0);
+
fortransource=[' subroutine rosenf(ind,n,x,f,g,izs,rzs,dzs)'
'C -------------------------------------------'
'c (DLL Digital Visual Fortran)'
+++ /dev/null
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) ????-2008 - INRIA - Michael Baudin
-//
-// This file is distributed under the same license as the Scilab package.
-// =============================================================================
-//
-// optim.tst --
-// Test the optim command with the Rosenbrock test case
-// in the case where the cost function is provided as a Fortran
-// routine and use the "in" option.
-//
-// Note : the following source code was copied from optimization/sci_gateway/fortran/Ex-optim.f
-// Thus, the "genros" function from Ex-optim.f is not needed anymore.
-//
-//
-// Define a fortran source code and compile it (fortran compiler required)
-//
-fortransource=[' subroutine rosenf(ind,n,x,f,g,izs,rzs,dzs)'
-'C -------------------------------------------'
-'c (DLL Digital Visual Fortran)'
-'c On Windows , we need to import common nird from scilab'
-'cDEC$ IF DEFINED (FORDLL)'
-'cDEC$ ATTRIBUTES DLLIMPORT:: /nird/'
-'cDEC$ ENDIF'
-'C -------------------------------------------'
-'c Example of cost function given by a subroutine'
-'c if n<=2 returns ind=0'
-'c f.bonnans, oct 86'
-' implicit double precision (a-h,o-z)'
-' real rzs(1)'
-' double precision dzs(*)'
-' dimension x(n),g(n),izs(*)'
-' common/nird/nizs,nrzs,ndzs'
-' if (n.lt.3) then'
-' ind=0'
-' return'
-' endif'
-' if(ind.eq.10) then'
-' nizs=2'
-' nrzs=1'
-' ndzs=2'
-' return'
-' endif'
-' if(ind.eq.11) then'
-' izs(1)=5'
-' izs(2)=10'
-' dzs(2)=100.0d+0'
-' return'
-' endif'
-' if(ind.eq.2)go to 5'
-' if(ind.eq.3)go to 20'
-' if(ind.eq.4)go to 5'
-' ind=-1'
-' return'
-'5 f=1.0d+0'
-' do 10 i=2,n'
-' im1=i-1'
-'10 f=f + dzs(2)*(x(i)-x(im1)**2)**2 + (1.0d+0-x(i))**2'
-' if(ind.eq.2)return'
-'20 g(1)=-4.0d+0*dzs(2)*(x(2)-x(1)**2)*x(1)'
-' nm1=n-1'
-' do 30 i=2,nm1'
-' im1=i-1'
-' ip1=i+1'
-' g(i)=2.0d+0*dzs(2)*(x(i)-x(im1)**2)'
-'30 g(i)=g(i) -4.0d+0*dzs(2)*(x(ip1)-x(i)**2)*x(i) - '
-' & 2.0d+0*(1.0d+0-x(i))'
-' g(n)=2.0d+0*dzs(2)*(x(n)-x(nm1)**2) - 2.0d+0*(1.0d+0-x(n))'
-' return'
-' end'];
-mputl(fortransource,TMPDIR+'/rosenf.f');
-// compile the C code
-libpath=ilib_for_link('rosenf','rosenf.o',[],'f',TMPDIR+'/Makefile');
- Generate a loader file
- Generate a Makefile
- Running the Makefile
- Compilation of rosenf
- Building shared library (be patient)
-// incremental linking
-linkid=link(libpath,'rosenf','f');
-Shared archive loaded.
-Link done.
-//
-// Define some constants
-//
-Leps=8.e-5;
-bs=10.*ones(1,5);
-bi=-bs;
-x0=0.12*bs;
-epsx=1.e-15*x0;
-xopt=.1*bs;
-//
-// Solve the problem
-//
-[f,x,g]=optim('rosenf',x0,'in');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g]=optim('rosenf',x0,'gc','in');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-//
-[f,x,g]=optim('rosenf',x0,'nd','in');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g]=optim('rosenf',x0,'qn',1,'in');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g]=optim('rosenf',x0,'gc',1,50,'in');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-//
-[f,x,g]=optim('rosenf',x0,'nd',1,50,'in');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x1,g] =optim('rosenf',x0, 'ar',100,6,'in');
-[f,x,g,to]=optim('rosenf',x0, 'ar',100,3,'in');
-[f,x,g,to]=optim('rosenf',x ,to,'ar',100,3,'in');
-if norm(x-x1)/norm(x-xopt) > 0.1 then bugmes();quit;end
-[f,x1,g]=optim('rosenf','b',bi,bs,x0,'ar',100,6,'in');
-[f,x,g,to]=optim('rosenf','b',bi,bs,x0,'ar',100,3,'in');
-[f,x,g] =optim('rosenf','b',bi,bs,x,to,'ar',100,3,'in');
-if norm(x-x1)/norm(x-xopt) > 0.1 then bugmes();quit;end
-//
-// Test all possible stop criteria settings
-//
-[f,x,g]=optim('rosenf',x0,'ar','in');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g]=optim('rosenf',x0,'ar',100,'in');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g]=optim('rosenf',x0,'ar',100,100,'in');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g]=optim('rosenf',x0,'ar',100,100,%eps,'in');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g]=optim('rosenf',x0,'ar',100,100,%eps,%eps,'in');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g]=optim('rosenf',x0,'ar',100,100,10.*%eps,%eps,epsx,'in');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g]=optim('rosenf',x0,'gc','ar',100,100,%eps,%eps,epsx,'in');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-//
-[f,x,g]=optim('rosenf','b',bi,bs,x0,'in');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g]=optim('rosenf','b',bi,bs,x0,'gc','in');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x]=optim('rosenf','b',bi,bs,x0,'ar',100,100,1.d-8,'in');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g]=optim('rosenf',..
- 'b',bi,bs,x0,'gc','ar',100,100,%eps,%eps,epsx,'in');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g,to,td]=optim('rosenf',x0,'in','sd');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g,ti]=optim('rosenf',x0,'gc','in','si');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g,to,ti,td]=optim('rosenf',x0,to,'in','si','sd');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g,td]=optim('rosenf',..
- 'b',bi,bs,x0,'gc','ar',100,100,%eps,%eps,epsx,'in','sd');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g,ti]=optim('rosenf',x0,'gc','ar',100,100,%eps,'in','si');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g,ti,td]=optim('rosenf',..
- x0,'gc','ar',100,100,%eps,'in','si','sd');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-[f,x,g,ti,td]=optim('rosenf',..
- x0,'gc','ar',100,100,%eps,'in','ti',ti,'td',td,'si','sd');
-if abs(f-1+norm(x-xopt) ) > Leps then bugmes();quit;end
-// Clean-up
-ulink(linkid);
// This file is distributed under the same license as the Scilab package.
// =============================================================================
// <-- ENGLISH IMPOSED -->
+ilib_verbose(0);
load(fullfile(SCI,'modules','scicos','tests','unit_tests','pendulum_anim45.cos'));
M=10;
m=3;
[X,U,Y,XP] = steadycos(scs_m,[],[],[],[],1,1:$);
Compile and link Scicos C BLOCK code
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy inv_pend.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the Makefile
-Shared archive loaded.
-Link done.
sys = lincos(scs_m,X,U);
// =============================================================================
// <-- ENGLISH IMPOSED -->
+ilib_verbose(0);
exec(fullfile(SCI,'modules','scicos','tests','unit_tests','PENDULUM_ANIM.sci'));
exec(fullfile(SCI,'modules','scicos','tests','unit_tests','anim_pen.sci'));
+++ /dev/null
-
-///withoutPrompt
-
-function [x,y,typ]=PENDULUM_ANIM(job,arg1,arg2)
-// Animation of the cart-pendulum problem
- x=[];y=[];typ=[]
- select job
- case 'plot' then
- standard_draw(arg1)
- case 'getinputs' then
- [x,y,typ]=standard_inputs(o)
- case 'getoutputs' then
- x=[];y=[];typ=[];
- case 'getorigin' then
- [x,y]=standard_origin(arg1)
- case 'set' then
- x=arg1;
- graphics=arg1.graphics;exprs=graphics.exprs
- model=arg1.model;dstate=model.dstate
- while %t do
- [ok,plen,csiz,phi,xmin,xmax,ymin,ymax,exprs]=getvalue(..
- 'Set Scope parameters',..
- ['pendulum length';'cart size (square side)';'slope';
- 'Xmin';'Xmax'; 'Ymin'; 'Ymax'; ],..
- list('vec',1,'vec',1,'vec',1,'vec',1,'vec',1,'vec',1,'vec',1),exprs)
- if ~ok then break,end
- mess=[]
- if plen<=0|csiz<=0 then
- mess=[mess;'Pendulum lenght and cart size must be positive.';' ']
- ok=%f
- end
- if ymin>=ymax then
- mess=[mess;'Ymax must be greater than Ymin';' ']
- ok=%f
- end
- if xmin>=xmax then
- mess=[mess;'Xmax must be greater than Xmin';' ']
- ok=%f
- end
- if ~ok then
- message(mess)
- else
- rpar=[plen;csiz;phi;xmin;xmax;ymin;ymax]
- model.rpar=rpar;
- graphics.exprs=exprs;
- x.graphics=graphics;x.model=model
- break
- end
- end
- case 'define' then
- plen=2; csiz=2; phi=0;
- xmin=-5;xmax=5;ymin=-5;ymax=5
- model=scicos_model()
- model.sim=list('anim_pen',5)
- model.in=[1;1]
- model.evtin=1
- model.dstate=0
- model.rpar=[plen;csiz;phi;xmin;xmax;ymin;ymax]
- model.blocktype='d'
- model.dep_ut=[%f %f]
- exprs=string(model.rpar)
- gr_i=['thick=xget(''thickness'');xset(''thickness'',2);';
- 'xx=orig(1)+sz(1)*[.4 .6 .6 .4 .4]'
- 'yy=orig(2)+sz(2)*[.2 .2 .4 .4 .2]'
- 'xpoly(xx,yy,''lines'')'
- 'xx=orig(1)+sz(1)*[.5 .6]'
- 'yy=orig(2)+sz(2)*[.4 .8]'
- 'xpoly(xx,yy)'
- 'xset(''thickness'',thick);']
- x=standard_define([3 3],model,exprs,gr_i)
- end
-endfunction
-
-
-
-function [blocks] = anim_pen(blocks,flag)
-//** 7 Jan 2009 : updated for Scilab 5.x
- win = 20000+curblock();
- if flag<>4 then
- H=scf(win)
- end
- xold = blocks.z
- rpar = blocks.rpar
- plen = rpar(1); csiz = rpar(2); phi = rpar(3);
- //** INIT
- if flag==4 then
- H = scf(win)
- clf(H)
- Axe = H.children
- Axe.data_bounds=rpar(4:7)
- Axe.isoview='on'
- S=[cos(phi),-sin(phi);sin(phi),cos(phi)]
- XY=S*[rpar(4),rpar(5);-csiz/2,-csiz/2]
- drawlater();
- xsegs(XY(1,:),XY(2,:))
- x=0; theta=0;
- x1=x-csiz/2;x2=x+csiz/2;y1=-csiz/2;y2=csiz/2
- XY=S*[x1 x2 x2 x1 x1;y1,y1,y2,y2,y1]
- xpoly(XY(1,:),XY(2,:),"lines",1)
- XY=S*[x,x+plen*sin(theta);0,0+plen*cos(theta)]
- xsegs(XY(1,:),XY(2,:));
- drawnow();
- //** UPDATE
- elseif flag==2 then
- Axe = H.children
- x = blocks.inptr(1)(1)
- theta = blocks.inptr(2)(1)
- drawlater();
- XY=Axe.children(2).data' + [cos(phi)*(x-xold);sin(phi)*(x-xold)]*ones(1,5);
- Axe.children(2).data=XY' ;
- x1=x*cos(phi);y1=x*sin(phi) ;
- XY=[x1,x1+plen*sin(theta);y1,y1+plen*cos(theta)] ;
- Axe.children(1).data=XY' ;
- blocks.z = x ;
- drawnow();
- end
-endfunction
-
-load(fullfile(SCI,'modules','scicos','tests','unit_tests','pendulum_anim45.cos'))
-M=10;
-m=3;
-l=3;
-ph=0.1;
-scs_m = scs_m.objs(5).model.rpar;
-[X,U,Y,XP] = steadycos(scs_m,[],[],[],[],1,1:$);
-
- Compile and link Scicos C BLOCK code
- Generate a loader file
- Generate a Makefile
- Running the Makefile
- Compilation of inv_pend.c
- Building shared library (be patient)
-Shared archive loaded.
-Link done.
-sys = lincos(scs_m,X,U);
// This file is distributed under the same license as the Scilab package.
// =============================================================================
// <-- ENGLISH IMPOSED -->
+ilib_verbose(0);
load(fullfile(SCI,'modules','scicos','tests','unit_tests','pendulum_anim45.cos'));
M=10;
m=3;
[X,U,Y,XP] = steadycos(scs_m,[],[],[],[],1,1:$);
Compile and link Scicos C BLOCK code
- Generate a loader file
- Generate a Makefile
- ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy inv_pend.c to TMPDIR
- ilib_gen_Make: configure : Generate Makefile.
- ilib_gen_Make: Modification of the Makefile in TMPDIR.
- Running the Makefile
-Shared archive loaded.
-Link done.
// <-- ENGLISH IMPOSED -->
+ilib_verbose(0);
+
exec(fullfile(SCI,'modules','scicos','tests','unit_tests','PENDULUM_ANIM.sci'));
exec(fullfile(SCI,'modules','scicos','tests','unit_tests','anim_pen.sci'));
load(fullfile(SCI,'modules','scicos','tests','unit_tests','pendulum_anim45.cos'));
+++ /dev/null
-
-///withoutPrompt
-
-function [x,y,typ]=PENDULUM_ANIM(job,arg1,arg2)
-// Animation of the cart-pendulum problem
- x=[];y=[];typ=[]
- select job
- case 'plot' then
- standard_draw(arg1)
- case 'getinputs' then
- [x,y,typ]=standard_inputs(o)
- case 'getoutputs' then
- x=[];y=[];typ=[];
- case 'getorigin' then
- [x,y]=standard_origin(arg1)
- case 'set' then
- x=arg1;
- graphics=arg1.graphics;exprs=graphics.exprs
- model=arg1.model;dstate=model.dstate
- while %t do
- [ok,plen,csiz,phi,xmin,xmax,ymin,ymax,exprs]=getvalue(..
- 'Set Scope parameters',..
- ['pendulum length';'cart size (square side)';'slope';
- 'Xmin';'Xmax'; 'Ymin'; 'Ymax'; ],..
- list('vec',1,'vec',1,'vec',1,'vec',1,'vec',1,'vec',1,'vec',1),exprs)
- if ~ok then break,end
- mess=[]
- if plen<=0|csiz<=0 then
- mess=[mess;'Pendulum lenght and cart size must be positive.';' ']
- ok=%f
- end
- if ymin>=ymax then
- mess=[mess;'Ymax must be greater than Ymin';' ']
- ok=%f
- end
- if xmin>=xmax then
- mess=[mess;'Xmax must be greater than Xmin';' ']
- ok=%f
- end
- if ~ok then
- message(mess)
- else
- rpar=[plen;csiz;phi;xmin;xmax;ymin;ymax]
- model.rpar=rpar;
- graphics.exprs=exprs;
- x.graphics=graphics;x.model=model
- break
- end
- end
- case 'define' then
- plen=2; csiz=2; phi=0;
- xmin=-5;xmax=5;ymin=-5;ymax=5
- model=scicos_model()
- model.sim=list('anim_pen',5)
- model.in=[1;1]
- model.evtin=1
- model.dstate=0
- model.rpar=[plen;csiz;phi;xmin;xmax;ymin;ymax]
- model.blocktype='d'
- model.dep_ut=[%f %f]
- exprs=string(model.rpar)
- gr_i=['thick=xget(''thickness'');xset(''thickness'',2);';
- 'xx=orig(1)+sz(1)*[.4 .6 .6 .4 .4]'
- 'yy=orig(2)+sz(2)*[.2 .2 .4 .4 .2]'
- 'xpoly(xx,yy,''lines'')'
- 'xx=orig(1)+sz(1)*[.5 .6]'
- 'yy=orig(2)+sz(2)*[.4 .8]'
- 'xpoly(xx,yy)'
- 'xset(''thickness'',thick);']
- x=standard_define([3 3],model,exprs,gr_i)
- end
-endfunction
-
-
-
-function [blocks] = anim_pen(blocks,flag)
-//** 7 Jan 2009 : updated for Scilab 5.x
- win = 20000+curblock();
- if flag<>4 then
- H=scf(win)
- end
- xold = blocks.z
- rpar = blocks.rpar
- plen = rpar(1); csiz = rpar(2); phi = rpar(3);
- //** INIT
- if flag==4 then
- H = scf(win)
- clf(H)
- Axe = H.children
- Axe.data_bounds=rpar(4:7)
- Axe.isoview='on'
- S=[cos(phi),-sin(phi);sin(phi),cos(phi)]
- XY=S*[rpar(4),rpar(5);-csiz/2,-csiz/2]
- drawlater();
- xsegs(XY(1,:),XY(2,:))
- x=0; theta=0;
- x1=x-csiz/2;x2=x+csiz/2;y1=-csiz/2;y2=csiz/2
- XY=S*[x1 x2 x2 x1 x1;y1,y1,y2,y2,y1]
- xpoly(XY(1,:),XY(2,:),"lines",1)
- XY=S*[x,x+plen*sin(theta);0,0+plen*cos(theta)]
- xsegs(XY(1,:),XY(2,:));
- drawnow();
- //** UPDATE
- elseif flag==2 then
- Axe = H.children
- x = blocks.inptr(1)(1)
- theta = blocks.inptr(2)(1)
- drawlater();
- XY=Axe.children(2).data' + [cos(phi)*(x-xold);sin(phi)*(x-xold)]*ones(1,5);
- Axe.children(2).data=XY' ;
- x1=x*cos(phi);y1=x*sin(phi) ;
- XY=[x1,x1+plen*sin(theta);y1,y1+plen*cos(theta)] ;
- Axe.children(1).data=XY' ;
- blocks.z = x ;
- drawnow();
- end
-endfunction
-
-load(fullfile(SCI,'modules','scicos','tests','unit_tests','pendulum_anim45.cos'))
-M=10;
-m=3;
-l=3;
-ph=0.1;
-scs_m = scs_m.objs(5).model.rpar;
-[X,U,Y,XP] = steadycos(scs_m,[],[],[],[],1,1:$);
-
- Compile and link Scicos C BLOCK code
- Generate a loader file
- Generate a Makefile
- Running the Makefile
- Compilation of inv_pend.c
- Building shared library (be patient)
-Shared archive loaded.
-Link done.