[gdal-dev] netCDF multi-dimensional support

Simon Eves simon.eves at omnisci.com
Thu Dec 9 12:04:33 PST 2021


OK, so I changed my mind and went ahead and installed libhdf4-alt-dev on
the new box, to match the old, and rebuilt GDAL the same way.

Now everything matches.

The GDAL build is therefore silently behaving differently based on the
presence or absence of HDF4.

Please advise of the actual dependencies and correct options here, as I
will need to get this working in our production dependencies bundle build
too.

Thanks!

Simon

On Thu, Dec 9, 2021 at 11:32 AM Simon Eves <simon.eves at omnisci.com> wrote:

> I am trying to build GDAL 3.4.0 with "full" netCDF support, but getting
> different results on my two machines, both Ubuntu 20.04 with
> supposedly-the-same dev environment.
>
> Both have the libnetcdf-dev (4.7.3) apt package installed, and both have
> working nc-config, which reports the same thing on both.
>
> I am configuring GDAL as follows:
>
> ./configure --prefix=$PREFIX --without-geos --with-libkml=$PREFIX
> --with-proj=$PREFIX --with-libtiff=internal --with-geotiff=internal
> --with-netcdf=yes
>
> Both configure logs attached.
> ____________________________________________________________________
>
> OLD (works)
>
> $ apt list --installed | egrep -i "hdf|cdf"
> hdf5-helpers/focal,now 1.10.4+repack-11ubuntu1 amd64 [installed,automatic]
> libhdf4-0-alt/focal,now 4.2.14-1ubuntu1 amd64 [installed,automatic]
> libhdf4-alt-dev/focal,now 4.2.14-1ubuntu1 amd64 [installed,automatic]
> libhdf5-103/focal,now 1.10.4+repack-11ubuntu1 amd64 [installed,automatic]
> libhdf5-cpp-103/focal,now 1.10.4+repack-11ubuntu1 amd64
> [installed,automatic]
> libhdf5-dev/focal,now 1.10.4+repack-11ubuntu1 amd64 [installed,automatic]
> libnetcdf-dev/focal,now 1:4.7.3-1 amd64 [installed,automatic]
> libnetcdf15/focal,now 1:4.7.3-1 amd64 [installed,automatic]
>
> $ gdalinfo --formats | egrep -i "hdf|cdf"
> GMT -raster- (rw): GMT NetCDF Grid Format
> netCDF -raster,multidimensional raster,vector- (rw+vs): Network Common
> Data Format
> HDF4 -raster,multidimensional raster- (ros): Hierarchical Data Format
> Release 4
> HDF4Image -raster- (rw+): HDF4 Dataset
> HDF5 -raster,multidimensional raster- (rovs): Hierarchical Data Format
> Release 5
> HDF5Image -raster- (rov): HDF5 Dataset
>
> $ gdalinfo file.nc | head -1
> Driver: netCDF/Network Common Data Format
>
> File imports fine
> ____________________________________________________________________
>
> NEW (problematic)
>
> $ apt list --installed | egrep -i "hdf|cdf"
> hdf5-helpers/focal,now 1.10.4+repack-11ubuntu1 amd64 [installed,automatic]
> libhdf5-103/focal,now 1.10.4+repack-11ubuntu1 amd64 [installed,automatic]
> libhdf5-cpp-103/focal,now 1.10.4+repack-11ubuntu1 amd64
> [installed,automatic]
> libhdf5-dev/focal,now 1.10.4+repack-11ubuntu1 amd64 [installed,automatic]
> libnetcdf-dev/focal,now 1:4.7.3-1 amd64 [installed]
> libnetcdf15/focal,now 1:4.7.3-1 amd64 [installed,automatic]
>
> $ gdalinfo --formats | egrep -i "hdf|cdf"
> GMT -raster- (rw): GMT NetCDF Grid Format
> netCDF -raster,vector- (rw+s): Network Common Data Format
> HDF5 -raster,multidimensional raster- (rovs): Hierarchical Data Format
> Release 5
> HDF5Image -raster- (rov): HDF5 Dataset
>
> $ gdalinfo file.nc | head -1
> Driver: HDF5/Hierarchical Data Format Release 5
>
> Some sub-datasets will not open
> ____________________________________________________________________
>
> Note that the old machine already had HDR4 libs (and consequentially GDAL
> built with support for that too, even though I did not explicitly reqiuest
> HDF4 or HDF5 support in the configure), which may be the issue, although I
> am loath to just install HDF4 on the new (freshly built two weeks ago)
> machine if I don't need to.
>
> On the old machine, gdalinfo reports the file as netCDF just fine, and the
> netCDF driver claims to have multi-dimensional support. The driver on the
> new one does not, and the file reports as plain HDF5, and some sub-datasets
> will not open (presumably multi-dimensional ones!)
>
> I am failing to find anything in the docs about the dependency chain here,
> or anything about having to explicitly enable multi-dimensional support in
> the build.
>
> I don't know if the netCDF file in question is public-domain, so I would
> rather not send it to you at this time. I can find out, if that would help,
> although I doubt the file itself is the issue.
>
> Please advise. Thanks! :)
>
> Simon
>
> --
> <http://www.omnisci.com/>
> Simon Eves
> Senior Graphics Engineer, Rendering Group
> 100 Montgomery St (5th Floor), San Francisco, CA 94104, USA
>
>
> Email: simon.eves at omnisci.com | Cell:  +1 (415) 902-1996
>
>

-- 
<http://www.omnisci.com/>
Simon Eves
Senior Graphics Engineer, Rendering Group
100 Montgomery St (5th Floor), San Francisco, CA 94104, USA


Email: simon.eves at omnisci.com | Cell:  +1 (415) 902-1996
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20211209/8d7b9c91/attachment.html>


More information about the gdal-dev mailing list