[Gdal-dev] gdal --with-netcdf troubles

Maciek Sieczka werchowyna at pf.pl
Fri Feb 18 11:52:33 EST 2005


From: "Frank Warmerdam" <fwarmerdam at gmail.com>

> On Fri, 18 Feb 2005 16:32:47 +0100, Maciek Sieczka <werchowyna at pf.pl>
> wrote:
>> And both "--with-hdf4=/usr/local" and "--with-hdf4=/usr/local/lib" work.
>> So
>> I can build --with-hdf4, no problem here.
>>
>> What I mean is that anytime I demand "--with-netcdf=anything_or_whatever"
>> (not having it installed!) the hdf4 support fails to build - although the
>> hdf4 libs ARE THERE in /usr/local/lib (as shown above):
>
> Maciek,
>
> Ah, I see.  Some configure targets, when given an explicit path, just
> "trust" that the libraries are there and add them to the library list.
> I suspect
> what is happening is that the --with-netcdf code isn't checking that
> /usr/local is ok, and instead the libraries are added to the lib list.
> Then
> when it tries to link with the hdf libraries the link fails because the
> netcdf
> libs aren't found.
>
> I can see that this is a confusing effect, but I am not inclined to do
> anything
> about it.   Was there a particular reason you were telling configure to
> use netcdf from /usr/local when you knew it wasn't there?

Well, to me - yes. That's how It happened step by step:

1. Wanted to try to build gdal with netcdf support. Built netcdf from
source, checkinstalled to an rpm.
2. When installing the netcdf from my rpm, I was informed that there is a
conflict between the already installed hdf4 (from an rpm made with
checkinstall as well) and the netcdf I'm trying to install.
3. In general - netcdf refused to install.
4. I noticed that some files (ncgen, ncdump, netcdf.h) are both in my netcdf
and hdf4 rpms. Besides, there are two more files in hdf4 related to netcdf 
by
name - netcdf.inc, netcdf.f90. So I thought that maybe netcdf already comes
together with hdf4 (lame, yes).
5. Then I tried this switch "--with-netcdf=/usr/local/lib" to see how it
would work. And in result not only the netcdf failed to build (which I
suspected to happen after all) but also hdf4 failed while, in theory - it
shouldn't.

And this was confusing so I wanted to try to learn why it happens. Also 
thought it might be an information of some value for you. Sorry for taking 
your time, seems you don't find it any important. Sigh, why am writing this? 
I'd better go do something practical instead ;).

Maciek 




More information about the Gdal-dev mailing list