Re: [netcdfgroup] netcdf-fortran 4.4.2 does not compile with gfortran 4.4.7

Martin

The most likely reason for you problme is the configure (if you are using configure instead of cmake) script did not properly detect that you aren't using a version of gfortran (or other compiler) that supports the enhanced Fortran-C interoperability standard (defined in the Fortran Standards TS-29113 Technical Specification). gfortran >= 4.8 supports it but its about the only compiler that does. A cpp macro (HAVE_TS20113_SUPPORT) is set in nfconfig.inc during the configure process for gfortran 4.8. This should have been set to FALSE (or NULL or 0) for all other compilers. It looks like it wasn't. You
can try editing nfconfig.inc to make it FALSE or edit the file
/fortran/module_netcdf_nc_data.F90 and remove line 79 and line 87
(the #ifndef HAVE_TS29113_SUPPORT and its associated #endif). This
should activate the replacements for the intrinsic C_PTRDIFF_T kind
parameter define in TS-20113.

RW

On 06/02/2015 12:02 PM, Martin Hoecker-Martinez wrote:
I'm compiling a local copy of netcdf on a institutionally maintained machine
(hence the older version of gfrotran). On my personal development machine (which
has gfortran 4.8.2) it compiles fine.  Is there a work around for the older
version of gfortran?  Should I use an older version of netcdf-fortran and/or
netcdf-c?  Do I need to roll back to a version of netcf before the c and fortran
packages were separated? If I do need to roll back my version of netcdf which
version is recommended? The code I will compile with the netcdf libraries does
not use compression or groups so the hdf5 and zlib libraries just in case I need
the netcdf utilities to handle a newer netcdf file from elsewhere.

zlib-1.2.7 compiles OK
hdf5-1.8.10-patch1 compiles OK
netcdf-c-4.3.3.1 compiles OK
netcdf-fortran-4.4.2 does not compile

Error message to std out end with:
:
:
gfortran  -g -O2 -c -o module_netcdf_fortv2_c_interfaces.o
  module_netcdf_fortv2_c_interfaces.f90
module_netcdf_fortv2_c_interfaces.f90:619.25:

  Integer(KIND=C_PTRDIFF_T), Intent(INOUT) :: cmap(*)
                          1
Error: Symbol 'c_ptrdiff_t' at (1) has no IMPLICIT type
module_netcdf_fortv2_c_interfaces.f90:660.5:

      cmap(idim) = total
      1
Error: Unclassifiable statement at (1)
module_netcdf_fortv2_c_interfaces.f90:683.3:

    cmap(1:rank) = fmap(rank:1:-1) / csize
    1
Error: Unclassifiable statement at (1)
module_netcdf_fortv2_c_interfaces.f90:600.52:

Subroutine convert_v2_imap(cncid, cvarid, fmap, cmap, inullp)
                                                     1
Error: Symbol 'cmap' at (1) has no IMPLICIT type
make[1]: *** [module_netcdf_fortv2_c_interfaces.o] Error 1
make[1]: Leaving directory `/~/local/src/netcdf-fortran-4.4.2/fortran'



_______________________________________________
netcdfgroup mailing list
netcdfgroup@xxxxxxxxxxxxxxxx
For list information or to unsubscribe,  visit: 
http://www.unidata.ucar.edu/mailing_lists/


--
---
-----

Richard Weed, Ph.D.
Associate Research Professor
Center for Advanced Vehicular Systems (CAVS)
Mississippi State University

email: rweed@xxxxxxxxxxxxxxxx
Phone: (662) 325-5450



  • 2015 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: