diff options
Diffstat (limited to 'noao/lib/FC.mips')
-rwxr-xr-x | noao/lib/FC.mips | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/noao/lib/FC.mips b/noao/lib/FC.mips new file mode 100755 index 00000000..5a8c5fa3 --- /dev/null +++ b/noao/lib/FC.mips @@ -0,0 +1,32 @@ +#!/bin/csh + +# FCOMP -- Compile a Fortran or SPP file. This is a kludge used to workaround +# a bug in the DS3100/MIPS Fortran compiler, wherein the parser goes completely +# bonkers on large files. When this occurs it is necessary to break the file +# up into pieces and compile them separately to workaround the problem. + +#set echo + +set root = $1:r +set xfile = ${root}.x +set ffile = ${root}.f +set ofile = ${root}.o +set DIR = zzz.fcomp + +if ($1 == $xfile) then + xc -f $1 +endif + +if (-e $DIR) then + rm -rf $DIR +endif + +mkdir $DIR +cat $ffile | (cd $DIR; fsplit) +(cd $DIR; f77 -c -O -G 0 *.f; ld -r *.o -o ../zzz.fcomp.o) +mv zzz.fcomp.o $ofile +rm -rf $DIR + +if ($1 == $xfile) then + rm -f $ffile +endif |