Ticket #1955 (closed defect: fixed)

Opened 10 months ago

Last modified 4 months ago

libz conflict disable HDF4 support

Reported by: mloskot Assigned to: mloskot
Priority: normal Milestone: 1.5.2
Component: ConfigBuild Version: svn-trunk
Severity: normal Keywords: hdf4 libz
Cc: warmerdam

Description

Shortly, running configure with --with-libz=internal disables (or might disable) HDF4 support if there is external installation of the library in the system.

Here is the story in longer version:

  • I use Mac OS X 10.4 with GCC 4.0.1.
  • I have built and installed HDF4 libraries (with jpeg-b6 and szip dependencies)

First test is to configure with HDF4 only support:

./configure --with-hdf4
...
checking for deflateInit_ in -lz... yes
using pre-installed libz
...
checking for SDreaddata in -lmfhdf... yes
checking for H5Fopen in -lhdf5... no
...
  LIBZ support:              external
...
  HDF4 support:              yes
  HDF5 support:              no

Second test includes selection of internal libz version:

./configure --with-hdf4 --with-libz=internal
...
using internal libz code.
...
checking for SDreaddata in -lmfhdf... no
checking for H5Fopen in -lhdf5... no
...
  LIBZ support:              internal
...
  HDF4 support:              no
  HDF5 support:              no

The config.log file gives clear explanation what's the reason of disappearing HDF4 support:

configure:21236: checking for SDreaddata in -lmfhdf
configure:21266: gcc -o conftest -g -O2   conftest.c -lmfhdf -ldf -ljpeg -lnetcdf  -ldl  >&5
/usr/bin/ld: Undefined symbols:
_deflate
_deflateEnd
_deflateInit_
_inflate
_inflateEnd
_inflateInit_
collect2: ld returned 1 exit status

I believe this problem is not specific to Mac OS X but is probably on other Unix systems.

Change History

10/29/07 11:34:19 changed by warmerdam

  • owner changed from warmerdam to mloskot.
  • cc set to warmerdam.
  • milestone set to 1.5.0.

My suggestion would be to just note at:

http://trac.osgeo.org/gdal/wiki/HDF

that HDF builds may not work with internal libz due to linking order issues during configuration. It might also be appropriate to modify configure to at least error out in a more understandable way. In fact, if --with-hdf is specified, failure to link against hdf libraries should be a fatal error, terminating configure.

12/11/07 11:43:57 changed by warmerdam

  • milestone changed from 1.5.0 to 1.5.1.

05/08/08 21:28:55 changed by mloskot

  • status changed from new to assigned.

05/08/08 21:30:09 changed by mloskot

  • status changed from assigned to closed.
  • resolution set to fixed.

As Frank suggested, appropriate comment has been added to the HDF Wiki. Closing.