NAME

Module::Build::FFI::Fortran::ExtUtilsF77 - Simple interface to F77 libs

DESCRIPTION

This is a fork of ExtUtils::F77 with necessary changes needed for FFI::Platypus and FFI::Platypus::Lang::Fortran. The rest of this documentation is from the original, with the class names updated to reflect the fork.

This module tries to figure out how to link C programs with Fortran subroutines on your system. Basically one must add a list of Fortran runtime libraries. The problem is their location and name varies with each OS/compiler combination!

This module tries to implement a simple 'rule-of-thumb' database for various flavours of UNIX systems. A simple self-documenting Perl database of knowledge/code for figuring out how to link for various combinations of OS and compiler is embedded in the modules Perl code. Please help save the world by sending database entries for your system to karl_pgplot@mac.com

Note the default on most systems is now to search for a generic 'GNU' compiler which can be g77, gfortran or g95 and then find the appropriate link libraries automatically. (This is the 'Generic' 'GNU' database entry in the code.)

The library list which the module returns can be explicitly overridden by setting the environment variable F77LIBS, e.g.

  % setenv F77LIBS "-lfoo -lbar"
  % perl Makefile.PL
  ...

SYNOPSIS

  use Module::Build::FFI::Fortran::ExtUtilsF77;               # Automatic guess 
  use Module::Build::FFI::Fortran::ExtUtilsF77 qw(sunos);     # Specify system
  use Module::Build::FFI::Fortran::ExtUtilsF77 qw(linux g77); # Specify system and compiler
  $fortranlibs = Module::Build::FFI::Fortran::ExtUtilsF77->runtime;

METHODS

The following methods are provided:

  • runtime

    Returns a list of F77 runtime libraries.

      $fortranlibs = Module::Build::FFI::Fortran::ExtUtilsF77->runtime;
  • runtimeok

    Returns TRUE only if runtime libraries have been found successfully.

  • trail_

    Returns true if F77 names have trailing underscores.

  • compiler

    Returns command to execute the compiler (e.g. 'f77').

  • cflags

    Returns compiler flags.

  • testcompiler

    Test to see if compiler actually works.

More methods will probably be added in the future.

AUTHOR

Karl Glazebrook (karlglazebrook@mac.com).

COPYRIGHT AND LICENSE

  Copyright (c) 2001 by Karl Glazebrook. All rights reserved.  This distribution 
  is free software; you can redistribute it and/or modify it under the same 
  terms as Perl itself.

  THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS
  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  POSSIBILITY OF SUCH DAMAGE.

  BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
  FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
  OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
  PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
  EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS
  WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
  ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
  REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
  DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
  DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM
  (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
  INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
  THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER
  OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.