Urania

A blog named for the muse of Astronomy containing musings by an astronomer

HINT: Fast and loose f77 compilation on MacOS with g77

Posted on July 19, 2007 by Juan
One of the problems I had getting the hectospec IRAF scripts installed was that they used f77 to compile some code. My first thought was to just substitute g77 in the proper places in the hectospec scripts using the g77 binary I downloaded from the High Performance Computing on the Mac website. However, it turns out that g77 is stricter in its interpretation of logical statements than f77 … and so the old hectospec code failed to compile. A proper way to compile this old code is to use the –fugly-logint flag for g77, but that was a pain for so many IRAF scripts. Thus I created the following perl script to allow ancient f77 code to compile properly with g77 on the Mac. I just saved this script to /usr/local/bin and made it executable. Now my old IRAF scripts compile just fine on my new shiny Mac.
#!/usr/bin/env perl
# This script allows the compilation of legacy f77 code with g77 by tossing
# the g77 compiler a -fugly-logint flag to tell it to allow legacy logic
# statements instead of the proper EQV version.

# Initialize
$command = "g77 -fugly-logint ";
for ($i=0; $i<=$#ARGV; $i++)
{
 $arg = $ARGV[$i];
 $command .= " $arg";
}
`$command`;
exit;

1 Trackbacks/Pingbacks

  1. 16 10 07 11:56

    Urania » Blog Archive » Another, probably better solution, to g77 flakeiness in IRAF on Mac Intel


Leave a Reply


  • Translate

  • Astro Pic o' the Day

  • Archives

  • Admin



↑ Top