[comp.lang.fortran] libU77 for f2c

glenn@qed.physics.su.OZ.AU (Glenn Geers) (12/24/90)

Hi,
	There has been a lot of discussion about f2c, dynamic memory allocation,
garbbing dates from FORTRAN, etc. in this group. SUN FORTRAN provides all
of these facilities (mostly in libU77). In order to aid portability I looked
at the SUN FORTRAN manual and implemented most of the routines in libU77.
Here is the README. If enough people are interested I'll post to one of the 
source groups.

README
------
The files in this directory implement the majority of functions and
subroutines provided in the library libU77.a provided with SUN FORTRAN. 
The primary aim of writing these was to make porting between the SUN I use
at work and my 80386 box (where I use f2c as the FORTRAN DS) essentially
trivial.

This should compile on most system V.3.2 implementations. The only BSD
system calls used are gethostname() (but see hostnm_v5.c) and getrusage().
You'll also need <sys/resource.h> if you intend to compile etime_.c (which
uses getrusage). If you like you can rewrite etime_() and dtime_() to use
times(2).

You also need to have several files from libF77 that have been modified to
handle the enhanced environment. To complete the illusion of SUN FORTRAN
the alternative 80386 math library should be used. Indeed libF77/main.c 
as ditributed requires libfpu.a in order to be able to be used (but see
libF77/noieee/main.c).

Several objects that I have included in libU77.a are found in libF77.a on
SUN machines. This should not be a problem if you link libU77.a by default.

The error diagnostics are not very good at present. They will be improved.

And yes, you do get malloc().

Functions which need to convert between FORTRAN unit numbers and C (FILE *)'s
or file descriptors include fio.h which was ditributed with f2c
(libI77/fio.h). iors.c was generated by f2c (and hand mods) from the file
iors.f ditributed with adventure.

The references for these routines are the relevant SUN manual pages with
one exception: the SUN function flush has been renamed uflush to avoid a
name collision (flush distributed with f2c flushes all open FORTRAN
units).

Important
---------
This library is covered by the same licencing arrangement as my 80386
library, i.e., the GNU General Public Licence with the following
modification:

Amendment to the GNU General Public Licence (*ONLY* applicable to my code)
-------------------------------------------
I may choose to cover this code by the Free Software Foundation's General
Public Library Licence when it becomes available. At present I make the 
following amendment to the licencing agreement:

*******************************************************************************
You may use this library in products which are distributed in binary format
only as long as you provide source code for the library with the distribution
or will supply the source code for the library for a period of 3 years from the
date of providing the binary files.
********************************************************************************

This in no way changes the GNU licence as applicable to other programs.

Also I have not modified the GPL, it is ditributed in its original form as
it must be. See the file COPYING.

Cheers, Merry Christmas and a Happy New Year
Glenn

glenn@qed.physics.su.oz.au


--
Glenn Geers                       | "So when it's over, we're back to people.
Department of Theoretical Physics |  Just to prove that human touch can have
The University of Sydney          |  no equal."
Sydney NSW 2006 Australia         |  - Basia Trzetrzelewska, 'Prime Time TV'