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

Frank Warmerdam fwarmerdam at gmail.com
Thu Feb 17 18:55:28 EST 2005


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?  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. 

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. 

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the Gdal-dev mailing list