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 // =============================================================================
8 // <-- ENGLISH IMPOSED -->
9 // <-- JVM NOT MANDATORY -->
10 // Here with give a complete example on adding new primitive to Scilab
11 // Note that is a unitary test but it could have been a non reg test of bug
12 // 3488 but it is not because there was no fix to make it work.
13 //creating the interface file
14 // Checks on windows that we have a Fortran 90 compiler (Intel)
15 if haveacompiler() then
16 if ( (getos() == 'Windows' & findmsifortcompiler() <> 'unknown') | (getos() <> 'Windows') ) then
18 sourcecode=['subroutine incrdoublef90(x,y)'
20 ' double precision, intent(in) :: x'
21 ' double precision, intent(out) :: y'
23 'end subroutine incrdoublef90'];
25 mputl(sourcecode,'incrdoublef90.f90');
26 libpath=ilib_for_link('incrdoublef90','incrdoublef90.f90',[],'f');
28 m = call("incrdoublef90",n,1,"d","out",[1,1],2,"d");
29 if abs(m-2.)>%eps then bugmes();quit;end
31 m = call("incrdoublef90",n,1,"d","out",[1,1],2,"d");
32 if abs(m-3.)>%eps then bugmes();quit;end