double x[]={1,0,0} ; int mx=3,nx=1;
double time[]={0.4,4}; int mt=1,nt=2;
fprintf(stdout,"linking \n");
- SendScilabJob("ilib_for_link('odeex','my_ode.o',[],'c');");
+ SendScilabJob("ilib_for_link('odeex','my_ode.c',[],'c');");
fprintf(stdout,"link done \n");
SendScilabJob("exec('loader.sce');link('show')");
WriteMatrix("x", &mx, &nx, x);
path = pwd();
chdir(TMPDIR);
mputl(foo,'foo.c');
- ilib_for_link(['foo'],'foo.o',[],"c");
+ ilib_for_link(['foo'],'foo.c',[],"c");
exec loader.sce
chdir(path)
end
<title>Examples</title>
<programlisting role="example"><![CDATA[
// Recommended usage
-tbx_build_gateway('mytoolbox', ['c_sum','sci_csum';'c_sub','sci_csub'], ['sci_csum.o','sci_csub.o'], ..
+tbx_build_gateway('mytoolbox', ['c_sum','sci_csum';'c_sub','sci_csub'], ['sci_csum.c','sci_csub.c'], ..
get_absolute_file_path('builder_gateway_c.sce'), ..
['../../src/c/libcsum']);
]]></programlisting>
<title>Examples</title>
<programlisting role="example"><![CDATA[
// Recommended usage
-tbx_build_src(['csum','csub'], ['csum.o','csub.o'], 'c', ..
+tbx_build_src(['csum','csub'], ['csum.c','csub.c'], 'c', ..
get_absolute_file_path('builder_c.sce'));
]]></programlisting>
</refsection>
fcode=mgetl(SCI+'/modules/others/demos/simulation/npend/Maple/ener.f');mputl(fcode,'ener.f')
fcode=mgetl(SCI+'/modules/others/demos/simulation/npend/Maple/np.f');mputl(fcode,'np.f')
fcode=mgetl(SCI+'/modules/others/demos/simulation/npend/Maple/npend.f');mputl(fcode,'npend.f')
- files = ['npend.o','np.o','ener.o','dlslv.o' ];
+ files = ['npend.f','np.f','ener.f','dlslv.f' ];
ilib_for_link(['npend';'np';'ener'],files,[],"f");
exec loader.sce
chdir(cdpath)
fcode = mgetl(path+'ener.f');mputl(fcode,'ener.f');
fcode = mgetl(path+'np.f');mputl(fcode,'np.f');
fcode = mgetl(path+'npend.f');mputl(fcode,'npend.f');
- files = ['npend.o','np.o','ener.o','dlslv.o' ];
+ files = ['npend.f','np.f','ener.f','dlslv.f' ];
ilib_for_link(['npend';'np';'ener'],files,[],"f");
exec loader.sce
chdir(cdpath);
'{ groot[0] = y[0];}']
mputl(code,TMPDIR+'/t22.c')
//-2- compile and load them
-ilib_for_link(['res22' 'jac22' 'gr22'],'t22.o',[],'c',TMPDIR+'/Makefile',TMPDIR+'/t22loader.sce');
+ilib_for_link(['res22' 'jac22' 'gr22'],'t22.c',[],'c',TMPDIR+'/Makefile',TMPDIR+'/t22loader.sce');
exec(TMPDIR+'/t22loader.sce')
//-3- run
rtol=[1.d-6;1.d-6];atol=[1.d-6;1.d-4];
mputl([rescode;jaccode],TMPDIR+'/mycode.c') //create the C file
// - compile it
-ilib_for_link(['chemres','chemjac'],'mycode.o',[],'c',TMPDIR+'/Makefile',TMPDIR+'/loader.sce');//compile
+ilib_for_link(['chemres','chemjac'],'mycode.c',[],'c',TMPDIR+'/Makefile',TMPDIR+'/loader.sce');//compile
// - link it with Scilab
exec(TMPDIR+'/loader.sce') //incremental linking
mputl(F,TMPDIR+'/ffun.f')
// compile the fortran code
-l=ilib_for_link('ffun','ffun.o',[],'f',TMPDIR+'/Makefile');
+l=ilib_for_link('ffun','ffun.f',[],'f',TMPDIR+'/Makefile');
// incremental linking
link(l,'ffun','f')
mputl(C,TMPDIR+'/cfun.c')
// compile the C code
-l=ilib_for_link('cfun','cfun.o',[],'c',TMPDIR+'/Makefile');
+l=ilib_for_link('cfun','cfun.f',[],'c',TMPDIR+'/Makefile');
// incremental linking
link(l,'cfun','c')
' ydot[0]=y[0]*y[0]-y[0]*sin(*t)+cos(*t);'
'}']
mputl(ccode,TMPDIR+'/myode.c') //create the C file
-ilib_for_link('myode','myode.o',[],'c',TMPDIR+'/Makefile',TMPDIR+'/loader.sce');//compile
+ilib_for_link('myode','myode.c',[],'c',TMPDIR+'/Makefile',TMPDIR+'/loader.sce');//compile
exec(TMPDIR+'/loader.sce') //incremental linking
y0=0;t0=0;t=0:0.1:%pi;
y=ode(y0,t0,t,'myode');
mputl(F,TMPDIR+'/ffun.f')
// compilation du code Fortran
-l=ilib_for_link('ffun','ffun.o',[],'f',TMPDIR+'/Makefile');
+l=ilib_for_link('ffun','ffun.f',[],'f',TMPDIR+'/Makefile');
// link incrémental
link(l,'ffun','f')
mputl(C,TMPDIR+'/cfun.c')
// compilation du code C
-l=ilib_for_link('cfun','cfun.o',[],'c',TMPDIR+'/Makefile');
+l=ilib_for_link('cfun','cfun.f',[],'c',TMPDIR+'/Makefile');
// incremental linking
link(l,'cfun','c')
' ydot[0]=y[0]*y[0]-y[0]*sin(*t)+cos(*t);'
'}']
mputl(ccode,TMPDIR+'/myode.c') //create the C file
-ilib_for_link('myode','myode.o',[],'c',TMPDIR+'/Makefile',TMPDIR+'/loader.sce');//compile
+ilib_for_link('myode','myode.c',[],'c',TMPDIR+'/Makefile',TMPDIR+'/loader.sce');//compile
exec(TMPDIR+'/loader.sce') //incremental linking
y0=0;t0=0;t=0:0.1:%pi;
y=ode(y0,t0,t,'myode');
mputl(code,TMPDIR+'/t22.c')
//-2- compilando e carregando
-ilib_for_link(['res22' 'jac22' 'gr22'],'t22.o',[],'c',TMPDIR+'/Makefile',TMPDIR+'/t22loader.sce');
+ilib_for_link(['res22' 'jac22' 'gr22'],'t22.c',[],'c',TMPDIR+'/Makefile',TMPDIR+'/t22loader.sce');
exec(TMPDIR+'/t22loader.sce')
//-3- executando
mputl([rescode;jaccode],TMPDIR+'/mycode.c') //create the C file
// - compilando-o
-ilib_for_link(['chemres','chemjac'],'mycode.o',[],'c',TMPDIR+'/Makefile',TMPDIR+'/loader.sce');//compilando
+ilib_for_link(['chemres','chemjac'],'mycode.c',[],'c',TMPDIR+'/Makefile',TMPDIR+'/loader.sce');//compilando
// - ligando-o com o Scilab
exec(TMPDIR+'/loader.sce') //linking incremental
feval(1:10,'parab')
// Para link dinâmico (ver exemplo ftest em ffeval.f)
// você pode usar o comando link (os parâmetros dependem da máquina):
-// unix('make ftest.o');link('ftest.o','ftest); feval(1:10,1:5,'ftest')
+// unix('make ftest.o');link('ftest.f','ftest); feval(1:10,1:5,'ftest')
]]></programlisting>
</refsection>
mputl(F,TMPDIR+'/ffun.f')
// compile o código FORTRAN
-l=ilib_for_link('ffun','ffun.o',[],'f',TMPDIR+'/Makefile');
+l=ilib_for_link('ffun','ffun.f',[],'f',TMPDIR+'/Makefile');
// linking incremental
link(l,'ffun','f')
mputl(C,TMPDIR+'/cfun.c')
// compile o código C
-l=ilib_for_link('cfun','cfun.o',[],'c',TMPDIR+'/Makefile');
+l=ilib_for_link('cfun','cfun.c',[],'c',TMPDIR+'/Makefile');
// linking incremental
link(l,'cfun','c')
' ydot[0]=y[0]*y[0]-y[0]*sin(*t)+cos(*t);'
'}']
mputl(ccode,TMPDIR+'/myode.c') //criando o arquivo C
-ilib_for_link('myode','myode.o',[],'c',TMPDIR+'/Makefile',TMPDIR+'/loader.sce');//compilando
+ilib_for_link('myode','myode.c',[],'c',TMPDIR+'/Makefile',TMPDIR+'/loader.sce');//compilando
exec(TMPDIR+'/loader.sce') //linking incremental
y0=0;t0=0;t=0:0.1:%pi;
y=ode(y0,t0,t,'myode');
//criando a biblioteca compartilhada (um gateway (ligação), um Makefile e um loader (carregador) são
//gerados.)
-ilib_for_link('fooc','fooc.o',[],"c")
+ilib_for_link('fooc','fooc.c',[],"c")
// carregando a biblioteca compartilhada
//criando a biblioteca compartilhada (um gateway, um Makefile e um loader são
//gerados.)
-ilib_for_link('foof','foof.o',[],"f")
+ilib_for_link('foof','foof.f',[],"f")
// carrega a biblioteca compartilhada
TEST_DIR = OS_TMP_DIR + filesep() + 'bug_2085';
copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug_2085.c' , TEST_DIR + filesep() + 'bug_2085.c');
chdir(TEST_DIR);
-files=['bug_2085.o'];
+files=['bug_2085.c'];
ilib_build('bug',['ex2c_1','intex2c'],files,[]);
Generate a gateway file
Generate a loader file
chdir(TEST_DIR);
-files=['bug_2085.o'];
+files=['bug_2085.c'];
ilib_build('bug',['ex2c_1','intex2c'],files,[]);
// load the shared library
TEST_DIR = OS_TMP_DIR + filesep() + 'bug_2085';
copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug_2085.c' , TEST_DIR + filesep() + 'bug_2085.c');
chdir(TEST_DIR);
-files=['bug_2085.o'];
+files=['bug_2085.c'];
ilib_build('bug',['ex2c_1','intex2c'],files,[]);
Generate a gateway file
Generate a loader file
TEST_DIR = OS_TMP_DIR + filesep() + 'bug_2085';
copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug_2085.c' , TEST_DIR + filesep() + 'bug_2085.c');
chdir(TEST_DIR);
-files=['bug_2085.o'];
+files=['bug_2085.c'];
ilib_build('bug',['ex2c_1','intex2c'],files,[]);
Generate a gateway file
Generate a loader file
endfunction
chdir(TMPDIR);
-libn=ilib_for_link('dgesvtst','dgesvtst.o',[],'f');
+libn=ilib_for_link('dgesvtst','dgesvtst.f',[],'f');
exec loader.sce;
chdir(curdir),
n=44;
[1,1],8, "i");
endfunction
chdir(TMPDIR);
-libn=ilib_for_link('dgesvtst','dgesvtst.o',[],'f');
+libn=ilib_for_link('dgesvtst','dgesvtst.f',[],'f');
Generate a loader file
Generate a Makefile
ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
[1,1],8, "i");
endfunction
chdir(TMPDIR);
-libn=ilib_for_link('dgesvtst','dgesvtst.o',[],'f');
+libn=ilib_for_link('dgesvtst','dgesvtst.f',[],'f');
Generate a loader file
Generate a Makefile
Running the Makefile
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'];
+files=['bug_3191.c'];
ilib_build('libc_fun',['c_fun','c_intfun'],files,[]);
// load the shared library
exec loader.sce;
chdir(TEST_DIR);
-files=['bug_3191.o'];
+files=['bug_3191.c'];
ilib_build('libc_fun',['c_fun','c_intfun'],files,[]);
// load the shared library
src_file = SCI+filesep()+'modules'+filesep()+'dynamic_link'+filesep()+'tests'+filesep()+'unit_tests'+filesep()+'addinter.c';
dst_file = TMPDIR + filesep() + 'addinter' + filesep() + 'addinter.c';
copyfile(src_file, dst_file);
- files=['addinter.o'];
+ files=['addinter.c'];
ilib_build('libintertest',['scifun1','intfun1'],files,[]);
// load the shared library
exec loader.sce ;
dst_file = TMPDIR + filesep() + 'addinter' + filesep() + 'addinter.c';
copyfile(src_file, dst_file);
- files=['addinter.o'];
+ files=['addinter.c'];
ilib_build('libintertest',['scifun1','intfun1'],files,[]);
// load the shared library
table = [scilab_functionA,c_functionA; ..
scilab_functionB,c_functionB];
- c_file = 'addinter' + string(i) + '.o';
+ c_file = 'addinter' + string(i) + '.c';
interf_name = 'interftest_' + string(i);
DIR_NAME_ADDINTER = TMPDIR + filesep() + 'addinter_dir_' + string(i);
curPath = pwd();
chdir(TMPDIR);
mputl(foo,'foo.c');
- ilib_for_link(['foo'],'foo.o',[],"c");
+ ilib_for_link(['foo'],'foo.c',[],"c");
// load the shared library
exec loader.sce ;
chdir(curPath) ;
chdir(TMPDIR);
mputl(foo,'foo.c');
- ilib_for_link(['foo'],'foo.o',[],"c");
+ ilib_for_link(['foo'],'foo.c',[],"c");
// load the shared library
exec loader.sce ;
//generated.
cur_dir = pwd();
chdir(TMP_DIR);
-files=['fun1.o','fun2.o','intfun1.o'];
+files=['fun1.c','fun2.c','intfun1.c'];
ilib_build('foo',['scifun1','intfun1'],files,[]);
Generate a gateway file
Generate a loader file
cur_dir = pwd();
chdir(TMP_DIR);
-files=['fun1.o','fun2.o','intfun1.o'];
+files=['fun1.c','fun2.c','intfun1.c'];
ilib_build('foo',['scifun1','intfun1'],files,[]);
// load the shared library
//generated.
cur_dir = pwd();
chdir(TMP_DIR);
-files=['fun1.o','fun2.o','intfun1.o'];
+files=['fun1.c','fun2.c','intfun1.c'];
ilib_build('foo',['scifun1','intfun1'],files,[]);
Generate a gateway file
Generate a loader file
//generated.
cur_dir = pwd();
chdir(TMP_DIR);
-files=['fun1.o','fun2.o','intfun1.o'];
+files=['fun1.c','fun2.c','intfun1.c'];
ilib_build('foo',['scifun1','intfun1'],files,[]);
Generate a gateway file
Generate a loader file
//generated.
cur_dir = pwd();
chdir(TMP_DIR);
-ilib_for_link('ext1c','fun1.o',[],"c")
+ilib_for_link('ext1c','fun1.c',[],"c")
Generate a loader file
Generate a Makefile
ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
chdir(TMP_DIR);
-ilib_for_link('ext1c','fun1.o',[],"c")
+ilib_for_link('ext1c','fun1.c',[],"c")
// load the shared library
exec loader.sce
//generated.
cur_dir = pwd();
chdir(TMP_DIR);
-ilib_for_link('ext1c','fun1.o',[],"c")
+ilib_for_link('ext1c','fun1.c',[],"c")
Generate a loader file
Generate a Makefile
ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
//generated.
cur_dir = pwd();
chdir(TMP_DIR);
-ilib_for_link('ext1c','fun1.o',[],"c")
+ilib_for_link('ext1c','fun1.c',[],"c")
Generate a loader file
Generate a Makefile
' y=x+1'
' end'];
mputl(sourcecode,'incrdoublef77.f');
-libpath=ilib_for_link('incrdoublef77','incrdoublef77.o',[],'f','Makefile');
+libpath=ilib_for_link('incrdoublef77','incrdoublef77.f',[],'f','Makefile');
exec loader.sce;
n = 1;
m = call("incrdoublef77",n,1,"d","out",[1,1],2,"d");
' y=x+1'
' end'];
mputl(sourcecode,'incrdoublef77.f');
-libpath=ilib_for_link('incrdoublef77','incrdoublef77.o',[],'f','Makefile');
+libpath=ilib_for_link('incrdoublef77','incrdoublef77.f',[],'f','Makefile');
exec loader.sce;
n = 1;
m = call("incrdoublef77",n,1,"d","out",[1,1],2,"d");
' c[i] = sin(a[i]) + *b; '
'}'];
mputl(f1,'fooc.c');
- ilib_for_link('fooc','fooc.o',[],"c");
+ ilib_for_link('fooc','fooc.c',[],"c");
exec loader.sce;
ulink();
cd(TMPDIR);
'}'];
mputl(f1,'fooc.c');
- ilib_for_link('fooc','fooc.o',[],"c");
+ ilib_for_link('fooc','fooc.c',[],"c");
exec loader.sce;
ulink();
cd(TMPDIR);
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");
+ilib_for_link(routines,'externals.f',[],"f");
// load the shared library
exec loader.sce ;
//===========================================================
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");
+ilib_for_link(routines,'externals.f',[],"f");
// load the shared library
exec loader.sce ;
chdir(TMPDIR);
mputl(code, TMPDIR+'/foo.c');
//creating Makefile
-ilib_for_link('foo','foo.o',[],'c');
+ilib_for_link('foo','foo.c',[],'c');
exec('loader.sce');
chdir(current_dir);
//add menu
//build and link
-lp=ilib_for_link('mytest','mytest.o',[],'c',TMPDIR+'/Makefile');
+lp=ilib_for_link('mytest','mytest.c',[],'c',TMPDIR+'/Makefile');
link(lp,'mytest','c');
//run it
mputl(' '+ftn,TMPDIR+'/mytestf.f')
//build and link
-lp=ilib_for_link('mytestf','mytestf.o',[],'F',TMPDIR+'/Makefile');
+lp=ilib_for_link('mytestf','mytestf.f',[],'F',TMPDIR+'/Makefile');
link(lp,'mytestf','f');
//run it
//construindo e ligando
-lp=ilib_for_link('mytest','mytest.o',[],'c',TMPDIR+'/Makefile');
+lp=ilib_for_link('mytest','mytest.c',[],'c',TMPDIR+'/Makefile');
link(lp,'mytest','c');
//executando
mputl(' '+ftn,TMPDIR+'/mytestf.f')
//construíndo e ligando
-lp=ilib_for_link('mytestf','mytestf.o',[],'F',TMPDIR+'/Makefile');
+lp=ilib_for_link('mytestf','mytestf.f',[],'F',TMPDIR+'/Makefile');
link(lp,'mytestf','f');
//executando
+++ /dev/null
-
-// example 1
-
-x=1
- x =
-
- 1.
-
-
-link('foof1.o','foof1');
-shared archive loaded
-Link done
-
-
-out=foof1(x)
- out =
-
- 8.7811181
-
-
-link('fooc1.o','fooc1','c');
-shared archive loaded
-Link done
-
-
-out=fooc1(x)
- out =
-
- 8.7811181
-
-
-
-out=foos1(x)
- out =
-
- 8.7811181
-
-
-// example 2
-
-
-link('foof2.o','foof2');
-shared archive loaded
-Link done
-
-
-out=foof2()
- out =
-
-! - 85. - 55. - 37. - 35. 97. 50. 79. 56. 49. 63. !
-! 57. - 59. 45. - 8. - 93. 92. 43. - 62. 77. 66. !
-! 54. - 5. 99. - 61. - 50. - 12. - 18. 31. - 26. - 62. !
-! 1. - 47. - 91. - 47. - 61. 41. - 58. - 90. 53. - 1. !
-! 94. 83. - 86. 23. - 84. 19. - 50. 88. - 53. 85. !
-
-
-link('fooc2.o','fooc2','c');
-shared archive loaded
-Link done
-
-
-out=fooc2()
- out =
-
-! - 85. - 55. - 37. - 35. 97. 50. 79. 56. 49. 63. !
-! 57. - 59. 45. - 8. - 93. 92. 43. - 62. 77. 66. !
-! 54. - 5. 99. - 61. - 50. - 12. - 18. 31. - 26. - 62. !
-! 1. - 47. - 91. - 47. - 61. 41. - 58. - 90. 53. - 1. !
-! 94. 83. - 86. 23. - 84. 19. - 50. 88. - 53. 85. !
-
-
-
-out=foos2()
- out =
-
-! - 85. - 55. - 37. - 35. 97. 50. 79. 56. 49. 63. !
-! 57. - 59. 45. - 8. - 93. 92. 43. - 62. 77. 66. !
-! 54. - 5. 99. - 61. - 50. - 12. - 18. 31. - 26. - 62. !
-! 1. - 47. - 91. - 47. - 61. 41. - 58. - 90. 53. - 1. !
-! 94. 83. - 86. 23. - 84. 19. - 50. 88. - 53. 85. !
-
-
-// example 3
-
-x=2
- x =
-
- 2.
-
-
-link('fooc3.o','fooc3','c');
-shared archive loaded
-Link done
-
-
-out=fooc3(x)
- out =
-
-! 1.4142136 !
-! - 0.1411200 !
-
-
-link('foof3.o','foof3');
-shared archive loaded
-Link done
-
-
-out=foof3(x)
- out =
-
-! 1.4142136 !
-! - 0.1411200 !
-
-
-
-out=foos3(x)
- out =
-
-! 1.4142136 !
-! - 0.1411200 !
-
-
-// example 4
-
-x=1
- x =
-
- 1.
-
-y=2
- y =
-
- 2.
-
-
-link('foof4.o','foof4');
-shared archive loaded
-Link done
-
-
-out=foof4(x,y)
- out =
-
-! 1. 2. !
-
-
-link('fooc4.o','fooc4','c');
-shared archive loaded
-Link done
-
-
-out=fooc4(x,y)
- out =
-
-! 1. 2. !
-
-
-
-out=foos4(x,y)
- out =
-
-! 1. 2. !
-
-
-// example 5
-
-k=2
- k =
-
- 2.
-
-x=[1,2,3]
- x =
-
-! 1. 2. 3. !
-
-
-link('foof5.o','foof5');
-shared archive loaded
-Link done
-
-
-out=foof5(k,x)
- out =
-
-! 2. 1. !
-! - 0.1411200 3. !
-
-
-link('fooc5.o','fooc5','c');
-shared archive loaded
-Link done
-
-
-out=fooc5(k,x)
- out =
-
-! 2. 1. !
-! - 0.1411200 3. !
-
-
-
-out=foos5(k,x)
- out =
-
-! 2. 1. !
-! - 0.1411200 3. !
-
-
-// example 6
-
-k=2
- k =
-
- 2.
-
-x=[1,2,3;4,5,6]
- x =
-
-! 1. 2. 3. !
-! 4. 5. 6. !
-
-
-link('foof6.o','foof6');
-shared archive loaded
-Link done
-
-
-out=foof6(k,x)
- out =
-
-! 6. 12. !
-! 20. 1. !
-! 6. 3. !
-
-
-link('fooc6.o','fooc6','c');
-shared archive loaded
-Link done
-
-
-out=fooc6(k,x)
- out =
-
-! 6. 12. !
-! 20. 1. !
-! 6. 3. !
-
-
-
-out=foos6(k,x)
- out =
-
-! 6. 12. !
-! 20. 1. !
-! 6. 3. !
-
-
-// example 7
-
-k=2
- k =
-
- 2.
-
-x=[1,2,3;4,5,6]
- x =
-
-! 1. 2. 3. !
-! 4. 5. 6. !
-
-
-link('foof7.o','foof7');
-shared archive loaded
-Link done
-
-
-out=foof7(k,x)
- out =
-
-( 20, 20) sparse matrix
-
-( 1, 1) 6.
-( 2, 4) 12.
-( 15, 6) - 4.
-
-
-link('fooc7.o','fooc7','c');
-shared archive loaded
-Link done
-
-
-out=fooc7(k,x)
- out =
-
-( 20, 20) sparse matrix
-
-( 1, 1) 6.
-( 2, 4) 12.
-( 15, 6) - 4.
-
-
-
-out=foos7(k,x)
- out =
-
-( 20, 20) sparse matrix
-
-( 1, 1) 6.
-( 2, 4) 12.
-( 15, 6) - 4.
-
-
-// example 8
-
-
-link('foof8.o','foof8');
-shared archive loaded
-Link done
-
-
-out=foof8()
- out =
-
-! 49. 78. 17. 72. - 99. - 85. - 86. 30. 80. 72. !
-! 66. - 29. - 91. - 53. - 19. - 47. 68. - 72. - 87. 79. !
-! 43. - 66. - 53. - 61. - 23. - 37. 31. - 34. - 42. 88. !
-! - 76. - 65. 25. 28. - 61. - 60. 9. 29. - 66. - 32. !
-! 78. 39. 94. 68. - 17. - 98. - 36. 40. 22. 5. !
-
-
-link('fooc8.o','fooc8','c');
-shared archive loaded
-Link done
-
-
-out=fooc8()
- out =
-
-! - 88. - 43. - 73. 25. 4. - 59. 62. - 55. 25. 9. !
-! 40. 61. 40. - 78. 62. 11. 88. 1. 30. 81. !
-! - 5. - 28. 4. - 11. 10. 57. - 82. - 48. - 11. 38. !
-! - 7. 58. - 94. - 68. 14. - 35. - 14. - 9. - 51. - 73. !
-! - 73. - 91. 1. 5. - 86. 43. - 4. - 50. 50. 67. !
-
-
-
-out=foos8()
- out =
-
-! - 39. 8. - 49. 11. 93. - 14. - 99. - 67. 68. 45. !
-! 76. 6. 72. - 28. - 61. - 59. 6. - 87. 72. - 46. !
-! - 68. - 42. - 47. - 32. 37. - 93. - 58. - 90. - 53. - 69. !
-! - 84. 46. 59. - 56. - 83. - 91. 92. - 93. 91. - 54. !
-! 10. - 77. - 63. - 90. 61. - 3. - 82. 16. - 40. 21. !
-
-
-// example 9
-
-
-
-out=foos9(1,1,1)
- out =
-
-! 379.456 !
-! 12601. !
-
// example 1
x=1
-link('foof1.o','foof1');
+link('foof1'+getdynlibext(),'foof1');
exec('foof1.sci');
out=foof1(x)
-link('fooc1.o','fooc1','c');
+link('fooc1'+getdynlibext(),'fooc1','c');
exec('fooc1.sci');
out=fooc1(x)
// example 2
-link('foof2.o','foof2');
+link('foof2'+getdynlibext(),'foof2');
exec('foof2.sci');
out=foof2()
-link('fooc2.o','fooc2','c');
+link('fooc2'+getdynlibext(),'fooc2','c');
exec('fooc2.sci');
out=fooc2()
// example 3
x=2
-link('fooc3.o','fooc3','c');
+link('fooc3'+getdynlibext(),'fooc3','c');
exec('fooc3.sci');
out=fooc3(x)
-link('foof3.o','foof3');
+link('foof3'+getdynlibext(),'foof3');
exec('foof3.sci');
out=foof3(x)
x=1
y=2
-link('foof4.o','foof4');
+link('foof4'+getdynlibext(),'foof4');
exec('foof4.sci');
out=foof4(x,y)
-link('fooc4.o','fooc4','c');
+link('fooc4'+getdynlibext(),'fooc4','c');
exec('fooc4.sci');
out=fooc4(x,y)
k=2
x=[1,2,3]
-link('foof5.o','foof5');
+link('foof5'+getdynlibext(),'foof5');
exec('foof5.sci');
out=foof5(k,x)
-link('fooc5.o','fooc5','c');
+link('fooc5'+getdynlibext(),'fooc5','c');
exec('fooc5.sci');
out=fooc5(k,x)
k=2
x=[1,2,3;4,5,6]
-link('foof6.o','foof6');
+link('foof6'+getdynlibext(),'foof6');
exec('foof6.sci');
out=foof6(k,x)
-link('fooc6.o','fooc6','c');
+link('fooc6'+getdynlibext(),'fooc6','c');
exec('fooc6.sci');
out=fooc6(k,x)
k=2
x=[1,2,3;4,5,6]
-link('foof7.o','foof7');
+link('foof7'+getdynlibext(),'foof7');
exec('foof7.sci');
out=foof7(k,x)
-link('fooc7.o','fooc7','c');
+link('fooc7'+getdynlibext(),'fooc7','c');
exec('fooc7.sci');
out=fooc7(k,x)
// example 8
-link('foof8.o','foof8');
+link('foof8'+getdynlibext(),'foof8');
exec('foof8.sci');
out=foof8()
-link('fooc8.o','fooc8','c');
+link('fooc8'+getdynlibext(),'fooc8','c');
exec('fooc8.sci');
out=fooc8()
mputl(C,TMPDIR+'/rosenc.c')
// compile the C code
-l=ilib_for_link('rosenc','rosenc.o',[],'c',TMPDIR+'/Makefile');
+l=ilib_for_link('rosenc','rosenc.c',[],'c',TMPDIR+'/Makefile');
// incremental linking
link(l,'rosenc','c')
mputl(F,TMPDIR+'/rosenf.f')
// compile the Fortran code
-l=ilib_for_link('rosenf','rosenf.o',[],'f',TMPDIR+'/Makefile');
+l=ilib_for_link('rosenf','rosenf.f',[],'f',TMPDIR+'/Makefile');
// incremental linking
link(l,'rosenf','f')
mputl(fortransource,TMPDIR+'/rosenf.f')
// compile the C code
-libpath=ilib_for_link('rosenf','rosenf.o',[],'f',TMPDIR+'/Makefile');
+libpath=ilib_for_link('rosenf','rosenf.f',[],'f',TMPDIR+'/Makefile');
// incremental linking
linkid=link(libpath,'rosenf','f');