F77(3pm)

πŸ“¦
version 1.26 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ F77 β€” ExtUtils::F77 πŸ’…

okay bestie, gather round, because this is the User Contributed Perl Documentation page for ExtUtils::F77, and it's literally the little module that figures out how to glue your C code to Fortran 🧚


🌸 NAME 🌸

ExtUtils::F77 β€” a simple interface to F77 libs. no cap, that's the whole job description.


πŸ’– DESCRIPTION πŸ’–

so here's the vibe: this module is out here trying to figure out how to link C programs with Fortran subroutines on your system 🫢 Basically you gotta add a whole list of Fortran runtime libraries. the problem?? their location AND their name change with every single OS/compiler combo 😭 it's giving chaos.

fun origin story: it was originally built to make building and installing the PGPLOT module easier (that one links to the pgplot Fortran graphics library). and now a bunch of perl modules use it. glow-up, honestly πŸ‘‘

what it does: this module tries to implement a simple 'rule-of-thumb' database for various flavours of UNIX systems. a self-documenting Perl database of knowledge/code for figuring out how to link for various combinations of OS and compiler is embedded right in the module's Perl code ✨

and like… please help save the world πŸ₯Ί by submitting patches for new database entries for your system at https://github.com/PDLPorters/extutils-f77. the maintainers will love you forever, fr fr.

πŸ“Œ note: the default on most systems is now to search for a generic 'GNU' compiler, which can be gfortran, g77, g95 or fort77 (in that order, based on usage), and then find the appropriate link libraries automatically. (this is the 'Generic' 'GNU' database entry in the code, iykyk.)

you can explicitly override the target compiler by setting the environment variable F77, like:

 % setenv F77 "x86_64-pc-linux-gnu-gfortran"
 % perl -MExtUtils::F77 -e 'print ExtUtils::F77->compiler, "\n"'

and you can explicitly override the library list the module returns by setting the environment variable F77LIBS, like:

  % setenv F77LIBS "-lfoo -lbar"
  % perl -MExtUtils::F77 -e 'print ExtUtils::F77->runtime, "\n"'
  ...

πŸŽ€ SYNOPSIS πŸŽ€

  use ExtUtils::F77;               # Automatic guess
  use ExtUtils::F77 qw(sunos);     # Specify system
  use ExtUtils::F77 qw(linux g77); # Specify system and compiler
  $fortranlibs = ExtUtils::F77->runtime;

πŸ¦‹ METHODS πŸ¦‹

the following are all class methods bestie. every single one. πŸ’…

⭐ runtime

Returns a list of F77 runtime libraries. the whole point of the module tbh.

  $fortranlibs = ExtUtils::F77->runtime;

⭐ runtimeok

Returns TRUE only if runtime libraries have been found successfully. so if this is false… yeah. sad girl hours 😭

⭐ trail_

Returns true if F77 names have trailing underscores. yes the underscore. it matters. don't ask me why, ask Fortran πŸ™ˆ

⭐ compiler

Returns the command to execute the compiler (e.g. 'f77'). main character energy right there πŸ‘‘

⭐ cflags

Returns compiler flags. flags. slay. 🚩

⭐ testcompiler

Test to see if the compiler actually works. like, does it actually work, or is it just talking 😭 vibe check for your compiler.


πŸ’€ DEBUGGING πŸ’€

wanna snoop on this module and/or get more info about its workings? set $ExtUtils::F77::DEBUG to a true value. if it's set, it will "warn" various information about its operations. detective mode πŸ”

as of version 1.22, this module will no longer print or warn if it is working normally. so if it's quiet, it's happy. no news is good news, bestie 🌈

🌈 SEE ALSO 🌈

  • PDL (and inside it: PDL::Minuit and PDL::Slatec) πŸ“
  • PGPLOT ✨

πŸ‘‘ AUTHOR πŸ‘‘

Karl Glazebrook, with many other contributions β€” see the git repository at https://github.com/PDLPorters/extutils-f77 πŸ’œ


and that's the whole page, bestie 🫢 this was the F77(3pm) manual, shipped with perl v5.32.1, dated 2021-02-19. go link some Fortran. periodt πŸ’…βœ¨

πŸ“¦ where this page comes from