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

[netCDF #ZBH-501382]: netcdf-fortran



Jae-Min,

> Thank you for your insight.
> 
> I have built netcdf 4.3.3.1 and the netcdf fortran 4.4.2 in the same
> prefix, and I built the 4.3.3.1 before I built 4.4.2. do you think this
> problem could have been caused by:
> 
> 1. netcdf.inc being made into the prefix directory by 4.3.3.1 and then
> 2. netcdf.inc for fortran was not made because the file with the same name
> exists in the prefix already?

No, because netCDF 4.3.3.1 only builds and installs the C library, so it
has no netcdf.inc and doesn't install a file by that name in an include
directory. It only installs at most these 3 C header files in the include 
directory:

  -rw-r--r--  1 russ  2000  60074 Jun 12 15:03 netcdf.h
  -rw-r--r--  1 russ  2000   2053 Jun 12 15:03 netcdf_meta.h
  -rw-r--r--  1 russ  2000   2106 Jun 12 13:37 netcdf_mem.h

Building and installing netCDF-Fortran 4.4.2 adds a bunch of
other files to the include directory, but none of them overwrite
any of the netCDF-C .h files:

  -rw-r--r--   1 russ  2000  59877 Apr 22 13:38 netcdf.inc
  -rw-r--r--   1 russ  2000  21991 Apr 22 13:38 netcdf.mod
  -rw-r--r--   1 russ  2000  25219 Apr 22 13:38 netcdf4_f03.mod
  -rw-r--r--   1 russ  2000  25086 Apr 22 13:38 netcdf4_nc_interfaces.mod
  -rw-r--r--   1 russ  2000   5564 Apr 22 13:38 netcdf4_nf_interfaces.mod
  -rw-r--r--   1 russ  2000  19848 Apr 22 13:38 netcdf_f03.mod
  -rw-r--r--   1 russ  2000  22140 Apr 22 13:38 netcdf_fortv2_c_interfaces.mod
  -rw-r--r--   1 russ  2000   4987 Apr 22 13:38 netcdf_nc_data.mod
  -rw-r--r--   1 russ  2000  18574 Apr 22 13:38 netcdf_nc_interfaces.mod
  -rw-r--r--   1 russ  2000   8787 Apr 22 13:38 netcdf_nf_data.mod
  -rw-r--r--   1 russ  2000  10644 Apr 22 13:38 netcdf_nf_interfaces.mod
  -rw-r--r--   1 russ  2000    483 Apr 22 13:38 typesizes.mod

It's possible your install didn't put all these files in the include directory,
depending on your compiler and configure options.

--Russ

> Thank you.
> 
> Regards,
> 
> 
> address@hidden> wrote:
> 
> > You shouldn't have had to copy netcdf.inc from anywhere else. During
> > the "make' for netcdf-fortran, it is supposed to be read from
> > fortran/netcdf.inc in the sources (where you say you found it), and it
> > is supposed to be copied to the include/ directory specified by
> > --prefix as part of "make install", for use when compiling other
> > Fortran programs that have an "include 'netcdf.inc'" and call netCDF
> > Fortran functions. The netcdf.inc file doesn't change much between
> > versions, so it's possible that using a netcdf.inc file from another
> > version wouldn't cause any problems, but I can't guarantee that. No
> > one else has reported that problem, as far as I know, and the software
> > works OK on our test platforms, but if "make check" now works OK for
> > you, it's probably OK to run "make install" and assume it's probably
> > OK.
> >
> > --Russ
> >
> >
> > > Sorry, I miswrote. By "prefix" where the netcdf.inc was found, I meant
> > the
> > > include folder within the prefix directory.
> > >
> > > Thank you.
> > >
> > > Regards,
> > > Jae-Min
> > >
> > > On Thu, Jun 25, 2015 at 9:40 AM, Jae-Min Jo <address@hidden>
> > wrote:
> > >
> > > > Hello Russ,
> > > >
> > > > As you have mentioned that netcdf.inc that was in
> > > > ....../netcdf-fortran-4.4.2/fortran directory could not be found, I
> > looked
> > > > for it and found it in 2 different places (one in the fortran
> > directory and
> > > > the other in the prefix of both netcdf-4.3.3.1 and
> > netcdf-fortran-4.4.2). I
> > > > moved and replaced the one in fortran directory, and the make check for
> > > > both netcdf-4.3.3.1 and netcdf-fortran-4.4.2 seems to work. Would
> > there be
> > > > a way of just making the netcdf.inc file go to prefix in the first
> > place?
> > > > if not, do you think manually placing the netcdf.inc file is a valid
> > > > or reliable solution?
> > > >
> > > > Thank you for your help.
> > > >
> > > > Regards,
> > > > Jae-Min
> > > >
> > > > address@hidden> wrote:
> > > >
> > > >> > Thank you for your reply. I have located the netcdf.inc in
> > > >> > /lustre05/vol0/jojchi/Projects/REEMS/netcdf-fortran-4.4.2/fortran/
> > > >> > directory. I have put this in the LD_LIBRARY_PATH. It's not working
> > yet
> > > >> but
> > > >> > I will try along the lines of looking for netcdf.inc and setting
> > > >> > environment variables appropriately for the fortran compiler.
> > > >>
> > > >> Note that LD_LIBRARY_PATH is just a list of directories containing
> > > >> libraries, not
> > > >> include files. The CPPFLAGS environment variable contains -I options
> > that
> > > >> specify include file directories (among other things), so a typo in
> > > >> CPPFLAGS
> > > >> would be a more libely place to look for an error leading to a missing
> > > >> include
> > > >> file.
> > > >>
> > > >> --Russ
> > > >>
> > > >> > address@hidden> wrote:
> > > >> >
> > > >> > > Jae-Min,
> > > >> > >
> > > >> > > > netcdf-fortran-4.4.2 "configure" now worked and "make" worked,
> > but
> > > >> make
> > > >> > > > check failed.
> > > >> > > > Could you take a look at my make check output please?
> > > >> > >
> > > >> > > Here's the instructions for building netCDF-Fortran:
> > > >> > >
> > > >> > >
> > > >> http://www.unidata.ucar.edu/netcdf/docs/building_netcdf_fortran.html
> > > >> > >
> > > >> > > The error you are seeing seems to indicate that the "netcdf.inc"
> > > >> > > file is not being found when you run the tests. Or maybe an older
> > > >> > > netcdf.inc file is being found from a previous installation, for
> > > >> > > example in /usr/include/netcdf.inc.
> > > >> > >
> > > >> > > The fortran/netcdf.inc that comes with netcdf-fortran-4.4.2 has
> > the
> > > >> > > following statements:
> > > >> > >
> > > >> > >       integer nf_char
> > > >> > >    ...
> > > >> > >       parameter (nf_char = 2)
> > > >> > >
> > > >> > > which declare a type for the nf_char parameter, so any
> > > >> > > program that has the
> > > >> > >
> > > >> > >       include 'netcdf.inc'
> > > >> > >
> > > >> > > statement and uses the right compiler directive to tell where to
> > > >> > > look for the netcdf.inc include file should get the type.
> > > >> > >
> > > >> > > So the error you are seeing:
> > > >> > >
> > > >> > >    make[2]: Entering directory
> > > >> > >
> > `/lustre05/vol0/jojchi/Projects/REEMS/netcdf-fortran-4.4.2/nf_test'
> > > >> > >    gfortran -DHAVE_CONFIG_H -I. -I.. -I../libsrc
> > > >> > >  -I/lustre05/vol0/jojchi/Projects/REEMS/mpi/include -I../fortran
> > > >> > >  -I../fortran -g -O2 -c -o test_get.o test_get.F
> > > >> > >    test_get.F:29.50:
> > > >> > >
> > > >> > >             canConvert = (var_type(i) .eq. NF_CHAR) .eqv.
> > > >> > >                                                   1
> > > >> > >    Error: Symbol 'nf_char' at (1) has no IMPLICIT type
> > > >> > >    test_get.F:35.34:
> > > >> > >
> > > >> > > means that the gfortran compiler, when running in the fortran/
> > > >> > > subdirectory,
> > > >> > > isn't finding the netcdf.inc file where it's specified to be with
> > > >> > > "-I../fortran".
> > > >> > > I'm not sure why this error is occurring or how to fix it. The
> > > >> software
> > > >> > > compiles
> > > >> > > fine here on our test platforms, with no errors. Check for the
> > file
> > > >> > >
> > > >> > >
> > > >> > >
> > > >>
> > /lustre05/vol0/jojchi/Projects/REEMS/netcdf-fortran-4.4.2/fortran/netcdf.inc
> > > >> > >
> > > >> > > to make sure it exists and is readable.
> > > >> > >
> > > >> > > Possible solutions for the problems you aOther things you might
> > try
> > > >> that
> > > >> > > seem
> > > >> > > unrelated to the error you are seeing might include:
> > > >> > >
> > > >> > >   - setting the LD_LIBRARY_PATH environment variable to point to
> > > >> where the
> > > >> > > netCDF-C library is installed
> > > >> > >   - setting environment variables F77 to mpif77 and F90 to mpif90
> > for
> > > >> > > supporting parallel I/O from Fortran
> > > >> > >      or setting F77 and F90 to mpifort if you are using the ifort
> > > >> compiler
> > > >> > >
> > > >> > > --Russ
> > > >> > >
> > address@hidden>
> > > >> > > wrote:
> > > >> > > >
> > > >> > > > > It also says it cant compute sizeof (off_t).
> > > >> > > > > It says "configure:22367"
> > > >> > > > > Thank you.
> > > >> > > > >
> > > >> > > > > Regards,
> > > >> > > > > Jae-Min
> > > >> > > > >
> > address@hidden
> > > >> >
> > > >> > > wrote:
> > > >> > > > >
> > > >> > > > >> Hello,
> > > >> > > > >>
> > > >> > > > >> I am trying to build netcdf-fortran-4.4.2, and the
> > configuration
> > > >> is
> > > >> > > not
> > > >> > > > >> working. I tried to look through the config.log and found
> > that it
> > > >> > > can't
> > > >> > > > >> find libnetcdf.so.7, exit number is 77.
> > > >> > > > >>
> > > >> > > > >> I have attached the config.log.
> > > >> > > > >>
> > > >> > > > >> Thank you.
> > > >> > > > >>
> > > >> > > > >> Regards,
> > > >> > > > >> Jae-Min
> > > >> > > > >>
> > > >> > > > >
> > > >> > > > >
> > > >> > > >
> > > >> > > >
> > > >> > > Russ Rew                                         UCAR Unidata
> > Program
> > > >> > > address@hidden
> > > >> http://www.unidata.ucar.edu
> > > >> > >
> > > >> > >
> > > >> > >
> > > >> > > Ticket Details
> > > >> > > ===================
> > > >> > > Ticket ID: ZBH-501382
> > > >> > > Department: Support netCDF
> > > >> > > Priority: Normal
> > > >> > > Status: Closed
> > > >> > >
> > > >> > >
> > > >> >
> > > >> >
> > > >>
> > > >> Russ Rew                                         UCAR Unidata Program
> > > >> address@hidden
> > http://www.unidata.ucar.edu
> > > >>
> > > >>
> > > >>
> > > >> Ticket Details
> > > >> ===================
> > > >> Ticket ID: ZBH-501382
> > > >> Department: Support netCDF
> > > >> Priority: Normal
> > > >> Status: Closed
> > > >>
> > > >>
> > > >
> > >
> > >
> >
> > Russ Rew                                         UCAR Unidata Program
> > address@hidden                      http://www.unidata.ucar.edu
> >
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: ZBH-501382
> > Department: Support netCDF
> > Priority: Normal
> > Status: Closed
> >
> >
> 
> 
Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: ZBH-501382
Department: Support netCDF
Priority: Normal
Status: Closed