[mpas-developers] netCDF Fortran library

Doug Jacobsen jacobsen.douglas at gmail.com
Thu Jan 3 09:00:17 MST 2013


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/mpas-developers/attachments/20130103/2bbfe209/attachment.html 


More information about the mpas-developers mailing list