[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 950308: netCDF FORTRAN Jacket not made



> Organization: Navy
> Keywords: 199503082215.AA22946 netCDF Fortran jacket

Michael,

> Thank you very much for your prompt advice.  I am running SunOS 4.1.3.  Appen-
> ded is my CUSTOMIZE file.
> 
> Thanks -- Michael 408/656-4156
> 
> > cat CUSTOMIZE
> # This file is for customizing the configuation process performed by
> # `./configuration'.  This file consists of sh(1) variable-definition lines.
> # The value given to those variables by this file will override their default
> # values.
> #
> # You can also customize the configuration process via the environment
> # variables seen by ./configure.  For example:
> #
> #     In csh(1):
> #         % setenv CC acc
> #         & setenv CFLAGS -g
> #         % ./configure
> #
> #     In sh(1):
> #         $ CC=acc CFLAGS=-g ./configure
> #
> # Variables in this file override the environmental ones.
> #
> #############################################################################
> #
> # Type of C compiler (default is `cc'):
> #CC='gcc -traditional'

I don't know of anyone who has succeeded in getting the Fortran jackets to
work when the underlying library is compiled with gcc.  As you may know,
there is no standard for how to call C functions from Fortran.  The
conventions used are platform- and compiler-specific.  On SunOS 4.1.x, the
Fortran jackets work OK if you use Sun's f77 with one of Sun's C compilers,
but gcc-compiled functions evidently can't be called from Fortran the same
way C functions compiled with Sun's C compiler are called.  The conventions
for how C is called from Fortran are all isolated in the fortran/sunos.m4
file, which may need to be changed for the combination you are using, if you
can follow the comments in that file and determine the conventions used.

> # C compiler flags (default is `-O'):
> # CFLAGS=-g
> CFLAGS=-O
> #
> # FORTRAN compiler flags (default is `/bin/f77'):
> # FC=/bin/f77
> FC=/local/comp/f77

I have no idea what this Fortran compiler is, but if it will be used to call
the gcc-compiled functions in the netCDF library, you will have to figure
out what conventions it uses and incorporate them into the sunos.m4 file, as
discussed above.  If this is the new g77, based on gcc, you may be the first
one trying this combination with netCDF.  We don't have g77 here, so I can't
be of much help.

Everything else in your CUSTOMIZE file looks harmless.  Good luck on getting
this combination to work.  If you can't figure out how to modify the M4
macros in sunos.m4 to encode the specific conventions assumed by the
specific C and Fortran compilers you are using, you might try posting a
question about the combination to the address@hidden mailing
list, which has about 400 subscribers.  Someone on that list may have tried
the particular C/Fortran compiler you are using.

Otherwise the only suggestion I can offer is to get a C and Fortran compiler
from the same vendor (e.g. Sun) to make sure there is support for calling C
functions from Fortran, as required by the netCDF Fortran interface.

______________________________________________________________________________

Russ Rew                                                UCAR Unidata Program
address@hidden                                          P.O. Box 3000
http://www.unidata.ucar.edu/                          Boulder, CO 80307-3000
______________________________________________________________________________