From: rich@Rice.edu (Richard Murphey)
Newsgroups: comp.archives
Subject: [comp.unix.bsd] [386bsd] f2c and fsplit available
Followup-To: comp.unix.bsd
Date: 20 Dec 1992 20:57:16 GMT
Organization: Department of Electrical and Computer Engineering, Rice
Distribution: world
Reply-To: Rich@rice.edu
NNTP-Posting-Host: soda.berkeley.edu
X-Original-Newsgroups: comp.unix.bsd
X-Original-Date: Sun, 29 Nov 1992 05:40:39 GMT

Archive-name: auto/comp.unix.bsd/386bsd-f2c-and-fsplit-available


I've put ports of the fortran to C translator f2c-3.2.90, fsplit and
getopt (which is required by the f77 script) on nova.cc.purdue.edu
(128.210.7.22) in /pub/386bsd/submissions and ref.tfs.com
(140.145.254.251) in /usr/packages and perhaps soon on
rachel.ibmpcug.co.uk.  The files are:

f2c-3.2.90-bin.tar.Z
f2c-3.2.90-src.tar.Z
fsplit-bin.tar.Z
fsplit-src.tar.Z
getopt-bin.tar.Z
getopt-src.tar.Z

You need getopt in order to use f77.  With both you can use existing
makefiles for fortran code, link fortran and C, etc.  fsplit separates
fortran subroutines into separate files, which facilitates creating
libraries.

Terry Lambert posted a version of f2c last weekend, but it was based
on an earlier version of f2c {and all my attempts to contact him about
failed}.

Below is a copy of the README contained in f2c-3.2.90-bin.tar.Z. It
describes some farily steps for installating f77 and contains a small
set of patches.  Rich


~~~~~~~~~~~~~~~~
This is a port of f2c-3.2.90 to 386bsd.  It is avaiailable from
nova.cc.purdue.edu (128.210.7.22) in /pub/386bsd/submissions and
ref.tfs.com (140.145.254.251) in /usr/packages.  f2c-3.2.90-bin.tar.Z
is the ready-to-install executables and libraries and
f2c-3.2.90-src.tar.Z is the patched sources.

The patches are below and you can get the original sources from which
this port was derived by anonymous ftp from prep.ai.mit.edu
(18.71.0.38) in the directory /pub/gnu.  The file is f2c-3.2.90.tar.Z.

This supercedes the sources currently available by ftp on
research.att.com in the netlib account and contains many bug fixes.

In order to use the f77 script you will also need getopt.  Getopt
sources and 386bsd executables are available by anon ftp from
ref.tfs.com (140.145.254.251) in /usr/packages.  There is a port of
fsplit there as well.

To install it, cd to /usr/local and:
	tar xzf f2c-3.2.90.bin.Z

this will create:

README.f2c  (this file)
man/cat1/f2c.0
lib/libF77.a
lib/libI77.a
include/f2c.h
bin/f77
bin/f2c

The only changes that are needed in order to install it somewhere
besides /usr/local are the values of variables in the f77 script.

To install it elsewhere, you need to edit the f77 script to specify
the directory containing f2c.h header file, and the directory
containing the libF77.a and libI77.a libraries:

    CC=${CC_f2c:-'cc -I/usr/whereever/include' -L/usr/whereever/lib}

And you need to speciy the location of the f2c executable in f77:

    F2C=${F2C:-/usr/whereever/f2c}

Below are the paches for the sources and makefile in
/pub/gnu/f2c-3.2.90.tar.Z on prep.ai.mit.edu (18.71.0.38).

Rich Murphey  Rich@rice.edu


diff -rc ../t/f2c-3.2.90/libF77/makefile ./libF77/makefile
*** ../t/f2c-3.2.90/libF77/makefile	Wed Feb 28 13:53:08 1990
--- ./libF77/makefile	Sun Sep 13 13:35:59 1992
***************
*** 1,7 ****
  .SUFFIXES: .c .o
  # compile, then strip unnecessary symbols
  .c.o:
! 	cc -O -c -DSkip_f2c_Undefs $*.c
  	ld -r -x $*.o
  	mv a.out $*.o
  
--- 1,7 ----
  .SUFFIXES: .c .o
  # compile, then strip unnecessary symbols
  .c.o:
! 	cc -O -c -DSkip_f2c_Undefs -DIEEE_drem $*.c
  	ld -r -x $*.o
  	mv a.out $*.o
  
diff -rc ../t/f2c-3.2.90/libI77/err.c ./libI77/err.c
*** ../t/f2c-3.2.90/libI77/err.c	Wed Feb 28 13:53:30 1990
--- ./libI77/err.c	Sun Sep 13 13:41:33 1992
***************
*** 2,7 ****
--- 2,8 ----
  #include "sys/stat.h"
  #include "f2c.h"
  #include "fio.h"
