Re: [netcdfgroup] No libnetcdff.a installed in /usr/local/lib

  • To: YuLeonard <yulq@xxxxxxx>
  • Subject: Re: [netcdfgroup] No libnetcdff.a installed in /usr/local/lib
  • From: Ed Hartnett <ed@xxxxxxxxxxxxxxxx>
  • Date: Thu, 10 Apr 2008 09:36:51 -0600
YuLeonard <yulq@xxxxxxx> writes:

> No, I didn't. I thought you give me the right answer. Could you tell
> me what's the difference between the libnetcdf libraries with and
> without this option? Does this option affect the behavior of
> programs (WRF, WPS etc.) I build later?
>

The netCDF library has always done something a little funny: it
crammed fortran, fortran 90, and C functions into the same library.

This was a convenience, so that only -lnetcdf needed to be used,
whether you were linking to fortran or C.

And this is still the default behavior of the netCDF build.

But someones one wants the libraries to be separate. That's why
--enable-separate-fortran is there, to put the fortran and fortran 90
functions in their own library, which must be included in addition to
the C library.

This is particularly useful when shared libraries are built, because
otherwise the OS will look for the fortran run-time libraries even for
C programs, and complain.

So if you have built with --enable-shared, or
--enable-separate-fortran, you need to include -lnetcdff on your link
line, to get the fortran code. Otherwise -lnetcdf will get both C and
Fortran.

Does this answer your question?

Thanks!

Ed
-- 
Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx


  • 2008 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: