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

Re: [netcdfgroup] nc-config and @NC_FLIBS@



Jim,

> We've based our build for netcdf4 on
> nc-config --flibs
> 
> to give us the libraries needed to link netcdf to our f90 code,
> that no longer works now.
> 
> But there is a new nf-config so why can't nc-config --flibs just call
> nf-config --libs so that I don't have to make another special case for
> netcdf version handling?
> 
> If I make the switch to use pkg-config do I have any assurance that you
> will continue to support it?   We really need some stability in the tools
> we rely on.

OK, sorry, I see what was intended now.  I also didn't mean to imply
that we're taking away nc-config and nf-config to replace them with
pkg-config, just that pkg-config is an additional tool we want to
support.  It's developed and maintained by someone else, so all we have
to do is provide and install the necessary library metadata in a simple
text file it uses.

I'll get nf-config and nc-config working properly and let you know when
they're available for testing.

--Russ

> On Wed, Mar 28, 2012 at 2:50 PM, Russ Rew <address@hidden> wrote:
> 
> > Hi Thomas,
> >
> > > > shell$ nc-config --flibs
> > > > -L/some/path/lib @NC_FLIBS@
> > >
> > > Oh, I see ... there is nf-config now. I have to adapt my Makefile, then,
> > > for another case. Now it would be rather smart if nc-config would call
> > > nf-config transparently for fortran stuff, eh? Even better: What
> > > exactly is the reason not to provide files for pkg-config instead? Now
> > > we have two config scripts for NetCDF, I guess three with the C++
> > > interface. It gets messy and I wonder what for.
> > >
> > > But, well, putting a hint about nf-config in some docs would also be
> > > nice... it may be obvious, but I was not looking for it; just trying
> > > to get NetCDF re-installed quickly to get working Fortran module again
> > > (because of non-existent binary compatibility even between versions of
> > > the same compiler).
> >
> > The functionality is there, but as you've pointed out, it's not properly
> > documented and it looks like there were bugs using pkg-config for
> > netcdf-fortran.  The pkg-config files for the netCDF 4.2 C and
> > Fortran packages get installed when you invoke "make install", e.g. for
> > version 4.2 of netcdf and netcdf-fortran:
> >
> >  /usr/local/lib/pkgconfig:
> >  -rw-r--r--  1 root root  315 Mar 27 12:45 netcdf-fortran.pc
> >  -rw-r--r--  1 root root  305 Mar 26 12:37 netcdf.pc
> >
> > The C library pkg-config seems to work OK:
> >
> >  $ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
> >  $ pkg-config --cflags --libs netcdf
> >  -I/usr/local/include  -L/usr/local/lib -lnetcdf
> >
> > I've just tidied-up the C pkg-config file and redone the Fortran file,
> > by modifying the top-level files netcdf.pc.in and netcdf-fortran.pc.in
> > in the snapshot releases for each package.  I've also documented the use
> > of pkg-config for the Fortran version 4.2 library with a couple of
> > examples in the man4/netcdf-f77.texi and man4/netcdf-f90.texi files.
> >
> > Basically it's used like this:
> >
> >  $ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
> >  $ f90 myprogram.f90 -o myprogram `pkg-config --cflags --libs
> > netcdf-fortran`
> >
> > where here `--cflags' means *compiler* flags and `libs' requests that
> > the appropriate libraries be linked in, so it's different from the
> > nf-config options of "fflags" and "flibs", but consistent with the
> > pkg-config conventions.
> >
> > If you want to try these, you can get just the netcdf.pc.in and
> > netcdf-fortran.pc.in files from our svn tree:
> >
> >  http://svn.unidata.ucar.edu/repos/netcdf/trunk/netcdf.pc.in
> >
> > http://svn.unidata.ucar.edu/repos/netcdf-fortran/trunk/netcdf-fortran.pc.in
> >
> > Then put them in the top-level directories of the C and Fortran
> > releases, configure, make check, and make install.  The generated
> > pkg-config files get installed in the ${prefix}/lib/pkgconfig directory.
> >
> > Thanks for pointing out the problems.  Please let me know if you have
> > other improvements to suggest.  I wasn't able to figure out what was
> > meant by
> >
> > > ... nc-config would call nf-config transparently for fortran stuff
> >
> > but I think pkg-config is a more scalable solution.
> >
> > --Russ
> >
> 
> 
> 
> -- 
> Jim Edwards
> 
> CESM Software Engineering Group
> National Center for Atmospheric Research
> Boulder, CO
> 303-497-1842
> 
> --e89a8f2347f5f16f9504bc542cad
> Content-Type: text/html; charset=ISO-8859-1
> Content-Transfer-Encoding: quoted-printable
> 
> Hi Russ,<br><br>We&#39;ve based our build for netcdf4 on <br>nc-config --fl=
> ibs <br><br>to give us the libraries needed to link netcdf to our f90 code,=
> <br>that no longer works now. <br><br>But there is a new nf-config so why c=
> an&#39;t nc-config --flibs just call nf-config --libs so that I don&#39;t h=
> ave to make another special case for netcdf version handling?<br>
> <br>If I make the switch to use pkg-config do I have any assurance that you=
>  will continue to support it?=A0=A0 We really need some stability in the to=
> ols we rely on.<br><br>Thanks<br>Jim<br><br><div class=3D"gmail_quote">On W=
> ed, Mar 28, 2012 at 2:50 PM, Russ Rew <span dir=3D"ltr">&lt;<a href=3D"mail=
> to:address@hidden">address@hidden</a>&gt;</span> wrote:<br>
> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
> x #ccc solid;padding-left:1ex">Hi Thomas,<br>
> <div class=3D"im"><br>
> &gt; &gt; shell$ nc-config --flibs<br>
> &gt; &gt; -L/some/path/lib @NC_FLIBS@<br>
> &gt;<br>
> &gt; Oh, I see ... there is nf-config now. I have to adapt my Makefile, the=
> n,<br>
> &gt; for another case. Now it would be rather smart if nc-config would call=
> <br>
> &gt; nf-config transparently for fortran stuff, eh? Even better: What<br>
> &gt; exactly is the reason not to provide files for pkg-config instead? Now=
> <br>
> &gt; we have two config scripts for NetCDF, I guess three with the C++<br>
> &gt; interface. It gets messy and I wonder what for.<br>
> &gt;<br>
> &gt; But, well, putting a hint about nf-config in some docs would also be<b=
> r>
> &gt; nice... it may be obvious, but I was not looking for it; just trying<b=
> r>
> &gt; to get NetCDF re-installed quickly to get working Fortran module again=
> <br>
> &gt; (because of non-existent binary compatibility even between versions of=
> <br>
> &gt; the same compiler).<br>
> <br>
> </div>The functionality is there, but as you&#39;ve pointed out, it&#39;s n=
> ot properly<br>
> documented and it looks like there were bugs using pkg-config for<br>
> netcdf-fortran. =A0The pkg-config files for the netCDF 4.2 C and<br>
> Fortran packages get installed when you invoke &quot;make install&quot;, e.=
> g. for<br>
> version 4.2 of netcdf and netcdf-fortran:<br>
> <br>
>  =A0/usr/local/lib/pkgconfig:<br>
>  =A0-rw-r--r-- =A01 root root =A0315 Mar 27 12:45 netcdf-fortran.pc<br>
>  =A0-rw-r--r-- =A01 root root =A0305 Mar 26 12:37 netcdf.pc<br>
> <br>
> The C library pkg-config seems to work OK:<br>
> <br>
>  =A0$ export PKG_CONFIG_PATH=3D/usr/local/lib/pkgconfig<br>
>  =A0$ pkg-config --cflags --libs netcdf<br>
>  =A0-I/usr/local/include =A0-L/usr/local/lib -lnetcdf<br>
> <br>
> I&#39;ve just tidied-up the C pkg-config file and redone the Fortran file,<=
> br>
> by modifying the top-level files <a href=3D"http://netcdf.pc.in"; target=3D"=
> _blank">netcdf.pc.in</a> and <a href=3D"http://netcdf-fortran.pc.in"; target=
> =3D"_blank">netcdf-fortran.pc.in</a><br>
> in the snapshot releases for each package. =A0I&#39;ve also documented the =
> use<br>
> of pkg-config for the Fortran version 4.2 library with a couple of<br>
> examples in the man4/netcdf-f77.texi and man4/netcdf-f90.texi files.<br>
> <br>
> Basically it&#39;s used like this:<br>
> <br>
>  =A0$ export PKG_CONFIG_PATH=3D/usr/local/lib/pkgconfig<br>
>  =A0$ f90 myprogram.f90 -o myprogram `pkg-config --cflags --libs netcdf-for=
> tran`<br>
> <br>
> where here `--cflags&#39; means *compiler* flags and `libs&#39; requests th=
> at<br>
> the appropriate libraries be linked in, so it&#39;s different from the<br>
> nf-config options of &quot;fflags&quot; and &quot;flibs&quot;, but consiste=
> nt with the<br>
> pkg-config conventions.<br>
> <br>
> If you want to try these, you can get just the <a href=3D"http://netcdf.pc.=
> in" target=3D"_blank">netcdf.pc.in</a> and<br>
> <a href=3D"http://netcdf-fortran.pc.in"; target=3D"_blank">netcdf-fortran.pc=
> .in</a> files from our svn tree:<br>
> <br>
>  =A0<a href=3D"http://svn.unidata.ucar.edu/repos/netcdf/trunk/netcdf.pc.in"=
>  target=3D"_blank">http://svn.unidata.ucar.edu/repos/netcdf/trunk/netcdf.pc=
> .in</a><br>
>  =A0<a href=3D"http://svn.unidata.ucar.edu/repos/netcdf-fortran/trunk/netcd=
> f-fortran.pc.in" target=3D"_blank">http://svn.unidata.ucar.edu/repos/netcdf=
> -fortran/trunk/netcdf-fortran.pc.in</a><br>
> <br>
> Then put them in the top-level directories of the C and Fortran<br>
> releases, configure, make check, and make install. =A0The generated<br>
> pkg-config files get installed in the ${prefix}/lib/pkgconfig directory.<br=
> >
> <br>
> Thanks for pointing out the problems. =A0Please let me know if you have<br>
> other improvements to suggest. =A0I wasn&#39;t able to figure out what was<=
> br>
> meant by<br>
> <br>
> &gt; ... nc-config would call nf-config transparently for fortran stuff<br>
> <br>
> but I think pkg-config is a more scalable solution.<br>
> <span class=3D"HOEnZb"><font color=3D"#888888"><br>
> --Russ<br>
> </font></span></blockquote></div><br><br clear=3D"all"><br>-- <br>Jim Edwar=
> ds<br><br><font>CESM Software Engineering Group<br>National Center for Atmo=
> spheric Research<br>Boulder, CO <br>303-497-1842<br></font><br>
> 
> --e89a8f2347f5f16f9504bc542cad--