+ #include "local.h"
  
  extern FILE *fdopen();
  
diff -rc ../t/f2c-3.2.90/libI77/local.h ./libI77/local.h
*** ../t/f2c-3.2.90/libI77/local.h	Sun Sep 13 13:39:54 1992
--- ./libI77/local.h	Sun Sep 13 13:39:25 1992
***************
*** 0 ****
--- 1,6 ----
+ /* Use 
+    -DNON_ANSI_RW_MODES in libI77/makefile and
+    -DIEEE_drem in libF77/makefile.  Rich */
+ #define _base	_bf._base
+ #define _flag	_flags
+ #define _ptr	_p
diff -rc ../t/f2c-3.2.90/libI77/makefile ./libI77/makefile
*** ../t/f2c-3.2.90/libI77/makefile	Wed Feb 28 13:53:29 1990
--- ./libI77/makefile	Sun Sep 13 13:39:30 1992
***************
*** 1,6 ****
  .SUFFIXES: .c .o
  
! CFLAGS = -DSkip_f2c_Undefs -O
  
  # compile, then strip unnecessary symbols
  .c.o:
--- 1,6 ----
  .SUFFIXES: .c .o
  
! CFLAGS = -DSkip_f2c_Undefs -O -DNON_ANSI_RW_MODES
  
  # compile, then strip unnecessary symbols
  .c.o:
diff -rc ../t/f2c-3.2.90/libI77/wrtfmt.c ./libI77/wrtfmt.c
*** ../t/f2c-3.2.90/libI77/wrtfmt.c	Wed Feb 28 13:53:35 1990
--- ./libI77/wrtfmt.c	Sun Sep 13 13:41:14 1992
***************
*** 1,6 ****
--- 1,7 ----
  #include "f2c.h"
  #include "fio.h"
  #include "fmt.h"
+ #include "local.h"
  extern int cursor;
  extern char *icvt(), *ecvt();
  int hiwater;
diff -rc ../t/f2c-3.2.90/libI77/wsfe.c ./libI77/wsfe.c
*** ../t/f2c-3.2.90/libI77/wsfe.c	Wed Feb 28 13:53:35 1990
--- ./libI77/wsfe.c	Sun Sep 13 13:41:04 1992
***************
*** 2,7 ****
--- 2,8 ----
  #include "f2c.h"
  #include "fio.h"
  #include "fmt.h"
+ #include "local.h"
  extern int x_putc(),w_ed(),w_ned();
  extern int xw_end(),xw_rev(),x_wSL();
  extern int hiwater;
*** ../t/f2c-3.2.90/fc	Wed Feb 28 13:53:36 1990
--- ./fc	Sun Sep 13 13:54:02 1992
***************
*** 1,5 ****
  #!/bin/sh
! PATH=/v/bin:/bin:/usr/bin
  # f77-style shell script to compile and load fortran, C, and assembly codes
  
  #	usage:	f77 [-O] [-o absfile] [-c] files [-l library]
--- 1,5 ----
  #!/bin/sh
! PATH=/usr/site/f2c-3.2.90/bin:/bin:/usr/bin
  # f77-style shell script to compile and load fortran, C, and assembly codes
  
  #	usage:	f77 [-O] [-o absfile] [-c] files [-l library]
***************
*** 29,39 ****
  
  s=/tmp/stderr_$$
  t=/tmp/f77_$$.o
! CC=${CC_f2c:-'/v/bin/lcc double=8,4,1'}
! EFL=${EFL:-/v/bin/efl}
  EFLFLAGS=${EFLFLAGS:-'system=portable deltastno=10'}
! F2C=${F2C:-/v/bin/f2c}
! F2CFLAGS=${F2CFLAGS:='-ARw8 -T/usr/tmp'}
  rc=0
  trap "rm -f $s $t; exit \$rc" 0
  lib=/lib/num/lib.lo
--- 29,39 ----
  
  s=/tmp/stderr_$$
  t=/tmp/f77_$$.o
! CC=${CC_f2c:-'/usr/bin/cc -I/usr/site/f2c-3.2.90/include'}
! EFL=${EFL:-/usr/bin/efl}
  EFLFLAGS=${EFLFLAGS:-'system=portable deltastno=10'}
! F2C=${F2C:-/usr/site/f2c-3.2.90/bin/f2c}
! F2CFLAGS=${F2CFLAGS:='-ARw8 -T/tmp'}
  rc=0
  trap "rm -f $s $t; exit \$rc" 0
  lib=/lib/num/lib.lo