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

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



> Everything ran as it should, and the mod file is now in /tmp/nf42-nonc4.
> I'm trying to test some code I was given and the make file looks for the
> mod files in /usr/local.  I'm assuming if I point NCDIR to /usr/local then
> it would install the mod files in the correct directory, right?

Yes, except I think it's NFDIR in the example I sent.  NCDIR points to 
the parent of where the netCDF C library and .h files are installed,
whereas NFDIR points to the parent of the netCDF Fortran library and .mod
files.  They are typically the same directory, unless you need to install
support for different Fortran compilers.  The default for installation is
/usr/local, so if that's OK, you don't even need to provide --prefix=
options for the netCDF C or netCDF Fortran builds.  Everything will just
be installed in /usr/local/lib or /usr/local/include as appropriate.  The
only difference will be the need for "sudo make install" instead of "make
install" ...

Please let us know if this doesn't help or something doesn't work ...

> Unfortunately I'm not the one that will be using the libraries so all of
> this is foreign to me, I've just been tasked with installing it on a group
> of computers.

Good luck.  Things are easier if a package management system has updated
binaries for installation, but most such systems don't yet support the
latest netCDF C 4.3.0 with netCDF-Fortran 4.2.

--Russ

> address@hidden> wrote:
> 
> > > 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
> >
> >
> 
> 

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