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

[netCDF #BZX-567876]: Missing netcdf.mod file



> We did get an error when running configure.  It works when we add the
> --disable-netcdf-4.  The error we are getting is
> 
> configure: error: can't find or link to the hdf5 library.  Use
> --disable-netcdf-4, or see config.log for errors.
> 
> the hdf5 libraries are installed.

If the netCDF C library was built as a static library rather than 
shared, you have to explicitly say where the HDF5 library is installed
when building the netCDF Fortran library.  This is explained under the
section "Using static libraries" in the netCDF Fortran build 
instructions:

  http://www.unidata.ucar.edu/netcdf/docs/netcdf-fortran-install.html

Following those instructions, I get the .mod files installed in the
right place, namely the include/ subdirectory of the installation
path specified in the --prefix= option of the configure command used
to build the Fortran library from the netcdf-fortran-4.2 distribution.

You didn't say whether you needed any of the netCDF-4 features or could
get by with just the netCDF-3 API and associated netCDF classic format.
If netCDF-3 is adequate, building and installing the Fortran library version
4.2 still works fine on Linux, if you tell it where to find a netCDF-3
library built with the --disable-netcdf-4 option to configure.

I've just tested this combination on a Linux platform, and it seemed to work
fine, using these steps:

  1. Build and install netCDF-3 only library, version 4.3.0 sources:
      $ NCDIR=/tmp/nc430-nonc4
      $ ./configure --disable-netcdf-4 --prefix=${NCDIR}
      $ make all 
      $ make check install
  2. Build and install netcdf-fortran-4.2 library, linking against C library 
     installed in step 1:
      $ NFDIR=/tmp/nf42-nonc4
      $ LD_LIBRARY_PATH=${NCDIR}/lib LDFLAGS=-L${NCDIR}/lib 
CPPFLAGS=-I${NCDIR}/include ./configure --prefix=${NFDIR} 
      $ make all
      $ make check install

The above results in the Fortran-90 .mod files getting installed in the right 
place:

      $ ls -l ${NFDIR}/include
      total 292
      -rw-r--r-- 1 russ ustaff  48437 May 30 13:24 netcdf.inc
      -rw-r--r-- 1 russ ustaff 243314 May 30 13:24 netcdf.mod
      -rw-r--r-- 1 russ ustaff   2408 May 30 13:24 typesizes.mod

So I can't reproduce the problem of the .mod files not getting installed 
in the right place ...

If this doesn't help, you'll need to send more details, including the commands
you used to build and install the netCDF C and Fortran packages, as well as the
output from those commands.

--Russ

> address@hidden> wrote:
> 
> > > Full Name: Scott Sexton
> > > Organization: NCSU Physics IT
> > > Package Version: 4.3.0
> > > Operating System: Red Hat Enterprise Linux Client 6
> > > Description of problem:
> >
> > Hi Scott,
> >
> > > I am trying to build a fortran program that works when I build it on
> > > a mac, but am having trouble building on the linux machine.  I have
> > > installed the fortran libraries and am using gcc to compile.  I checked
> > in
> > > /usr/local/include and the only file there is netcdf.h, the .mod file is
> > > missing.  What actually creates the module file, and where is it stored?
> >
> > The .mod files (there are typically two, netcdf.mod and typesizes.mod, when
> > building netcdf-fortran-4.2, or eight .mod files when building from the svn
> > snapshot release that uses Fortran-2003 C interoperability features) are
> > stored in /usr/local/include by default, when you run "make install" as the
> > last step of the Fortran installation described here:
> >
> >   http://www.unidata.ucar.edu/netcdf/docs/netcdf-fortran-install.html
> >
> > Did you get actual error messages (not just warnings) when running "make"
> > or
> > "make check" for the netCDF-Fortran build?  You should run "make check"
> > successfully before attempting to run "make install".
> >
> > --Russ
> >
> > Russ Rew                                         UCAR Unidata Program
> > address@hidden                      http://www.unidata.ucar.edu
> >
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: BZX-567876
> > Department: Support netCDF
> > Priority: Normal
> > Status: Closed
> >
> >
> 
> 
Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: BZX-567876
Department: Support netCDF
Priority: Normal
Status: Closed