Help for this page

Select Code to Download


  1. or download this
    real function evapol(tu,nu,tv,nv,c,rad,x,y)
    
  2. 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
    
  3. or download this
            double precision function myfunc(x, y, func)
            double precision x, y, z, v
    ...
            z = func(v)
            myfunc = x * y * z
            end
    
  4. or download this
    $ g77 -c myfunc.f -o myfunc.o
    
  5. or download this
    $ h2xs -Afn P2f2p
    
  6. or download this
    #include "EXTERN.h"
    #include "perl.h"
    ...
    #include "ppport.h"
    
    MODULE = P2f2p          PACKAGE = P2f2p
    
  7. or download this
    #include "EXTERN.h"
    #include "perl.h"
    ...
            RETVAL = myfunc(x, y);
        OUTPUT:
            RETVAL
    
  8. or download this
        LIBS              => [''], # e.g., '-lm'
        OBJECT            => '$(O_FILES)', # link all the C files too
    
  9. or download this
        LIBS              => ['-lg2c -lm'], # e.g., '-lm'
        OBJECT            => '$(O_FILES) myfunc.o', # link all the C files
    + too
    
  10. or download this
        perl Makefile.PL
        make
        make test
    
  11. 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/
    
  12. or download this
    #!/usr/bin/perl
    
    ...
    my $r = P2f2p::myfunc(3, 7, \&userfunc );
    
    printf "myfunc() returned: %.2f\n", $r;
    
  13. or download this
    userfunc()
      called from Fortran with arg: 1.5
      returning: 2
    myfunc() returned: 42.00