[mpas-developers] netCDF Fortran library
Michael Duda
duda at ucar.edu
Thu Jan 3 15:21:05 MST 2013
Hi, Doug.
Based on a couple of netCDF installations on machines in our division, it
appears that 3.6.2 does not have nc-config.
Unless anyone objects or would like to consider other options, I'll make the
modifications to the Makefile in the trunk to add "-lnetcdf" after optionally
adding "-lnetcdff" following option 2. Should we decide to eventually use
nc-config, these changes certainly won't make that transition any more difficult.
Michael
On Thu, Jan 03, 2013 at 09:00:17AM -0700, Doug Jacobsen wrote:
> Hey Michael,
>
> I don't see any problem with 2). The only problem with 1) is people who use
> the older versions of netcdf might have trouble getting it to build again.
>
> Do you know how old these versions you're talking about without nc-config
> are? I'd say if 3.6.1 does have nc-config, using nc-config might be the
> best option since the library will tell us what we need then.
>
> If any of the 3.6.* versions don't have nc-config then the second approach
> is probably the best.
>
> Thanks,
> Doug
>
>
> On Wed, Jan 2, 2013 at 11:42 AM, Michael Duda <duda at ucar.edu> wrote:
>
> > Hi, Folks.
> >
> > It seems that some compilers are particular about the order of libraries
> > that are passed to the linker; specifically, listing the base netCDF
> > library before the Fortran interface library doesn't always work.
> >
> > There are a couple of approaches to solving this problem that occurred
> > to me:
> >
> > 1) We could use nc-config to tell us which flags we need to use;
> > however, older versions of netCDF don't have nc-config.
> >
> > 2) We could modify our Makefile logic for adding the "-lnetcdff" flag to
> > look something like this
> >
> > CPPINCLUDES = -I../inc -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
> > FCINCLUDES = -I../inc -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
> > NCLIB = -lnetcdf
> > NCLIBF = -lnetcdff
> > LIBS = -L$(PIO) -L$(PNETCDF)/lib -L$(NETCDF)/lib -lpio -lpnetcdf
> >
> > ifneq ($(wildcard $(NETCDF)/lib/libnetcdff.*), ) # CHECK FOR NETCDF4
> > LIBS += $(NCLIBF)
> > endif # CHECK FOR NETCDF4
> >
> > LIBS += $(NCLIB)
> >
> >
> > I've just tested the second option on yellowstone, and it appears to be
> > working, and if there is no objection to pursuing this approach, I'll
> > test it more thoroughly.
> >
> > Does anyone else have opinions, comments, or alternatives?
> >
> > Thanks,
> > Michael
> > _______________________________________________
> > mpas-developers mailing list
> > mpas-developers at mailman.ucar.edu
> > http://mailman.ucar.edu/mailman/listinfo/mpas-developers
> >
More information about the mpas-developers
mailing list