1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2009 - DIGITEO - Sylvestre LEDRU
4 // Copyright (C) 2009 - DIGITEO - Michael BAUDIN
6 // This file is distributed under the same license as the Scilab package.
7 // =============================================================================
9 // <-- ENGLISH IMPOSED -->
10 // <-- JVM NOT MANDATORY -->
12 // Here with give a complete example on adding new primitive to Scilab
13 // Note that is a unitary test but it could have been a non reg test of bug
14 // 3488 but it is not because there was no fix to make it work.
15 //creating the interface file
17 // Checks on windows that we have a Fortran 90 compiler (Intel)
19 if haveacompiler() then
20 if ( (getos() == 'Windows' & findmsifortcompiler() <> 'unknown') | (getos() <> 'Windows') ) then
22 sourcecode=['subroutine incrdoublef90(x,y)'
24 ' double precision, intent(in) :: x'
25 ' double precision, intent(out) :: y'
27 'end subroutine incrdoublef90'];
29 mputl(sourcecode,'incrdoublef90.f90');
30 libpath=ilib_for_link('incrdoublef90','incrdoublef90.f90',[],'f');
33 m = call("incrdoublef90",n,1,"d","out",[1,1],2,"d");
34 if abs(m-2.)>%eps then pause,end
36 m = call("incrdoublef90",n,1,"d","out",[1,1],2,"d");
37 if abs(m-3.)>%eps then pause,end