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

[netCDF #DMW-679093]: Unable to run make check



Gaby,

What Ward wrote is correct, "has-f03" implies "has-f90" for netCDF-Fortran.
:
> While Russ is the fortran guru, I want to jump in because I may have an
> answer to this. I’d had some time to consider this and it started to sound
> familiar to me. After a little experimentation (on my OSX development box),
> here is what I’ve found.
> 
> - If I use the nf-config --all command (instead of nc-config), I see
> that the following:
> 
> ------------------------------
> 
> --has-f90   -> no
> --has-f03   -> yes
> 
> ------------------------------

The F03 code has no new functions beyond what is in the F90 API, it merely
takes advantage of the Fortran-2003 standard feature of C interoperability
to portably call C functions in the netCDF-C library from Fortran functions in
the netCDF-Fortran library. But having nf-config print "Has-f90=no" is more
confusing than helpful. I think we should change the nf-config to print "yes"
for both has-f03 and has-f90.

> As I recall from a previous discussion with Russ, when f03 is detected, f90
> is automatically disabled; I believe this happens because f03 is a superset
> of f90. I also *believe* the reason for the former superseding the latter
> is that if f90 is detected, there is one way for the fortran library to
> interface with the C library; if f03 is detected, there is a different
> interface. Russ can correct me if I’m wrong, although he is out of the
> office Thursday and Friday.

Yes, in the case that the F03 C interoperability features are not detected, use
is made of Burkhard Burow's cfortran.h package, almost 20 years old now, to
try to implement all the different non-standard ways of calling C functions 
from Fortran to implement the Fortran90 netCDF API, but not always 
successfully. 
The Fortran-2003 approach is portable, so it doesn't need any of the compiler- 
and
vendor-specific information encoded in cfortran.h.

> Clearly, the nc-config script needs to reflect the value of --has-f03 in
> addition to the --has-f90 flag.
> 
> I hope this makes sense; as I said, I’m not a Fortran developer and am
> simply going by what I remember from previous discussions with Russ. I’m
> sure he’ll confirm or correct my recollection.

This is to confirm Ward's good recollection. 

By the way, I just rebuilt, tested, and installed the netCDF-C 4.3.3.1 
and netCDF-Fortran 4.4.2 libraries from source on OSX 10.10.5:

  $ gcc --version             # just used Apple's XCode gcc compiler
  Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr 
--with-gxx-include-dir=/usr/include/c++/4.2.1
  Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
  Target: x86_64-apple-darwin14.5.0
  Thread model: posix

  $ gfortran --version        # recent version from Homebrew
  GNU Fortran (Homebrew gcc 5.1.0) 5.1.0
  Copyright (C) 2015 Free Software Foundation, Inc.

  GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
  You may redistribute copies of GNU Fortran
  under the terms of the GNU General Public License.
  For more information about these matters, see the file named COPYING

  $ H5DIR=~/installs/h5-1815  # where shared HDF5 library is installed
  $ NCDIR=~/installs/nc-4331  # where to install shared netCDF-4 C library
  $ ...  # unpack source tarballs in /tmp
  $ cd /tmp/netcdf-4.3.3.1
  $ CPPFLAGS=-I${H5DIR}/include LDFLAGS=-L${H5DIR}/lib ./configure 
--prefix=${NCDIR}
  $ make check install
        ...
  $ NFDIR=~/installs/nf-442   # where to install netCDF-Fortran library
  $ cd /tmp/netcdf-fortran-4.4.2
  $ CPPFLAGS=-I${NCDIR}/include LDFLAGS=-L${NCDIR}/lib ./configure 
--prefix=$NFDIR
  $ make check install
        ...

I think the gcc and gfortran from fink that you're using should work as well as 
the
versions I'm using, as long as they're compatible.

--Russ


Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: DMW-679093
Department: Support netCDF
Priority: Normal
Status: Closed