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

[netCDF #ZVM-937329]: NetCDF.inc


> I tried to do what you mentioned in the reply to my inquiry on ticket #
> Ticket ID: ZVM-937329.
> I was able to successfully compile netcdf-4.3.3 for the C libraries and
> have netcdf.h in my directory /home/jsnyder/local/include.
> Now the problem is when it comes to compiling the fortran components of
> netcdf I can only find netcdf-4.4.1.

That release should work OK with the netCDF-C library you installed. The 
netcdf-fortran-4.4.2 hasn't been announced yet, but it's available here:


>        ... I tried to follow the directions in
> http://www.unidata.ucar.edu/software/netcdf/docs/building_netcdf_fortran.html
> given that my netcdf was set into /home/jsnyder/local/include and lib, I
> set DIR1 that is mentioned in the above website to /home/jsnyder/local.
> With this when I did a ./configure I get the following error message:
> configure: error: netcdf.h could not be found. Please set CPPFLAGS.
> Do you know how to resolve this issue?  Next I noticed on the website the
> following instruction:
> what is ENV_VARIABLE and what should I put for value?

ENV_VARIABLE is just used as an example name for an environment variable,
such as DIR1 or CPPFLAGS or LDFLAGS.  These can used to communicate paths
or other information to a shell script, such as configure, instead of using 

The introductory section of the instructions for building the netCDF Fortran
software has nothing directly to do with netCDF; it is merely explaining that
you need to set environment variables, and that the syntax for how you do this
depends on which command shell you are using. With a standard Unix shell,
you can set environment variables with the syntax shown there.

From your description of how you have configured things, and assuming you 
are using a standard shell, you should use something like this:

  $ DIR1=/home/jsnyder/local
  $ CPPFLAGS="-I${DIR1}/include" LDFLAGS="-L${DIR1}/lib" ./configure 
  $ make check
  $ make install

There are lots of variations of this. Instead of "DIR1", you could use any name,
such as "NCDIR" for the directory where you are installing things.

Using "export" with LD_LIBRARY_PATH ensures it gets inherited by
subshells that need it later, in tests run by "make check" or in programs
you try to link with the installed library after it's installed.

The CPPFLAGS and LDFLAGS environment variables are only needed by
the configure shell script, so they don't need to be exported, though it
would still work if you do export them using separate cammands, as is


> address@hidden> wrote:
> > Hi Jason,
> >
> > > I have tried downloading netcdf-c-4.3.3-rc3 on my system I did the make
> > > check make install and unfortunately, while I get the include and lib
> > > directories, I do not have netcdf.inc which is a vital file for running
> > > many netcdf based programs.  Can you let me know how to get netcdf.inc on
> > > my system.  I have a CENTOS 7 operating system.
> >
> > What you built and installed is the netCDF C library, but you still need to
> > build and install the netCDF-Fortran library to get netcdf.inc, which is
> > for
> > Fortran programs that call netCDF functions.
> >
> > The netCDF-Fortran release requires, as a first step, that you install the
> > netCDF C library, so you're done with that step. To finish, you can follow
> > these instructions:
> >
> >   http://www.unidata.ucar.edu/netcdf/docs/building_netcdf_fortran.html
> >
> > using the latest announced netCDF-Fortran release, version 4.4.1, available
> > from:
> >
> >   http://www.unidata.ucar.edu/downloads/netcdf/
> >
> > Alternatively, if you wait until next week, there will likely be a later
> > version of both the Fortran library and the C library on which it depends.
> > Building that Fortran library on top of that C library may be a little
> > easier with the instructions in the accompanying release notes:
> >
> >   https://github.com/Unidata/netcdf-c/blob/master/RELEASE_NOTES.md
> >
> > --Russ
> >
> >
> > --Russ
> >
> > Russ Rew                                         UCAR Unidata Program
> > address@hidden                      http://www.unidata.ucar.edu
> >
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: ZVM-937329
> > Department: Support netCDF
> > Priority: Normal
> > Status: Closed
> >
> >
> --
> Jason Snyder PhD
> DELTA Group
> University of California Davis
Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu

Ticket Details
Ticket ID: ZVM-937329
Department: Support netCDF
Priority: Normal
Status: Closed

NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.