[Gdal-dev] gdal --with-netcdf troubles
Maciek Sieczka
werchowyna at pf.pl
Fri Feb 18 10:32:47 EST 2005
From: "Frank Warmerdam" <fwarmerdam at gmail.com>
> On Thu, 17 Feb 2005 23:57:53 +0100, Maciek Sieczka <werchowyna at pf.pl>
> wrote:
>> Folks
>>
>> I'm having problems with building gdal --with-netcdf.
>>
>> How should I proceed? I can't install netcdf (3.5.1) alone because it
>> claims
>> it is in conflict with already installed hdf4. And when I try to use the
>> netcdf components which came to my system from this hdf4 (4.2r0), I get
>> an
>> error like below:
>>
>> ./configure --with-hdf4=/usr/local --with-libz=internal --with-png=internal
>> --with-libtiff=internal --with-geotiff=internal --with-jpeg=internal --with-gif=internal
>> --with-geos=yes --with-netcdf=/usr/local/lib
>>
>> checking for FMEObjects... no
>> checking for SDreaddata in -lmfhdf... no
>> checking for SDreaddata in -lhdf4... no
>> checking for SDreaddata in -lmfhdf... no
>> checking for SDreaddata in -lmfhdf... no
>> configure: error: HDF4 support requested with arg /usr/local, but neither
>> hdf4 nor mfhdf lib found
>>
>> But - when I don't specify --with-netcdf=... then gdal builds OK with
>> hdf4
>> support:
>>
>> checking for FMEObjects... no
>> checking for SDreaddata in -lmfhdf... no
>> checking for SDreaddata in -lhdf4... no
>> checking for SDreaddata in -lmfhdf... yes
>> checking for jpc_decode in -ljasper... no
>>
>> Not that I need netcdf badly, but I got puzzled and would like to sort it
>> out. Besides - why does gdal complain about hdf4 when it's all about
>> netcdf
>> actually?
> Maciek,
>
> I don't know why the HDF isn't working. Are you sure the libraries
> are under /usr/local?
Frank
My hdf4 libs are in /usr/local/lib :
[pingwin at localhost lib]$ $PWD
bash: /usr/local/lib: is a directory
[pingwin at localhost lib]$ ls | grep -i hdf
libmfhdf.a
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):
./configure --with-hdf4=/usr/local/lib --with-libz=internal --with-png=internal
--with-libtiff=internal --with-geotiff=internal --with-jpeg=internal --with-gif=internal
--with-geos=yes --with-netcdf=/usr/local/lib
checking for FMEObjects... no
checking for SDreaddata in -lmfhdf... no
checking for SDreaddata in -lhdf4... no
checking for SDreaddata in -lmfhdf... no
checking for SDreaddata in -lmfhdf... no
configure: error: HDF4 support requested with arg /usr/local/lib, but
neither hdf4 nor mfhdf lib found
Which I thought was strange and potentially missleading - it is the netcdf
support which should fail to build in such case, not the hdf4 support. Or am
I wrong here?
Just to clariffy more here is a proof that if I don't input the
"--with-netcdf=..." all is just fine:
./configure --with-hdf4=/usr/local/lib --with-libz=internal --with-png=internal
--with-libtiff=internal --with-geotiff=internal --with-jpeg=internal --with-gif=internal
--with-geos=yes
checking for FMEObjects... no
checking for SDreaddata in -lmfhdf... no
checking for SDreaddata in -lhdf4... no
checking for SDreaddata in -lmfhdf... yes
> You can't use the netcdf API embedded in
> the HDF libraries to read netcdf files. I believe the API is intended
> to make it easy for netcdf applications to read HDF files.
Ok.
> If you want netcdf, then include it and not HDF. If you want HDF
> include HDF and not netcdf. If you really want both there is some
> messy hacking you will have to do rebuilding the HDF library to not
> include the fake netcdf API. I managed to accomplish this on windows
> and unix here but it is a mess.
And it is implemented in your FWTools 0.9.6 right?
bye
Maciek
More information about the Gdal-dev
mailing list