- or download this
real function evapol(tu,nu,tv,nv,c,rad,x,y)
- or download this
c rad : real function subprogram, defining the boundary of the
c approximation domain. must be declared external in the
c calling (sub)-program
- or download this
double precision function myfunc(x, y, func)
double precision x, y, z, v
...
z = func(v)
myfunc = x * y * z
end
- or download this
$ g77 -c myfunc.f -o myfunc.o
- or download this
$ h2xs -Afn P2f2p
- or download this
#include "EXTERN.h"
#include "perl.h"
...
#include "ppport.h"
MODULE = P2f2p PACKAGE = P2f2p
- or download this
#include "EXTERN.h"
#include "perl.h"
...
RETVAL = myfunc(x, y);
OUTPUT:
RETVAL
- or download this
LIBS => [''], # e.g., '-lm'
OBJECT => '$(O_FILES)', # link all the C files too
- or download this
LIBS => ['-lg2c -lm'], # e.g., '-lm'
OBJECT => '$(O_FILES) myfunc.o', # link all the C files
+ too
- or download this
perl Makefile.PL
make
make test
- or download this
$ mkdir -p /path/to/working/directory/auto/P2f2p
$ cp blib/arch/auto/P2f2p/P2f2p.so /path/to/working/directory/auto/P2f
+2p/
$ cp blib/lib/P2f2p.pm /path/to/working/directory/
- or download this
#!/usr/bin/perl
...
my $r = P2f2p::myfunc(3, 7, \&userfunc );
printf "myfunc() returned: %.2f\n", $r;
- or download this
userfunc()
called from Fortran with arg: 1.5
returning: 2
myfunc() returned: 42.00